HttpInitScript


int HttpInitScript ( HttpScriptCB pCbScript , int iUserId )



 
Initalizes the script plugin for external use with HttpScriptTrans(...).

 
pCbScript callback for tag data
 
iUserId user id for internal use (three id's are used)
 
Returns 0 if the plugin was installed or an error code

 1 = wrong user id
 
 

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 | HttpRegisterScript | HttpScriptTrans