GLG Toolkit, C / C++ API Library  Version 4.6
Custom URL Fetching

This callback may be used to provide custom handling of fetching data from URLs. More...

Detailed Description

This callback may be used to provide custom handling of fetching data from URLs.

Typedefs

typedef char *(* GlgGetURLCallback) (char *request, void *reserved)
 A custom callback used to fetch data from URLs, installed via GlgSetGetURLCallback. More...
 

Typedef Documentation

◆ GlgGetURLCallback

typedef char*(* GlgGetURLCallback) (char *request, void *reserved)

A custom callback used to fetch data from URLs, installed via GlgSetGetURLCallback.

URLs may be used to load drawing files from remote servers, as well as to use map server installed at a remote web server.

Parameters
requestURL string to fetch data from, or NULL if the callback is invoked to delete the last fetched temporary file.
reservedThis parameter is reserved for future implementations.
Returns
Temporary file name containing the fetched data or NULL to indicate that fetching failed. NULL should also be returned if the callback is invoked with NULL request to delete the previously fetched temporary file.

A custom callback implementation on Linux should delete a temporary file containing the previously fetched URL when it is invoked to fetch the next URL. When GlgTerminate is invoked, the callback will be invoked with NULL request to clean up the last used temporary file.

A default GlgGetURLCB callback is provided as a part of the GLG API library and is activated by default for the GLG editors on all platforms, as well as for the GLG C API runtime on Windows. GlgSetGetURLCallback may be used activate the default callback for the GLG C API runtime on Linux:

GlgSetGetURLCallback( GlgGetURLCB );

To use the default callback on Linux, the GLG_WGET_PATH environment variable should be set and contain the path to the wget command that will be used for fetching URLs.