wmf.c File Reference

Main Page Alphabetical List Data Structures File List Data Fields Globals

# wmf.c File Reference

## Functions

wmf_error_t | wmf_api_create (wmfAPI **API_return, unsigned long flags, wmfAPI_Options *options)
wmf_error_t | wmf_api_destroy (wmfAPI *API)
char * | wmf_help ()

## Function Documentation

wmf_error_t wmf_api_create | ( | wmfAPI ** | API_return,
|  | unsigned long | flags,
|  | wmfAPI_Options * | options
| ) |

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.

wmf_error_t wmf_api_destroy | ( | 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.

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>.
      --wmf-write=<file>              write metafile to <file>.

    Report bugs to <http://www.wvware.com/>.

Returns:
  Returns the above as a string.