36#define DAS2_MAX_PROCESSORS 10
38#define DASIO_NAME_SZ 128
55typedef struct das_io_struct {
67 char sName[DASIO_NAME_SZ];
160#define DasIO_getModel(P) (P->model)
414#define LOGLVL_FINEST 0
415#define LOGLVL_FINER 300
416#define LOGLVL_FINE 400
417#define LOGLVL_CONFIG 500
418#define LOGLVL_INFO 600
419#define LOGLVL_WARNING 700
420#define LOGLVL_ERROR 800
608 DasIO* pThis,
DasBuf* pBuf,
size_t nBytes,
char cStop
int DasErrCode
return code type 0 indicates success, negative integer indicates failure
Definition defs.h:184
DAS_API void del_DasIO(DasIO *pThis)
Free resources associated with a DasIO structure Typically you don't need to do this as heap memory i...
DAS_API int DasIO_queryExcept(DasIO *pThis, const char *fmt,...)
Throw a bad query exception and close the stream.
DAS_API int DasIO_serverExcept(DasIO *pThis, const char *fmt,...)
Throw a server exception and close the stream.
DAS_API const char * LogLvl_string(int logLevel)
Returns a string identifying the log level.
DAS_API int DasIO_closeNoData(DasIO *pThis, const char *fmt,...)
Send a "no data in interval" message and close the stream.
Defines the "Out of Band" objects in a stream.
Callback processing for das2 stream reads and writes.
Buffer class to handle accumulating byte streams.
Definition buffer.h:47
Base structure for Stream Header Items.
Definition descriptor.h:74
Tracks input and output operations for das2 stream headers and data.
Definition io.h:55
DAS_API int DasIO_read(DasIO *pThis, DasBuf *pBuf, size_t nBytes)
Analog of fread (Low-level API)
DAS_API DasIO * new_DasIO_socket(const char *sProg, int nSockFd, const char *mode)
Create a new DasIO object from a socket.
DasErrCode DasIO_writeData(DasIO *pThis, DasDesc *pDesc, int iPktId)
Send all packet data associated with a descriptor.
DAS_API DasIO * new_DasIO_cfile(const char *sProg, FILE *file, const char *mode)
Create a new DasIO object from a standard C FILE.
DAS_API DasErrCode DasIO_writeDesc(DasIO *pThis, DasDesc *pDesc, int iPktId)
Serialize a top-level descriptor to an destination.
DAS_API size_t DasIO_write(DasIO *pThis, const char *data, int length)
Analog of fwrite (Low-level API)
DAS_API DasErrCode DasIO_writeStreamDesc(DasIO *pThis, DasStream *pSd)
Writes the data describing the stream to the output channel (e.g.
DAS_API void DasIO_setLogLvl(DasIO *pThis, int minLevel)
Set the minimum log level that will be transmitted on the stream.
DAS_API DasErrCode DasIO_writeException(DasIO *pThis, OobExcept *pSe)
Output an exception structure.
DAS_API int DasIO_addProcessor(DasIO *pThis, StreamHandler *pProc)
Add a packet processor to be invoked during I/O operations.
DAS_API int DasIO_getLogLvl(const DasIO *pThis)
Get logging verbosity level.
DAS_API DasErrCode DasIO_setTaskProgress(DasIO *pThis, int progress)
Place rate-limited progress comments on an output stream.
DAS_API DasErrCode DasIO_writeComment(DasIO *pThis, OobComment *pSc)
Output a StreamComment Stream comments are generally messages interpreted only by humans and may chan...
DAS_API DasErrCode DasIO_writePktDesc(DasIO *pThis, PktDesc *pd)
Writes the data describing a packet type to the output channel (e.g.
DAS_API int DasIO_getc(DasIO *pThis)
Analog of getc (Low-level API)
DAS_API DasIO * new_DasIO_ssl(const char *sProg, void *pSsl, const char *mode)
Create a new DasIO object using an encrypted connection.
DAS_API DasIO * new_DasIO_file(const char *sProg, const char *sFile, const char *mode)
Create a new DasIO object from a disk file.
DAS_API DasErrCode DasIO_model(DasIO *pThis, int nModel)
Set the parsed stream data model.
DAS_API void DasIO_embedAsBytes(DasIO *pThis, bool bEnable)
Recover undecodable embedded formats as opaque bytes instead of failing.
DAS_API DasErrCode DasIO_writePktData(DasIO *pThis, PktDesc *pPd)
Sends the data packet on to the stream after checking validity.
DAS_API void DasIO_throwException(DasIO *pThis, DasStream *pSd, das_except_t type, char *msg)
Set the logging level.
DAS_API DasIO * new_DasIO_cmd(const char *sProg, const char *sCmd)
Create a new DasIO object from a shell command.
DAS_API void DasIO_close(DasIO *pThis)
Normal stream close with no unusual conditions Closes the output file descriptor, flushes a gzip buff...
DAS_API DasIO * new_DasIO_str(const char *sProg, char *sbuf, size_t len, const char *mode)
Create a new DasIO object for reading/writing to memory buffer.
DAS_API int DasIO_readUntil(DasIO *pThis, DasBuf *pBuf, size_t nBytes, char cStop)
Read until encountering a given byte (Low-level API)
DAS_API int DasIO_readAll(DasIO *pThis)
Starts the processing of the stream read from FILE* infile.
DAS_API int DasIO_printf(DasIO *pThis, const char *format,...)
Print a string with a format specifier (Low-level API) This works similar to the C printf function.
DAS_API DasErrCode DasIO_sendLog(DasIO *pThis, int level, char *msg,...)
Send a log message onto the stream at the given log level.
Describes the stream itself, in particular the compression used, current packetDescriptors,...
Definition stream.h:91
describes an exception that can live in a stream.
Definition oob.h:57
Holds information for a single packet type in a Das2 stream.
Definition packet.h:138
A set of callbacks used for input and output stream processing.
Definition processor.h:129