ICU 56.1: icuplug.h Source File

ICU 56.1 56.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

icuplug.h
Go to the documentation of this file.
1 /*
2 ******************************************************************************
3 *
4 * Copyright (C) 2009-2015, International Business Machines
5 * Corporation and others. All Rights Reserved.
6 *
7 ******************************************************************************
8 *
9 * FILE NAME : icuplug.h
10 *
11 * Date Name Description
12 * 10/29/2009 sl New.
13 ******************************************************************************
14 */
15
105 #ifndef ICUPLUG_H
106 #define ICUPLUG_H
107
108 #include "unicode/utypes.h"
109
110
111 #if UCONFIG_ENABLE_PLUGINS
112
113
114
115 /* === Basic types === */
116
117 #ifndef U_HIDE_INTERNAL_API
118
125 struct UPlugData;
126 typedef struct UPlugData UPlugData;
127
135 #define UPLUG_TOKEN 0x54762486
136
141 #define UPLUG_NAME_MAX 100
142
143
150 typedef uint32_t UPlugTokenReturn;
151
156 typedef enum {
157 UPLUG_REASON_QUERY = 0,
158 UPLUG_REASON_LOAD = 1,
159 UPLUG_REASON_UNLOAD = 2,
160 UPLUG_REASON_COUNT
161 } UPlugReason;
162
163
171 typedef enum {
172 UPLUG_LEVEL_INVALID = 0,
173 UPLUG_LEVEL_UNKNOWN = 1,
174 UPLUG_LEVEL_LOW = 2,
175 UPLUG_LEVEL_HIGH = 3,
176 UPLUG_LEVEL_COUNT
177 } UPlugLevel;
178
186 typedef UPlugTokenReturn (U_EXPORT2 UPlugEntrypoint) (
187 UPlugData *plug,
188 UPlugReason reason,
189 UErrorCode *status);
190
191 /* === Needed for Implementing === */
192
201 U_INTERNAL void U_EXPORT2
202 uplug_setPlugNoUnload(UPlugData *plug, UBool dontUnload);
203
210 U_INTERNAL void U_EXPORT2
211 uplug_setPlugLevel(UPlugData *plug, UPlugLevel level);
212
219 U_INTERNAL UPlugLevel U_EXPORT2
220 uplug_getPlugLevel(UPlugData *plug);
221
229 U_INTERNAL UPlugLevel U_EXPORT2
230 uplug_getCurrentLevel(void);
231
232
238 U_INTERNAL UErrorCode U_EXPORT2
239 uplug_getPlugLoadStatus(UPlugData *plug);
240
247 U_INTERNAL void U_EXPORT2
248 uplug_setPlugName(UPlugData *plug, const char *name);
249
256 U_INTERNAL const char * U_EXPORT2
257 uplug_getPlugName(UPlugData *plug);
258
265 U_INTERNAL const char * U_EXPORT2
266 uplug_getSymbolName(UPlugData *plug);
267
275 U_INTERNAL const char * U_EXPORT2
276 uplug_getLibraryName(UPlugData *plug, UErrorCode *status);
277
285 U_INTERNAL void * U_EXPORT2
286 uplug_getLibrary(UPlugData *plug);
287
294 U_INTERNAL void * U_EXPORT2
295 uplug_getContext(UPlugData *plug);
296
303 U_INTERNAL void U_EXPORT2
304 uplug_setContext(UPlugData *plug, void *context);
305
306
314 U_INTERNAL const char * U_EXPORT2
315 uplug_getConfiguration(UPlugData *plug);
316
332 U_INTERNAL UPlugData* U_EXPORT2
333 uplug_nextPlug(UPlugData *prior);
334
347 U_INTERNAL UPlugData* U_EXPORT2
348 uplug_loadPlugFromEntrypoint(UPlugEntrypoint *entrypoint, const char *config, UErrorCode *status);
349
350
361 U_INTERNAL UPlugData* U_EXPORT2
362 uplug_loadPlugFromLibrary(const char *libName, const char *sym, const char *config, UErrorCode *status);
363
371 U_INTERNAL void U_EXPORT2
372 uplug_removePlug(UPlugData *plug, UErrorCode *status);
373 #endif /* U_HIDE_INTERNAL_API */
374
375 #endif /* UCONFIG_ENABLE_PLUGINS */
376
377 #endif /* _ICUPLUG */
378
UPLUG_LEVEL_UNKNOWN
The plugin is waiting to be installed.
Definition: icuplug.h:173
uplug_getLibrary
void * uplug_getLibrary(UPlugData *plug)
Return the library used for this plugin, if known.
UPlugEntrypoint
UPlugTokenReturn( UPlugEntrypoint)(UPlugData *plug, UPlugReason reason, UErrorCode *status)
Entrypoint for an ICU plugin.
Definition: icuplug.h:186
uplug_getSymbolName
const char * uplug_getSymbolName(UPlugData *plug)
Return the symbol name for this plugin, if known.
UPLUG_LEVEL_INVALID
The plugin is invalid, hasn't called uplug_setLevel, or can't load.
Definition: icuplug.h:172
uplug_nextPlug
UPlugData * uplug_nextPlug(UPlugData *prior)
Return all currently installed plugins, from newest to oldest Usage Example:
UPlugReason
UPlugReason
Reason code for the entrypoint's call.
Definition: icuplug.h:156
U_INTERNAL
#define U_INTERNAL
This is used to declare a function as an internal ICU C API.
Definition: umachine.h:117
uplug_setPlugName
void uplug_setPlugName(UPlugData *plug, const char *name)
Set the human-readable name of this plugin.
UPlugTokenReturn
uint32_t UPlugTokenReturn
Return value from a plugin entrypoint.
Definition: icuplug.h:150
uplug_getPlugLoadStatus
UErrorCode uplug_getPlugLoadStatus(UPlugData *plug)
Get plug load status.
UPLUG_LEVEL_HIGH
The plugin can run at any time.
Definition: icuplug.h:175
UPLUG_LEVEL_LOW
The plugin must be called before u_init completes.
Definition: icuplug.h:174
uplug_loadPlugFromLibrary
UPlugData * uplug_loadPlugFromLibrary(const char *libName, const char *sym, const char *config, UErrorCode *status)
Inject a plugin from a library, as if the information came from a config file.
uplug_getConfiguration
const char * uplug_getConfiguration(UPlugData *plug)
Get the configuration string, if available.
uplug_loadPlugFromEntrypoint
UPlugData * uplug_loadPlugFromEntrypoint(UPlugEntrypoint *entrypoint, const char *config, UErrorCode *status)
Inject a plugin as if it were loaded from a library.
uplug_setPlugLevel
void uplug_setPlugLevel(UPlugData *plug, UPlugLevel level)
Set the level of this plugin.
UPlugLevel
UPlugLevel
Level of plugin loading INITIAL: UNKNOWN QUERY: INVALID -> { LOW | HIGH } ERR -> INVALID.
Definition: icuplug.h:171
uplug_getContext
void * uplug_getContext(UPlugData *plug)
Return the plugin-specific context data.
uplug_getCurrentLevel
UPlugLevel uplug_getCurrentLevel(void)
Get the lowest level of plug which can currently load.
UPLUG_REASON_UNLOAD
The plugin is being unloaded.
Definition: icuplug.h:159
uplug_getPlugLevel
UPlugLevel uplug_getPlugLevel(UPlugData *plug)
Get the level of this plugin.
uplug_setPlugNoUnload
void uplug_setPlugNoUnload(UPlugData *plug, UBool dontUnload)
Request that this plugin not be unloaded at cleanup time.
UPLUG_LEVEL_COUNT
count of known reasons
Definition: icuplug.h:176
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
uplug_getPlugName
const char * uplug_getPlugName(UPlugData *plug)
Get the human-readable name of this plugin.
uplug_removePlug
void uplug_removePlug(UPlugData *plug, UErrorCode *status)
Remove a plugin.
UPLUG_REASON_LOAD
The plugin is being loaded.
Definition: icuplug.h:158
uplug_setContext
void uplug_setContext(UPlugData *plug, void *context)
Set the plugin-specific context data.
UPLUG_REASON_QUERY
The plugin is being queried for info.
Definition: icuplug.h:157
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
uplug_getLibraryName
const char * uplug_getLibraryName(UPlugData *plug, UErrorCode *status)
Return the library name for this plugin, if known.
UPLUG_REASON_COUNT
count of known reasons
Definition: icuplug.h:160
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:234