libdas2
das2 core C utilities
|
Reading and writing Das2 Stream objects to standard I/O. More...
Reading and writing Das2 Stream objects to standard I/O.
#include <stdio.h>
#include <zlib.h>
#include <das2/stream.h>
#include <das2/oob.h>
#include <das2/processor.h>
Go to the source code of this file.
Data Structures | |
struct | DasIO |
Tracks input and output operations for das2 stream headers and data. More... | |
Functions | |
void | del_DasIO (DasIO *pThis) |
Free resources associated with a DasIO structure Typically you don't need to do this as heap memory is free'ed when the program exits anyway. More... | |
const char * | LogLvl_string (int logLevel) |
Returns a string identifying the log level. More... | |
int | DasIO_serverExcept (DasIO *pThis, const char *fmt,...) |
Throw a server exception and close the stream. More... | |
int | DasIO_queryExcept (DasIO *pThis, const char *fmt,...) |
Throw a bad query exception and close the stream. More... | |
int | DasIO_closeNoData (DasIO *pThis, const char *fmt,...) |
Send a "no data in interval" message and close the stream. More... | |
void del_DasIO | ( | DasIO * | pThis | ) |
Free resources associated with a DasIO structure Typically you don't need to do this as heap memory is free'ed when the program exits anyway.
But if you need a destructor, here it is.
pThis | The DasIO abject to delete. Any associated file handles except for standard input and standard output are closed. The pointer given to this function should be set to NULL after the function completes. |
const char* LogLvl_string | ( | int | logLevel | ) |
Returns a string identifying the log level.
logLevel | a log level value as defined in DasIO_setLogLvl() |
int DasIO_serverExcept | ( | DasIO * | pThis, |
const char * | fmt, | ||
... | |||
) |
Throw a server exception and close the stream.
If no stream descriptor has been sent then a stub descriptor is output first. The output is encoded for XML transport so there is no need to escape the text prior to sending. The total mesage may not exceed 2047 UTF-8 bytes.
If this function is called on an input stream the program will immediately exit with the value 10.
int DasIO_queryExcept | ( | DasIO * | pThis, |
const char * | fmt, | ||
... | |||
) |
Throw a bad query exception and close the stream.
If no stream descriptor has been sent then a stub descriptor is output first. The output is encoded for XML transport so there is no need to escape the text prior to sending. The total mesage may not exceed 2047 UTF-8 bytes.
Not having any data for the requested parameter range is not cause for throwing an exception. Send a no data in interval response instead.
If this function is called on an input stream the program will immediately exit with the value 10.
int DasIO_closeNoData | ( | DasIO * | pThis, |
const char * | fmt, | ||
... | |||
) |
Send a "no data in interval" message and close the stream.
If no stream descriptor has been sent then a stub descriptor is output first. The output is encoded for XML transport so there is no need to escape the text prior to sending. The total mesage may not exceed 2047 UTF-8 bytes.
Not having any data for the requested parameter range is not cause for throwing an exception. Send a no data in interval response instead.
If this function is called on an input stream the program will immediately exit with the value 10.