index.html
Main Page
classes.html
Alphabetical List
annotated.html
Data Structures
files.html
File List
functions.html
Data Fields
globals.html
Globals
api.c File Reference
Functions
types_8h.html#a5
wmf_error_t
api_8c.html#a0
wmf_lite_create
(
types_8h.html#a22
wmfAPI
**API_return, unsigned long flags,
types_8h.html#a21
wmfAPI_Options
*options)
types_8h.html#a5
wmf_error_t
api_8c.html#a1
wmf_lite_destroy
(
types_8h.html#a22
wmfAPI
*API)
void
api_8c.html#a2
wmf_assert
(
types_8h.html#a22
wmfAPI
*API, char *file, int line)
void
api_8c.html#a3
wmf_error
(
types_8h.html#a22
wmfAPI
*API, char *file, int line, char *msg)
void
api_8c.html#a4
wmf_debug
(
types_8h.html#a22
wmfAPI
*API, char *file, int line, char *msg)
void
api_8c.html#a5
wmf_printf
(
types_8h.html#a22
wmfAPI
*API, char *msg,...)
void *
api_8c.html#a6
wmf_malloc
(
types_8h.html#a22
wmfAPI
*API, size_t size)
void *
api_8c.html#a7
wmf_calloc
(
types_8h.html#a22
wmfAPI
*API, size_t number, size_t size)
void *
api_8c.html#a8
wmf_realloc
(
types_8h.html#a22
wmfAPI
*API, void *mem, size_t size)
void
api_8c.html#a9
wmf_free
(
types_8h.html#a22
wmfAPI
*API, void *mem)
void
api_8c.html#a10
wmf_detach
(
types_8h.html#a22
wmfAPI
*API, void *mem)
char *
api_8c.html#a11
wmf_strdup
(
types_8h.html#a22
wmfAPI
*API, const char *str)
char *
api_8c.html#a12
wmf_str_append
(
types_8h.html#a22
wmfAPI
*API, char *pre, char *post)
char *
api_8c.html#a13
wmf_strstr
(const char *haystack, const char *needle)
void
api_8c.html#a14
wmf_status_function
(
types_8h.html#a22
wmfAPI
*API, void *context,
types_8h.html#a13
wmfStatus
function)
unsigned long
api_8c.html#a15
wmf_strbuf_grow
(
types_8h.html#a22
wmfAPI
*API)
Function Documentation
void wmf_assert
(
types_8h.html#a22
wmfAPI
*
API
,
char *
file
,
int
line
)
Set the error state of the library to wmf_E_Assert.
Parameters:
API
the API handle
file
file name
line
line number
This should only be called via the macro
api_8h.html#a2
WMF_ASSERT(API,<expr>)
which is defined (for debug builds only) as:
#define WMF_ASSERT(Z,M) if (!(M)) wmf_assert (Z,__FILE__,__LINE__)
i.e., if <expr> evaluates to 0 then call
api_8c.html#a2
wmf_assert()
with current file name and line number.
void* wmf_calloc
(
types_8h.html#a22
wmfAPI
*
API
,
size_t
number
,
size_t
size
)
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(),
api_8c.html#a7
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
api_8c.html#a9
wmf_free()
.
Returns:
Pointer to new memory, or zero on failure. Sets error state
wmf_E_InsMem
on failure.
void wmf_debug
(
types_8h.html#a22
wmfAPI
*
API
,
char *
file
,
int
line
,
char *
msg
)
Print message to debug stream.
Parameters:
API
the API handle
file
file name
line
line number
msg
message to print
This should only be called via the macro
api_8h.html#a1
WMF_DEBUG(API,msg)
which (in debug builds only) calls
api_8c.html#a4
wmf_debug()
with the current file name and line number.
void wmf_detach
(
types_8h.html#a22
wmfAPI
*
API
,
void *
mem
)
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
api_8h.html#a23
wmf_api_destroy()
. To free subsequently, use free().
void wmf_error
(
types_8h.html#a22
wmfAPI
*
API
,
char *
file
,
int
line
,
char *
msg
)
Print message to error stream.
Parameters:
API
the API handle
file
file name
line
line number
msg
message to print
This should only be called via the macro
api_8h.html#a0
WMF_ERROR(API,msg)
which calls
api_8c.html#a3
wmf_error()
with the current file name and line number.
void wmf_free
(
types_8h.html#a22
wmfAPI
*
API
,
void *
mem
)
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().
types_8h.html#a5
wmf_error_t
wmf_lite_create
(
types_8h.html#a22
wmfAPI
**
API_return
,
unsigned long
flags
,
types_8h.html#a21
wmfAPI_Options
*
options
)
Creates and initializes an instance of the
libwmf
library (lite interface) 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 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.
wmf_lite_create () ignores command line arguments, if any are given, and does
not
attempt to set up font mapping.
The library should be closed using the corresponding wmf_lite_destroy () function.
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.
types_8h.html#a5
wmf_error_t
wmf_lite_destroy
(
types_8h.html#a22
wmfAPI
*
API
)
Close the device layer, if open, and release all allocated memory attached to the memory manager.
Parameters:
API
the API handle
Returns:
The final error state of the library.
void* wmf_malloc
(
types_8h.html#a22
wmfAPI
*
API
,
size_t
size
)
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(),
api_8c.html#a6
wmf_malloc()
allocates
size
bytes of memory and adds a reference to it in the memory manager's list. To free the memory, use
api_8c.html#a9
wmf_free()
.
Returns:
Pointer to new memory, or zero on failure. Sets error state
wmf_E_InsMem
on failure.
void wmf_printf
(
types_8h.html#a22
wmfAPI
*
API
,
char *
msg
,
...
)
Print formatted message to debug stream.
Parameters:
API
the API handle
msg
message to print
With syntax similar to printf(),
api_8c.html#a5
wmf_printf()
prints formatted output to the debug stream.
void* wmf_realloc
(
types_8h.html#a22
wmfAPI
*
API
,
void *
mem
,
size_t
size
)
(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(),
api_8c.html#a8
wmf_realloc()
allocates
size
bytes of memory and adds a reference to it in the memory manager's list. To free the memory, use
api_8c.html#a9
wmf_free()
. If
mem
is zero, this is equivalent to a call to
api_8c.html#a6
wmf_malloc()
. If
size
is zero, the memory is released via
api_8c.html#a9
wmf_free()
.
Returns:
Pointer to new memory, or zero on failure. Sets error state
wmf_E_InsMem
on failure.
void wmf_status_function
(
types_8h.html#a22
wmfAPI
*
API
,
void *
context
,
types_8h.html#a13
wmfStatus
function
)
Set a status call-back function.
Parameters:
API
the API handle
context
handle for user data
function
call-back function
The metafile player calls the status function after each record.
char* wmf_str_append
(
types_8h.html#a22
wmfAPI
*
API
,
char *
pre
,
char *
post
)
Create concatenatation of two strings and attach to the API's memory manager's internal list.
Parameters:
API
the API handle
pre
a string
post
a string
api_8c.html#a12
wmf_str_append()
allocates the necessary memory via
api_8c.html#a6
wmf_malloc()
, copies
pre
into the string and appends
post
. Use
api_8c.html#a9
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.
unsigned long wmf_strbuf_grow
(
types_8h.html#a22
wmfAPI
*
API
)
Increase the size of the internal string buffer.
Parameters:
API
the API handle
libwmf
maintains an internal buffer for string operations.
api_8c.html#a15
wmf_strbuf_grow()
increases the size by 64.
Returns:
Returns the new size of the buffer. Uses
api_8c.html#a8
wmf_realloc()
, so may set
wmf_E_InsMem
on failure.
char* wmf_strdup
(
types_8h.html#a22
wmfAPI
*
API
,
const char *
str
)
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(),
api_8c.html#a11
wmf_strdup()
allocates the necessary memory via
api_8c.html#a6
wmf_malloc()
and copies the string. Use
api_8c.html#a9
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:
haystack
a string
needle
a substring to search for in haystack
With syntax identical to strstr(),
api_8c.html#a13
wmf_strstr()
searches for string
needle
in string
haystack
.
Returns:
Pointer to substring
needle
found in
haystack
, or zero if not found.
Generated on Tue Dec 10 19:53:47 2002 for libwmf by
http://www.doxygen.org/index.html
doxygen
1.2.18
