SaRegisterStringSiteIts function prototype is:
int SaRegisterStringSite(char* file, char* site, char* value);The first parameter,
file
, specifies the filepath name of an HTML template file. If non-null and not an empty string, this file will be "played", if it is not already on the "play" list.
If NULL or an empty string, the second parameter, site
, will still be registered, but can be overridden by a similar site name with a specified filename.
The third parameter, value
, is a string to substitute for the specified data site. The string is copied locally.
In this way your program can specify a string for inclusion in the HTML at run-time, but the content of the string can be decided upon just prior to the function call.
SaRegisterFuncSite()
. Its function prototype is:typedef void (*SaSiteCallback)(char* file, char* site, void* client); int SaRegisterFuncSite(char* file, char* site, SaSiteCallback func, void* client);The first parameter,
file
, specifies the filepath name of an HTML template file. If non-null and not an empty string, this file will be "played", if it is not already on the "play" list.
If NULL or an empty string, the second parameter, site
, will still be registered, but can be overridden by a similar site name with a specified filename.
The third parameter, func
, is a site callback function which must be of the type, SaSiteCallback, as declared above. The fourth parameter, client
, is a general purpose pointer that is sent to the Callback Function. It must be valid when function is called.
Data Site Callbacks are powerful features which extend the functionality of Sapphire. See the section on Login Functionality in the User's Guide as one example of how they can be used.
With this technique, your program can call upon functions to provide processing for the HTML page. For example, the callback could provide news text from a wire service such as API or Reuters, always providing the latest breaking story whenever the HTML was played.