Creates and initializes an instance of the libwmf library for a specified device layer.
Parameters:
API_return
pointer to a wmfAPI* (the API handle use henceforth)
flags
bitwise OR of WMF_OPT_ options
options
pointer to wmfAPI_Options structure
This is the first and necessary step when using libwmf. Options are passed via the wmfAPI_Options structure and flags. wmf_api_create allocates the wmfAPI structure and initializes the color and font tables, the metafile player, and the device layer. If successful then the pointer to the wmfAPI structure is returned via API_return, otherwise all allocated memory is released and the library exits with an appropriate error.
Returns:
The error state of the library: wmf_E_None indicates successful creation and initialization of the library, and *API_return will be non-zero. For any other error value *API_return will be zero.
Allocate memory of specified size and attach to the API's memory manager's internal list.
Parameters:
API
the API handle
number
number or elements
size
size in bytes of memory required by one element
With syntax similar to calloc(), wmf_calloc() allocates number * size bytes of memory and adds a reference to it in the memory manager's list. To free the memory, use wmf_free().
Returns:
Pointer to new memory, or zero on failure. Sets error state wmf_E_InsMem on failure.
Detach memory attached to the API's memory manager's internal list.
Parameters:
API
the API handle
mem
pointer to memory previously allocated via the API
This removes the reference in the API's memory manager's internal list, and the memory will not, therefore, be released by wmf_api_destroy(). To free subsequently, use free().
Frees memory attached to the API's memory manager's internal list.
Parameters:
API
the API handle
mem
pointer to memory previously allocated via the API
Syntax is similar to free().
char* wmf_help
( 
void
)
Additional wmf-related options:
--wmf-error[=yes|no] switch for error reports.
--wmf-debug[=yes|no] switch for debug reports, if any.
--wmf-ignore-nonfatal[=yes|no] switch to ignore (some) non-fatal errors.
--wmf-diagnostics emit diagnostic information.
--wmf-fontdir=<path> add <path> to list of font directories.
--wmf-sys-fonts use system fonts, if any found.
--wmf-sys-fontmap=<file> use system xml-fontmap file <file>.
--wmf-xtra-fonts use non-system fonts, if any found.
--wmf-xtra-fontmap=<file> use non-system xml-fontmap file <file>.
--wmf-gs-fontmap=<file> use ghostscript file <file>.
Report bugs to <http://www.wvware.com/>.
Allocate memory of specified size and attach to the API's memory manager's internal list.
Parameters:
API
the API handle
size
size in bytes of memory required
With syntax similar to malloc(), wmf_malloc() allocates size bytes of memory and adds a reference to it in the memory manager's list. To free the memory, use wmf_free().
Returns:
Pointer to new memory, or zero on failure. Sets error state wmf_E_InsMem on failure.
(Re)Allocate memory of specified size and attach to the API's memory manager's internal list.
Parameters:
API
the API handle
mem
pointer to memory previously allocated via the API
size
new size in bytes of memory required
With syntax similar to realloc(), wmf_realloc() allocates size bytes of memory and adds a reference to it in the memory manager's list. To free the memory, use wmf_free(). If mem is zero, this is equivalent to a call to wmf_malloc(). If size is zero, the memory is released via wmf_free().
Returns:
Pointer to new memory, or zero on failure. Sets error state wmf_E_InsMem on failure.
Duplicate string and attach to the API's memory manager's internal list.
Parameters:
API
the API handle
str
a string
With syntax similar to strdup(), wmf_strdup() allocates the necessary memory via wmf_malloc() and copies the string. Use wmf_free() to free the string.
Returns:
Pointer to new string, or zero on failure. Sets error state wmf_E_InsMem on failure, or wmf_E_Glitch if str is zero.
char* wmf_strstr
( 
const char *
haystack,
const char *
needle
) 
Substring search.
Parameters:
hatstack
a string
needle
a substring to search for in haystack
With syntax identical to strstr(), wmf_strstr() searches for string needle in string haystack.
Returns:
Pointer to substring needle found in haystack, or zero if not found.