HttpRegisterScript


int HttpRegisterScript ( HttpConfigData *pConfig , HttpScriptCB pCbScript , const char *pSuffix )




 
Registers the script plugin. This function must called directly before HttpDaenon(...) is called. 

 
pConfig config data of the server
 
pCbScript callback for tag data
 
pSuffix is the suffix of the script files. (0 means ".htmx")

 
Returns 0 if the plugin was installed or an error code

  1 = no more user parameters
  2 = suffix is to long
 

 

The script plugin loads a html file and replaces all tags with data from a callback.

A tag has the format:
"@@<Name>@@"

The callback funktion for the tag data has this syntax:

   typedef int (_cdecl *HttpScriptCB)(HttpConnection hConn,char *pBuffer,int iSize,const char *pTag) 
  hConn pointer to the connection data 
 
  pBuffer pointer to the buffer for the tag data
 
  iSize is the size of the buffer
 
  pTag is the name of the tag
 

Returns the count of data bytes or -1 to stop the transmission.
If the HTTP_SCRIPT_RECALL flag is set the the tag will be called again (for lage data blocks). 

 

 

see also:

AzHttp Overview | HttpInitScript | HttpRegisterFolder | HttpRegisterIcon | HttpRegisterTree