Defining Customized Server-Parsed HTML Tags
Chapter 3 Server-Parsed HTML Tags 121
The tag execution function must return an int that indicates whether the server
should proceed to the next instruction in
obj.conf or not, which is one of:
•
REQ_PROCEED – the execution was successful.
•
REQ_NOACTION – nothing happened.
•
REQ_ABORTED –anerroroccurred.
•
REQ_EXIT – the connection was lost.
The other functions you must define for your tag are:
•
ShtmlTagInstanceLoad
This is called when a page containing the tag is parsed. It is not called if the
page is retrieved from the browser’s cache. It basically serves as a constructor,
the result of which is cached and is passed into
ShtmlTagExecuteFunc
whenever the execution function is called.
•
ShtmlTagInstanceUnload
This is basically a destructor for cleaning up whatever was created in the
ShtmlTagInstanceLoad function. It gets passed the result that was originally
returned from the
ShtmlTagInstanceLoad function.
•
ShtmlTagPageLoadFunc
Thisis called when a page containingthetag isexecuted,regardlessof whether
thepageisstillinthebrowser’scacheornot.Thisprovidesawaytomake
information persistent between occurrences of the same tag on the same page.
•
ShtmlTagPageUnLoadFn
This is called after a page containing the tag has executed. It provides a way to
clean up any allocations done in a
ShtmlTagPageLoadFunc and hence gets
passed the result returned from the
ShtmlTagPageLoadFunc.
Komentarze do niniejszej Instrukcji