das2C
das core C utilities (v3)
Loading...
Searching...
No Matches
Data Structures | Functions
oob.h File Reference

Defines the "Out of Band" objects in a stream. More...

#include <das3/util.h>
#include <das3/buffer.h>
Include dependency graph for oob.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  OutOfBand
 A container for Out-of-Band data. More...
 
struct  OobExcept
 describes an exception that can live in a stream. More...
 
struct  OobComment
 describes human-consumable messages that exist on the stream. More...
 

Functions

DAS_API const char * das_except_toStr (das_except_t nType, int nDasVer)
 The stream name for an exception type.
 
DAS_API das_except_t das_except_fromStr (const char *sType)
 The exception type for a stream name, from either stream version.
 
DAS_API void OutOfBand_clean (OutOfBand *pThis)
 Clean up extra memory allocated when an out of band object is initialized.
 
DAS_API void OobExcept_set (OobExcept *pThis, das_except_t nType, const char *sMsg)
 Set an exception structure to a particular exception.
 

Detailed Description

Defines the "Out of Band" objects in a stream.

These are comments and exceptions

Function Documentation

◆ das_except_toStr()

DAS_API const char * das_except_toStr ( das_except_t  nType,
int  nDasVer 
)

The stream name for an exception type.

Two of the names changed between stream versions:

das_except_t das2.2 das3.0
DAS_EX_UNKNOWN Unknown Unknown
DAS_EX_NO_DATA NoDataInInterval NoMatchingData
DAS_EX_SERVER_ERR ServerError ServerError
DAS_EX_QUERY_ERR IllegalArgument QueryError
Parameters
nTypeThe exception type
nDasVerThe stream major version, 2 or 3. das1 streams have no exceptions.
Returns
A static string, or NULL for an unknown type or version

◆ das_except_fromStr()

DAS_API das_except_t das_except_fromStr ( const char *  sType)

The exception type for a stream name, from either stream version.

The two vocabularies never use one name for two different types, so this needs no version. Streams may carry types outside the table, so an unrecognized name is not an error.

Returns
The type, or DAS_EX_UNKNOWN for NULL or an unrecognized name

◆ OutOfBand_clean()

DAS_API void OutOfBand_clean ( OutOfBand *  pThis)

Clean up extra memory allocated when an out of band object is initialized.

Parameters
pThisthe out of band item to clean up.

◆ OobExcept_set()

DAS_API void OobExcept_set ( OobExcept *  pThis,
das_except_t  nType,
const char *  sMsg 
)

Set an exception structure to a particular exception.

This is an initializer, it does not free a previous message. Call OutOfBand_clean() before setting the same structure again.

Parameters
pThisA pointer to the exception to initialize
nTypeThe type of exception, one of:
  • DAS_EX_NO_DATA
  • DAS_EX_SERVER_ERR
  • DAS_EX_QUERY_ERR
sMsgThe message for the exception, this is a human readable string.