01.06.2013 Views

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>IPC<strong>@CHIP</strong></strong> <strong>Documentation</strong> Index<br />

Data Structures<br />

Data Structures used in CGI API - <strong>SC12</strong> <strong>@CHIP</strong>-<strong>RTOS</strong> <strong>V1.10</strong><br />

Here are the data structures used by the CGI API.<br />

All constants and data structures are defined in the header file cgi.h<br />

Notes:<br />

● Byte alignment is required for all data structures used within the API.<br />

Contents :<br />

● _typedef CGI_Entry<br />

● _define CGI HTTP Request<br />

● _typedef FormItem<br />

● _typedef rpCgi<br />

typedef CGI_Entry<br />

Comments<br />

typedef struct tag_cgi_table<br />

{<br />

char *PathPtr; // Name of the page, URL<br />

int method; // http method: Get, Head or Post<br />

RpCgiFuncPtr CgiFuncPtr; // ptr to callback function for this page<br />

} CGI_Entry;<br />

The members of the CGI_Entry structure should be filled as follows.<br />

PathPtr<br />

This is a far pointer to a zero terminated URL address of the page. (URL's are case sensitive.)<br />

method<br />

This intis an enumeratorused to specify what HTTP method this CGI function supports.<br />

CgiFuncPtr<br />

This is a far vector to the CGI function for this Web page. For Borland C compilers the RpCgiFuncPtrtype is:<br />

typedef void (huge _pascal *RpCgiFuncPtr)<br />

(rpCgi far *CgiRequestPtr);<br />

... and therefore the CGI function itself is declared as ...<br />

void huge _pascal CGI_Func(rpCgi far *CgiRequest);<br />

For Microsoft Visual C compilers the RpCgiFuncPtrtype is:<br />

typedef void far _saveregs _loadds _pascal<br />

(*RpCgiFuncPtr)(rpCgi far *CgiRequestPtr);<br />

Page 369 / 400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!