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