Home |
Function http_find_string_value Function http_add_get_functions Function http_add_post_functions Function http_set_browser_list Function get_function_entry Function http_set_put_function |
Function get_function_entryCallback functions of this type are called by the Web Server when CGI references are found in a Web page. void get_function_entry(struct io_context * io_context, char * param); Parametersio_contextThe I/O context of the current HTTP session. paramPointer to any parameters to the CGI function, or NULL if no parameters were specified. Get callbacks can be used to allow the application to dynamically generate and insert HTML code into a Web page. When a Web page contains a CGI reference such as: <!--#exec cgi="/cgi_demo.fn"--> it will scan all application supplied arrays installed through function http_add_get_functions for a function associated with the CGI function named cgi_demo.fn. Example:static struct get_function_entry my_get_functions[] = { {"cgi_demo.fn", cgi_demo }, {"cgi_demo2.c", cgi_demo2 }, {"push_demo.fn", push_demo }, {"", END_OF_TABLE} }; http_add_get_functions(my_get_functions); If one is found (cgi_demo() in this case), the function is called and the comment containing the CGI function call is not sent to the browser. Instead, the callback can send data. When the callback returns, the rest of the HTML page is sent to the browser. The callback can use io_context->buffer to send data to the browser using xn_line_put. Note that the buffer is no larger than 1514 bytes. Demo program WebServer contains a complete example of CGI Get callbacks.
|