00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00030
00031
00068 #ifndef _ASN1XER_H_
00069 #define _ASN1XER_H_
00070
00071 #include "rtsrc/asn1type.h"
00072 #include "rtxsrc/rtxMemBuf.h"
00073
00084 typedef enum {
00085 XERINIT,
00086 XERSTART,
00087 XERDATA,
00088 XEREND,
00089
00090 XERSTART0,
00091 XEREND0
00092 } ASN1XERState;
00093
00094 #define XERINDENT 3
00095
00096 typedef struct {
00097 const char* name;
00098 OSBOOL optional;
00099 } XerElemInfo;
00100
00101 typedef struct XmlNamedBitsDict {
00102 const char* name;
00103 OSUINT32 bitnum;
00104 } XmlNamedBitsDict;
00105
00106
00107 #define XERBYTECNT(pctxt) (pctxt)->buffer.byteIndex
00108
00109 #include "rtxersrc/rtSAXDefs.h"
00110
00111 #ifdef __cplusplus
00112 extern "C" {
00113 #endif
00114
00115 #ifdef BUILDASN1XERDLL
00116 #define EXTERNXER __declspec(dllexport)
00117 #elif defined (USEASN1XERDLL)
00118 #define EXTERNXER __declspec(dllimport)
00119 #else
00120 #define EXTERNXER
00121 #endif
00122
00123
00151 EXTERNXER int xerDecBMPStr (OSCTXT* pctxt,
00152 ASN1BMPString* outdata);
00153
00177 EXTERNXER int xerDecBase64Str (OSCTXT* pctxt,
00178 OSOCTET* pvalue, OSUINT32* pnocts,
00179 OSINT32 bufsize);
00180
00205 EXTERNXER int xerDecBigInt (OSCTXT* pctxt, char **ppvalue, int radix);
00206
00207
00231 EXTERNXER int xerDecBitStr (OSCTXT* pctxt, OSOCTET* pvalue,
00232 OSUINT32* pnbits, OSINT32 bufsize);
00233
00251 EXTERNXER int xerDecBitStrMemBuf (OSRTMEMBUF* pMemBuf,
00252 const XMLCHAR* inpdata,
00253 int length, OSBOOL skipWhitespaces);
00254
00265 EXTERNXER int xerDecBool (OSCTXT* pctxt, OSBOOL *pvalue);
00266
00285 EXTERNXER int xerDecCopyBitStr (OSCTXT* pctxt,
00286 OSOCTET* pvalue, OSUINT32* pnbits,
00287 OSINT32 bufsize, int lastBitOffset);
00288
00304 EXTERNXER int xerDecCopyDynBitStr (OSCTXT* pctxt,
00305 ASN1DynBitStr* pvalue,
00306 int lastBitOffset);
00307
00323 EXTERNXER int xerDecCopyDynOctStr (OSCTXT* pctxt, ASN1DynOctStr* pvalue,
00324 int lastBitOffset);
00325
00348 EXTERNXER int xerDecCopyOctStr (OSCTXT* pctxt,
00349 OSOCTET* pvalue, OSUINT32* pnocts,
00350 OSINT32 bufsize, int lastBitOffset);
00351
00370 EXTERNXER int xerDecDynAscCharStr (OSCTXT* pctxt,
00371 const char** outdata);
00372
00373
00390 EXTERNXER int xerDecDynBase64Str (OSCTXT* pctxt, ASN1DynOctStr* pvalue);
00391
00407 EXTERNXER int xerDecDynBitStr (OSCTXT* pctxt, ASN1DynBitStr* pvalue);
00408
00424 EXTERNXER int xerDecDynOctStr (OSCTXT* pctxt, ASN1DynOctStr* pvalue);
00425
00445 EXTERNXER int xerDecDynUTF8Str (OSCTXT* pctxt,
00446 ASN1UTF8String* outdata);
00447
00458 EXTERNXER int xerDecInt (OSCTXT* pctxt, OSINT32* pvalue);
00459
00470 EXTERNXER int xerDecInt8 (OSCTXT* pctxt, OSINT8* pvalue);
00471
00482 EXTERNXER int xerDecInt16 (OSCTXT* pctxt, OSINT16* pvalue);
00483
00496 EXTERNXER int xerDecInt64 (OSCTXT* pctxt, OSINT64* pvalue);
00497
00510 EXTERNXER int xerDecObjId (OSCTXT* pctxt, ASN1OBJID *pvalue);
00511
00525 EXTERNXER int xerDecObjId64 (OSCTXT* pctxt, ASN1OID64 *pvalue);
00526
00550 EXTERNXER int xerDecOctStr (OSCTXT* pctxt, OSOCTET* pvalue,
00551 OSUINT32* pnocts, OSINT32 bufsize);
00552
00570 EXTERNXER int xerDecOctStrMemBuf (OSRTMEMBUF* pMemBuf,
00571 const XMLCHAR* inpdata,
00572 int length, OSBOOL skipWhitespaces);
00573
00592 EXTERNXER int xerDecOpenType (OSCTXT* pctxt, ASN1OpenType* pvalue);
00593
00610 EXTERNXER int xerDecReal (OSCTXT* pctxt, OSREAL* pvalue);
00611
00629 EXTERNXER int xerDecReal10 (OSCTXT* pctxt, const OSUTF8CHAR** pvalue);
00630
00643 EXTERNXER int xerDecRelativeOID (OSCTXT* pctxt, ASN1OBJID *pvalue);
00644
00656 EXTERNXER int xerDecUInt (OSCTXT* pctxt, OSUINT32* pvalue);
00657
00669 EXTERNXER int xerDecUInt8 (OSCTXT* pctxt, OSUINT8* pvalue);
00670
00682 EXTERNXER int xerDecUInt16 (OSCTXT* pctxt, OSUINT16* pvalue);
00683
00698 EXTERNXER int xerDecUInt64 (OSCTXT* pctxt, OSUINT64* pvalue);
00699
00713 EXTERNXER int xerDecUnivStr (OSCTXT* pctxt,
00714 ASN1UniversalString* outdata);
00715
00733 EXTERNXER int xerSetDecBufPtr (OSCTXT* pCtxt, const OSOCTET* bufaddr,
00734 size_t bufsiz);
00735
00738
00784 EXTERNXER int xerSetEncBufPtr (OSCTXT* pCtxt, OSOCTET* bufaddr,
00785 size_t bufsiz, OSBOOL canonical);
00786
00806 EXTERNXER int xerEncAscCharStr (OSCTXT* pctxt,
00807 const char* value,
00808 const char* elemName);
00809
00810
00832 EXTERNXER int xerEncBase64Str (OSCTXT* pctxt, OSUINT32 nocts,
00833 const OSOCTET* data,
00834 const char* elemName);
00835
00860 EXTERNXER int xerEncBigInt (OSCTXT* pctxt, const char* value,
00861 const char* elemName);
00862
00887 EXTERNXER int xerEncBitStr (OSCTXT* pctxt, OSUINT32 nbits,
00888 const OSOCTET* data,
00889 const char* elemName,
00890 ASN1StrType outputType);
00891
00892 EXTERNXER int xerEncBoolValue (OSCTXT* pctxt, OSBOOL value);
00893
00894
00914 EXTERNXER int xerEncBool (OSCTXT* pctxt, OSBOOL value,
00915 const char* elemName);
00916
00928 EXTERNXER int xerEncEndDocument (OSCTXT* pctxt);
00929
00942 EXTERNXER int xerEncEndElement (OSCTXT* pctxt, const char* elemName);
00943
00950 EXTERNXER int xerEncIndent (OSCTXT* pctxt);
00951
00971 EXTERNXER int xerEncInt (OSCTXT* pctxt, OSINT32 value,
00972 const char* elemName);
00973
00995 EXTERNXER int xerEncInt64 (OSCTXT* pctxt, OSINT64 value,
00996 const char* elemName);
00997
00998
01010 EXTERNXER int xerEncNewLine (OSCTXT* pctxt);
01011
01032 EXTERNXER int xerEncObjId (OSCTXT* pctxt, const ASN1OBJID *pvalue,
01033 const char* elemName);
01034
01056 EXTERNXER int xerEncObjId64 (OSCTXT* pctxt, const ASN1OID64 *pvalue,
01057 const char* elemName);
01058
01079 EXTERNXER int xerEncRelativeOID (OSCTXT* pctxt, const ASN1OBJID *pvalue,
01080 const char* elemName);
01081
01102 EXTERNXER int xerEncOctStr (OSCTXT* pctxt, OSUINT32 nocts,
01103 const OSOCTET* data,
01104 const char* elemName);
01105
01125 EXTERNXER int xerEncReal (OSCTXT* pctxt, OSREAL value,
01126 const char* elemName);
01127
01144 EXTERNXER int xerEncReal10 (OSCTXT* pctxt, const OSUTF8CHAR* value,
01145 const char* elemName);
01146
01161 EXTERNXER int xerEncStartDocument (OSCTXT* pctxt);
01162
01178 EXTERNXER int xerEncStartElement (OSCTXT* pctxt,
01179 const char* elemName,
01180 const char* attributes);
01181
01195 EXTERNXER int xerEncEmptyElement (OSCTXT* pctxt,
01196 const char* elemName,
01197 const char* attributes);
01213 EXTERNXER int xerEncNamedValue (OSCTXT* pctxt,
01214 const char* value,
01215 const char* elemName,
01216 const char* attributes);
01217
01238 EXTERNXER int xerEncUInt (OSCTXT* pctxt, OSUINT32 value,
01239 const char* elemName);
01240
01263 EXTERNXER int xerEncUInt64 (OSCTXT* pctxt, OSUINT64 value,
01264 const char* elemName);
01265
01284 EXTERNXER int xerEncBMPStr (OSCTXT* pctxt,
01285 const ASN1BMPString* value,
01286 const char* elemName);
01287
01308 EXTERNXER int xerEncUnivStr (OSCTXT* pctxt,
01309 const ASN1UniversalString* value,
01310 const char* elemName);
01311
01329 EXTERNXER int xerEncUniCharData (OSCTXT* pctxt,
01330 const OSUNICHAR* value,
01331 OSUINT32 nchars);
01332
01353 EXTERNXER int xerEncUniCharStr (OSCTXT* pctxt,
01354 OSUNICHAR* value,
01355 const char* elemName);
01356
01381 EXTERNXER int xerEncOpenType (OSCTXT* pctxt, OSSIZE nocts,
01382 const OSOCTET* data,
01383 const char* elemName);
01384
01401 EXTERNXER int xerEncNull (OSCTXT* pctxt, const char* elemName);
01402
01403
01404 EXTERNXER int xerEncXmlCharData (OSCTXT* pctxt,
01405 const XMLCHAR* pvalue,
01406 int length);
01409
01428 EXTERNXER OSBOOL xerCmpText (const XMLCHAR* text1, const char* text2);
01429
01430
01431 EXTERNXER int xerCopyText (OSCTXT* pctxt, const char* text);
01432
01439 EXTERNXER int xerTextLength (const XMLCHAR* text);
01440
01454 EXTERNXER const char* xerTextToCStr (OSCTXT* pctxt,
01455 const XMLCHAR* text);
01456
01463 EXTERNXER size_t xerGetMsgLen (OSCTXT* pctxt);
01464
01480 EXTERNXER OSOCTET* xerGetMsgPtr (OSCTXT* pctxt);
01481
01482 EXTERNXER int xerGetElemIdx (const XMLCHAR* elemName,
01483 XerElemInfo* pElemInfo, int numElems);
01484
01485 EXTERNXER int xerGetSeqElemIdx (const XMLCHAR* elemName,
01486 XerElemInfo* pElemInfo,
01487 int numElems, int startIndex);
01488
01489 EXTERNXER int xerFinalizeMemBuf (OSRTMEMBUF* pMemBuf);
01490
01500 EXTERNXER int xerGetLibVersion (OSVOIDARG);
01501
01509 EXTERNXER const char* xerGetLibInfo (OSVOIDARG);
01510
01514
01515
01550 EXTERNXER int xmlDecBitStr (OSCTXT* pctxt, OSOCTET* pvalue,
01551 OSUINT32* pnbits, OSINT32 bufsize);
01552
01563 EXTERNXER int xmlDecBool (OSCTXT* pctxt, OSBOOL *pvalue);
01564
01580 EXTERNXER int xmlDecDynBitStr (OSCTXT* pctxt, ASN1DynBitStr* pvalue);
01581
01601 EXTERNXER int xmlDecDynNamedBitStr
01602 (OSCTXT* pctxt, ASN1DynBitStr* pvalue,
01603 const XmlNamedBitsDict* pBitDict);
01604
01620 EXTERNXER int xmlDecDynOctStr (OSCTXT* pctxt, ASN1DynOctStr* pvalue);
01621
01640 EXTERNXER int xmlDecGeneralizedTime (OSCTXT* pctxt,
01641 const char** outdata);
01642
01671 EXTERNXER int xmlDecNamedBitStr
01672 (OSRTMEMBUF *pMemBuf, OSOCTET* pData, int dataSize, OSUINT32* pNumbits,
01673 const XmlNamedBitsDict* pBitDict,
01674 const XMLCHAR* chars, int length);
01675
01699 EXTERNXER int xmlDecOctStr (OSCTXT* pctxt, OSOCTET* pvalue,
01700 OSUINT32* pnocts, OSINT32 bufsize);
01701
01718 EXTERNXER int xmlDecReal (OSCTXT* pctxt, OSREAL* pvalue);
01719
01738 EXTERNXER int xmlDecUTCTime (OSCTXT* pctxt,
01739 const char** outdata);
01740
01744
01784 EXTERNXER int xmlEncBitStr (OSCTXT* pctxt,
01785 XmlNamedBitsDict *namedbits,
01786 OSUINT32 noofnamedbits,
01787 OSUINT32 nbits,
01788 const OSOCTET* data,
01789 const char* elemName,
01790 ASN1StrType outputType);
01791
01792 EXTERNXER int xmlEncBoolValue (OSCTXT* pctxt, OSBOOL value);
01793
01813 EXTERNXER int xmlEncBool (OSCTXT* pctxt, OSBOOL value,
01814 const char* elemName);
01815
01829 EXTERNXER int xmlEncEnum (OSCTXT* pctxt, const char* value);
01830
01850 EXTERNXER int xmlEncGeneralizedTime(OSCTXT *pctxt,
01851 const char* value,
01852 const char* elemName);
01853
01869 EXTERNXER int xmlEncNamedValue (OSCTXT* pctxt,
01870 const char* value,
01871 const char* elemName,
01872 const char* attributes);
01873
01874 EXTERNXER int xerEncOpenTypeExt (OSCTXT* pctxt, OSRTDList* pElemList);
01893 EXTERNXER int xmlEncReal (OSCTXT* pctxt, OSREAL value,
01894 const char* elemName);
01895
01914 EXTERNXER int xmlEncUTCTime(OSCTXT *pctxt,
01915 const char* value,
01916 const char* elemName);
01917
01920 #ifdef __cplusplus
01921 }
01922 #endif
01923
01926 #endif