flagcb.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* © 2016 and later: Unicode, Inc. and others.
  2. License & terms of use: http://www.unicode.org/copyright.html#License
  3. Copyright (c) 2000 IBM, Inc. and Others.
  4. FLAGCB.H - interface to 'flagging' callback which
  5. simply marks the fact that the callback was called.
  6. */
  7. #ifndef _FLAGCB
  8. #define _FLAGCB
  9. #include "unicode/utypes.h"
  10. #include "unicode/ucnv.h"
  11. /* The structure of a FromU Flag context.
  12. (conceivably there could be a ToU Flag Context) */
  13. typedef struct
  14. {
  15. UConverterFromUCallback subCallback;
  16. const void *subContext;
  17. UBool flag;
  18. } FromUFLAGContext;
  19. /**
  20. * open the context
  21. */
  22. U_CAPI FromUFLAGContext* U_EXPORT2 flagCB_fromU_openContext();
  23. /**
  24. * the actual callback
  25. */
  26. U_CAPI void U_EXPORT2 flagCB_fromU(
  27. const void *context,
  28. UConverterFromUnicodeArgs *fromUArgs,
  29. const UChar* codeUnits,
  30. int32_t length,
  31. UChar32 codePoint,
  32. UConverterCallbackReason reason,
  33. UErrorCode * err);
  34. typedef struct
  35. {
  36. UConverterFromUCallback subCallback;
  37. const void *subContext;
  38. uint32_t magic; /* 0xC0FFEE to identify that the object is OK */
  39. uint32_t serial; /* minted from nextSerial */
  40. } debugCBContext;
  41. U_CAPI void debugCB_fromU(const void *context,
  42. UConverterFromUnicodeArgs *fromUArgs,
  43. const UChar* codeUnits,
  44. int32_t length,
  45. UChar32 codePoint,
  46. UConverterCallbackReason reason,
  47. UErrorCode * err);
  48. U_CAPI debugCBContext *debugCB_openContext();
  49. #endif