|
mupdf
|


Go to the source code of this file.
Classes | |
| struct | fz_option_enums |
| struct | fz_option |
| struct | fz_options |
Typedefs | |
| typedef struct fz_options | fz_options |
| typedef struct fz_option | fz_option |
Functions | |
| fz_options * | fz_new_options (fz_context *ctx, const char *option_string) |
| void | fz_parse_options (fz_context *ctx, fz_options *options, const char *option_string) |
| fz_options * | fz_keep_options (fz_context *ctx, fz_options *opts) |
| void | fz_drop_options (fz_context *ctx, fz_options *opts) |
| int | fz_lookup_option (fz_context *ctx, fz_options *options, const char *key, const char **val) |
| int | fz_lookup_option_yes (fz_context *ctx, fz_options *options, const char *key) |
| int | fz_lookup_option_boolean (fz_context *ctx, fz_options *options, const char *key, int *x) |
| int | fz_lookup_option_float (fz_context *ctx, fz_options *options, const char *key, float *x) |
| int | fz_lookup_option_integer (fz_context *ctx, fz_options *options, const char *key, int *x) |
| int | fz_lookup_option_unsigned (fz_context *ctx, fz_options *options, const char *key, unsigned int *x) |
| int | fz_lookup_option_enum (fz_context *ctx, fz_options *options, const char *key, int *x, const fz_option_enums *enum_list) |
| void | fz_validate_options (fz_context *ctx, fz_options *options, const char *prefix) |
| void | fz_warn_on_unused_options (fz_context *ctx, fz_options *options, const char *prefix) |
| void | fz_throw_on_unused_options (fz_context *ctx, fz_options *options, const char *prefix) |
| int | fz_count_options (fz_context *ctx, fz_options *options) |
| const char * | fz_get_option_by_index (fz_context *ctx, fz_options *options, int i, const char **val) |
| void | fz_access_option_by_index (fz_context *ctx, fz_options *options, int i) |
| typedef struct fz_option fz_option |
Implementation details: subject to change. Only public for SWIG built wrappers.
| typedef struct fz_options fz_options |
An fz_options structure encapsulates a list of key, or key=value options, together with details such as whether they have been used or not.
| void fz_access_option_by_index | ( | fz_context * | ctx, |
| fz_options * | options, | ||
| int | i ) |
Mark a given option index as being accessed.
| int fz_count_options | ( | fz_context * | ctx, |
| fz_options * | options ) |
Count the number of options in an options structure.
| void fz_drop_options | ( | fz_context * | ctx, |
| fz_options * | opts ) |
Drop an fz_options object.
| const char * fz_get_option_by_index | ( | fz_context * | ctx, |
| fz_options * | options, | ||
| int | i, | ||
| const char ** | val ) |
Get an option by index.
| fz_options * fz_keep_options | ( | fz_context * | ctx, |
| fz_options * | opts ) |
Take a new reference to the options struct.
| int fz_lookup_option | ( | fz_context * | ctx, |
| fz_options * | options, | ||
| const char * | key, | ||
| const char ** | val ) |
Check to see if a key is present in the options object.
If it is not, then return 0.
If val is non-NULL, *val will be updated to point to the value.
The option will be recorded as having been accessed.
| int fz_lookup_option_boolean | ( | fz_context * | ctx, |
| fz_options * | options, | ||
| const char * | key, | ||
| int * | x ) |
Check to see if a key is present, and is true or false.
If it is absent, return 0.
If it is true (empty, 1, yes, true, or enabled), *x is assigned 1, the invalid flag is cleared, marked as accessed, returns 1.
If it is false (0, no, false, or disabled), *x is assigned 0, the invalid flag is clear, marked as accessed, returns 0.
If it is any other value, it is marked as invalid, returns -1.
| int fz_lookup_option_enum | ( | fz_context * | ctx, |
| fz_options * | options, | ||
| const char * | key, | ||
| int * | x, | ||
| const fz_option_enums * | enum_list ) |
| int fz_lookup_option_float | ( | fz_context * | ctx, |
| fz_options * | options, | ||
| const char * | key, | ||
| float * | x ) |
Check to see if an option is present and is of the given type.
If an option is absent, this returns 0.
If an option is present, but not of the required type, it will be flagged internally as being invalid, and we will return -1.
If an option is present, and of the required type, any previously set invalid flag will be cleared.
This means we can (for example) lookup an option as an enum, and then safely look for it being an integer if that fails.
| int fz_lookup_option_integer | ( | fz_context * | ctx, |
| fz_options * | options, | ||
| const char * | key, | ||
| int * | x ) |
| int fz_lookup_option_unsigned | ( | fz_context * | ctx, |
| fz_options * | options, | ||
| const char * | key, | ||
| unsigned int * | x ) |
| int fz_lookup_option_yes | ( | fz_context * | ctx, |
| fz_options * | options, | ||
| const char * | key ) |
Check to see if a key is a boolean.
If it is absent, return 0.
If it is true (empty, 1, yes, true, or enabled), returns 1, clears any invalid flag, and counts as accessed.
If it is false (0, no, false, or disabled), returns 0, clears any invalid flag, and counts as accessed.
If it is absent, or any other value, it is marked as invalid, returns 0.
| fz_options * fz_new_options | ( | fz_context * | ctx, |
| const char * | option_string ) |
Create an options object, with the initial contents parsed from the string. See fz_parse_options for details on the string parsing. If the string is NULL, the options object will be initialized but empty.
| void fz_parse_options | ( | fz_context * | ctx, |
| fz_options * | options, | ||
| const char * | option_string ) |
Parse more options from an options string, and add them to an existing fz_options object.
The parser supports three distinct syntaxes (identified by the leading character).
| void fz_throw_on_unused_options | ( | fz_context * | ctx, |
| fz_options * | options, | ||
| const char * | prefix ) |
Throw for any options being unused or invalid.
Either this, or fz_warn_on_unused_options should always be called (in non-error cases at least) before dropping options.
Returns 0 if OK, non-zero otherwise.
| void fz_validate_options | ( | fz_context * | ctx, |
| fz_options * | options, | ||
| const char * | prefix ) |
This should be called by any consumer of options after it has looked up the options it understands. This will throw if any options were found to be flagged as being invalid.
| void fz_warn_on_unused_options | ( | fz_context * | ctx, |
| fz_options * | options, | ||
| const char * | prefix ) |
Warn for any options being unused. Throw if any options are invalid.
Either this, or fz_throw_on_unused_options should always be called (in non-error cases at least) before dropping options.
Returns 0 if OK, non-zero otherwise.