A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/icuplug_8h.html below:

ICU 77.1: common/unicode/icuplug.h File Reference

C API: ICU Plugin API.

C API: ICU Plugin API

C API allowing run-time loadable modules that extend or modify ICU functionality.

Loading and Configuration

At ICU startup time, the environment variable "ICU_PLUGINS" will be queried for a directory name. If it is not set, the preprocessor symbol "DEFAULT_ICU_PLUGINS" will be checked for a default value.

Within the above-named directory, the file "icuplugins##.txt" will be opened, if present, where ## is the major+minor number of the currently running ICU (such as, 44 for ICU 4.4, thus icuplugins44.txt)

The configuration file has this format:

An example configuration file is, in its entirety:

# this is icuplugins44.txt

testplug.dll myPlugin hello=world

Plugins are categorized as "high" or "low" level. Low level are those which must be run BEFORE high level plugins, and before any operations which cause ICU to be 'initialized'. If a plugin is low level but causes ICU to allocate memory or become initialized, that plugin is said to cause a 'level change'.

At load time, ICU first queries all plugins to determine their level, then loads all 'low' plugins first, and then loads all 'high' plugins.
Plugins are otherwise loaded in the order listed in the configuration file.

Implementing a Plugin

... Set up some ICU things here....

... unload, clean up ...

}

}

uint32_t UPlugTokenReturn

Return value from a plugin entrypoint.

UPlugReason

Reason code for the entrypoint's call.

@ UPLUG_REASON_LOAD

The plugin is being loaded.

@ UPLUG_REASON_UNLOAD

The plugin is being unloaded.

@ UPLUG_REASON_QUERY

The plugin is being queried for info.

struct UPlugData UPlugData

Typedef for opaque structure passed to/from a plugin.

U_CAPI void uplug_setPlugName(UPlugData *plug, const char *name)

Set the human-readable name of this plugin.

U_CAPI void uplug_setPlugLevel(UPlugData *plug, UPlugLevel level)

Set the level of this plugin.

#define UPLUG_TOKEN

Random Token to identify a valid ICU plugin.

@ UPLUG_LEVEL_HIGH

The plugin can run at any time.

#define U_CAPI

This is used to declare a function as a public ICU C API.

UErrorCode

Standard ICU4C error code type, a substitute for exceptions.

The UPlugData* is an opaque pointer to the plugin-specific data, and is used in all other API calls.

The API contract is:

  1. The plugin MUST always return UPLUG_TOKEN as a return value- to indicate that it is a valid plugin.

  2. When the 'reason' parameter is set to UPLUG_REASON_QUERY, the plugin MUST call uplug_setPlugLevel() to indicate whether it is a high level or low level plugin.

  3. When the 'reason' parameter is UPLUG_REASON_QUERY, the plugin SHOULD call uplug_setPlugName to indicate a human readable plugin name.
Internal:
Do not use. This API is for internal use only. ICU 4.4 Technology Preview

Definition in file icuplug.h.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4