Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
CspRunTm.h File Reference
#include "HttpServer.h"
#include "CspCompileCommon.h"
Include dependency graph for CspRunTm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CspReader
 Abstract interface class for reading the "dat" file generated by HttpLink. More...
 

Macros

#define CspReader_constructor(o, httpDiskRead)
 Initialize an invalid reader interface; does not open a file. More...
 
#define CspReader_isValid(o)
 
#define CspReader_setIsValid(o)   ((CspReader*)o)->validFlag=CspReader_validFlag
 Mark the implementation initialized after opening/checking its data. More...
 
#define CspReader_read(httpData, data, offset, size, blockStart)
 Invoke the installed CspReader_Read callback synchronously. More...
 

Typedefs

typedef int(* CspReader_Read) (struct CspReader *o, void *data, U32 offset, U32 size, int blockStart)
 Prototype for the CspReader callback function. More...
 
typedef struct CspReader CspReader
 Abstract interface class for reading the "dat" file generated by HttpLink. More...
 

Macro Definition Documentation

◆ CspReader_constructor

#define CspReader_constructor (   o,
  httpDiskRead 
)
Value:
do {\
(o)->readCB = httpDiskRead; \
(o)->validFlag = (U16)~CspReader_validFlag; \
}while(0)
uint16_t U16
Unsigned 16-bit integer.
Definition: GenPrimT.h:91

Initialize an invalid reader interface; does not open a file.

Parameters
oRequired storage to initialize.
httpDiskReadRequired CspReader_Read callback, retained for future calls. Call setIsValid() only after the derived implementation initializes successfully.

◆ CspReader_isValid

#define CspReader_isValid (   o)
Value:
(((CspReader*)o)->readCB != 0 && \
((CspReader*)o)->validFlag == CspReader_validFlag)
Abstract interface class for reading the "dat" file generated by HttpLink.
Definition: CspRunTm.h:126

Returns
True when readCB is non-NULL and the initialization marker is set. This checks object initialization, not whether a file remains open or readable. Derived readers must manage their resource state.
Parameters
oRequired initialized reader.

◆ CspReader_read

#define CspReader_read (   httpData,
  data,
  offset,
  size,
  blockStart 
)
Value:
(*((CspReader*)httpData)->readCB)((CspReader*)httpData, data, \
offset, size, blockStart)

Invoke the installed CspReader_Read callback synchronously.

Parameters
dataWritable destination for size bytes.
offsetAbsolute byte offset in the backing data.
sizeExact byte count.
blockStartTrue identifies the start of a CSP data block.
Returns
Zero on a complete read, negative on failure; no partial count. The reader must be initialized with a non-NULL callback.
Parameters
httpDataRequired initialized reader with a non-NULL callback.

◆ CspReader_setIsValid

#define CspReader_setIsValid (   o)    ((CspReader*)o)->validFlag=CspReader_validFlag

Mark the implementation initialized after opening/checking its data.

This does not install a callback or validate the backing file.

Parameters
oRequired initialized reader.

Typedef Documentation

◆ CspReader

typedef struct CspReader CspReader

Abstract interface class for reading the "dat" file generated by HttpLink.

See also
FileCspReader
CspReader_Read