Barracuda Application Server C/C++ Reference
NO
C Server Pages

Detailed Description

C Server Pages make it possible to insert C or C++ code into HTML template files by using special tags. The technology is similar to other server-side technologies such as JSP, PHP, ASP, etc.

See the CSP user manual for more information on CSP.

See also
Barracuda Introduction
Collaboration diagram for C Server Pages:

Classes

struct  CspReader
 Abstract interface class for reading the "dat" file generated by. More...
 
struct  FileCspReader
 Example code that shows you how to write a CspReader driver object. More...
 

Typedefs

typedef void(* CspInit) (struct HttpDir *cspRoot, struct CspReader *reader)
 Function prototype for the "initialize function" generated by CspLink. More...
 
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. More...
 
typedef FileCspReader FileCspReader
 Example code that shows you how to write a CspReader driver object. More...
 

Typedef Documentation

◆ CspInit

typedef void(* CspInit) (struct HttpDir *cspRoot, struct CspReader *reader)

Function prototype for the "initialize function" generated by CspLink.

CspLink groups together CSP pages and generates a CspInit function. You must call the method at system startup.

Parameters
cspRootthe position in the virtual files system where you want the CSP to be installed.
readerthe interface between the CSP data file and the generated CSP engine.

◆ CspReader

typedef struct CspReader CspReader

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

HttpLink.

See also
FileCspReader
CspReader_Read

◆ CspReader_Read

typedef int(* CspReader_Read) (struct CspReader *o, void *data, U32 offset, U32 size, int blockStart)

Prototype for the CspReader callback function.

Parameters
dataa pointer to the data area where the data read should be copied.
offsetthe offset position into the "dat" file.
sizenumber of bytes to read.
blockStartTRUE if this is the beginning of a block. All blocks are protected by a magic number. The httpDiskRead function can use this for integrity check.

◆ FileCspReader

Example code that shows you how to write a CspReader driver object.

The Web-Server uses the CspReader driver object when requesting data from the "dat" file generated by CspLink.

This example code uses the file system for reading the "dat" file. The constructor opens the "dat" file and method "diskRead" uses the Posix function fseek for setting the file pointer to the requested offset position and function fread for reading the actual data.