das2C
das core C utilities (v3)
Functions
send.h File Reference

More...

#include <stdarg.h>
#include <stdlib.h>
Include dependency graph for send.h:

Go to the source code of this file.

Functions

void das_send_stub (int nDasVer)
 Send a stub stream header. More...
 
int das_send_nodata (int nDasVer, const char *sFmt,...)
 Output a no data in interval message. More...
 
int das_send_queryerr (int nDasVer, const char *sFmt,...)
 Output a "user-messed up" message when receiving a badly formed query. More...
 
int das_send_srverr (int nDasVer, const char *sFmt,...)
 Output a server problem message (i.e. More...
 
void das_send_msg (int nDasVer, const char *source, const char *sFmt,...)
 Output a log status message (i.e. More...
 
void das_send_progbeg (int nDasVer, const char *sSrc, double fBeg, double fEnd)
 Start a progress bar on the recieving client. More...
 
void das_send_progup (int nDasVer, const char *sSrc, double fCurrent)
 Update a progress bar on the receiving client. More...
 

Detailed Description

The das core library libdas2.a supplies a full API for generating Das2 streams, however these streams are relativily simple and don't really require a heavy weight library for applications that only write a fixed das2 stream type. Most readers fall into this use case.

These functions supply a few fixed functions to assist Das2 readers.

Function Documentation

◆ das_send_stub()

void das_send_stub ( int  nDasVer)

Send a stub stream header.

All das2 streams must start with a stream header. This function sends a minimal stream header which is just good enough to be the prefix for an error message. Only call this if your program needs to output an error message before it's sent it's own stream header.

◆ das_send_nodata()

int das_send_nodata ( int  nDasVer,
const char *  sFmt,
  ... 
)

Output a no data in interval message.

Returns
the integer 0

◆ das_send_queryerr()

int das_send_queryerr ( int  nDasVer,
const char *  sFmt,
  ... 
)

Output a "user-messed up" message when receiving a badly formed query.

Returns
the integer 47

◆ das_send_srverr()

int das_send_srverr ( int  nDasVer,
const char *  sFmt,
  ... 
)

Output a server problem message (i.e.

missing spice kernel, etc)

Returns
the integer 48

◆ das_send_msg()

void das_send_msg ( int  nDasVer,
const char *  source,
const char *  sFmt,
  ... 
)

Output a log status message (i.e.

reading file T120101.DAT)

◆ das_send_progbeg()

void das_send_progbeg ( int  nDasVer,
const char *  sSrc,
double  fBeg,
double  fEnd 
)

Start a progress bar on the recieving client.

Warning
Not thread safe, only use from your writing thread

This function keeps track of the last progress update and will not issue a new one unless at least 1% more progress has been made

Parameters
nDasVerthe das stream version number you're writing, either 1 or 2
sSrcThe name of the thing setting the progress bar
fBegsome begin mark, can be any floating point number.
fEndsome end mark, can be any floating point number bigger than fBeg

◆ das_send_progup()

void das_send_progup ( int  nDasVer,
const char *  sSrc,
double  fCurrent 
)

Update a progress bar on the receiving client.

Warning
Not thread safe, only use from your writing thread
Parameters
nDasVerthe das stream version number you're writing, either 1 or 2
sSrcThe name of the thing setting the progress bar
fCurrentsome floating point number between the start and end marks set in das_send_progbeg().