U_CAPI
UPlugTokenReturn U_EXPORT2 myPlugin (
UPlugData *data,
UPlugReason reason,
UErrorCode *status) { /* Just print this for debugging */
fprintf(stderr,"MyPlugin: data=%p, reason=%s, status=%s\n", (void*)data, udbg_enumName(UDBG_UPlugReason,(int32_t)reason), u_errorName(*status));
if(reason==UPLUG_REASON_QUERY) {
uplug_setPlugName(data, "Just a Test High-Level Plugin"); /* This call is optional in response to UPLUG_REASON_QUERY, but is a good idea. */
uplug_setPlugLevel(data, UPLUG_LEVEL_HIGH); /* This call is Mandatory in response to UPLUG_REASON_QUERY */
}
return UPLUG_TOKEN; /* This must always be returned, to indicate that the entrypoint was actually a plugin. */
}
uplug_setContext(data, ctx);
fprintf(stderr,"I'm %p and I did a bad thing and malloced %p\n", (void*)data, (void*)ctx);
} elseif(reason == UPLUG_REASON_UNLOAD) { void * ctx = uplug_getContext(data);
if(reason==UPLUG_REASON_QUERY) {
uplug_setPlugLevel(data, UPLUG_LEVEL_LOW);
uplug_setPlugName(data, "Memory Plugin");
} elseif(reason==UPLUG_REASON_LOAD) {
u_setMemoryFunctions(uplug_getContext(data), &myMemAlloc, &myMemRealloc, &myMemFree, status);
fprintf(stderr, "MEM: status now %s\n", u_errorName(*status));
} elseif(reason==UPLUG_REASON_UNLOAD) {
fprintf(stderr, "MEM: not possible to unload this plugin (no way to reset memory functions)...\n");
uplug_setPlugNoUnload(data, true);
}
return UPLUG_TOKEN;
}
#endif
Messung V0.5
¤ Dauer der Verarbeitung: 0.26 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.