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 #ifndef GWENHYWFAR_XSD_H
00029 #define GWENHYWFAR_XSD_H
00030
00031 #include <gwenhywfar/gwenhywfarapi.h>
00032 #include <gwenhywfar/bufferedio.h>
00033 #include <gwenhywfar/stringlist.h>
00034 #include <gwenhywfar/types.h>
00035 #include <gwenhywfar/xml.h>
00036 #include <stdio.h>
00037
00038
00039 typedef struct GWEN_XSD_ENGINE GWEN_XSD_ENGINE;
00040
00041
00042 typedef const char* (*GWEN_XSD_GETCHARVALUE_FN)(GWEN_XSD_ENGINE *e,
00043 const char *path,
00044 int idx,
00045 const char *defVal);
00046 typedef int (*GWEN_XSD_GETINTVALUE_FN)(GWEN_XSD_ENGINE *e,
00047 const char *path,
00048 int idx,
00049 int defVal);
00050 typedef const void* (*GWEN_XSD_GETBINVALUE_FN)(GWEN_XSD_ENGINE *e,
00051 const char *path,
00052 int idx,
00053 const void *defVal,
00054 unsigned int defValSize,
00055 unsigned int *returnValueSize);
00056
00057 GWENHYWFAR_API
00058 GWEN_XSD_ENGINE *GWEN_XSD_new();
00059 GWENHYWFAR_API
00060 void GWEN_XSD_free(GWEN_XSD_ENGINE *e);
00061
00062
00063
00064
00065
00066 GWENHYWFAR_API
00067 const char* GWEN_XSD_GetCharValue(GWEN_XSD_ENGINE *e,
00068 const char *path,
00069 int idx,
00070 const char *defVal);
00071 GWENHYWFAR_API
00072 int GWEN_XSD_GetIntValue(GWEN_XSD_ENGINE *e,
00073 const char *path,
00074 int idx,
00075 int defVal);
00076 GWENHYWFAR_API
00077 const void *GWEN_XSD_GetBinValue(GWEN_XSD_ENGINE *e,
00078 const char *path,
00079 int idx,
00080 const void *defVal,
00081 unsigned int defValSize,
00082 unsigned int *returnValueSize);
00083
00084 GWENHYWFAR_API
00085 int GWEN_XSD_ImportSchema(GWEN_XSD_ENGINE *e,
00086 GWEN_XMLNODE *xmlNode,
00087 const char *fname);
00088
00089 GWENHYWFAR_API
00090 const char *GWEN_XSD_GetCurrentTargetNameSpace(const GWEN_XSD_ENGINE *e);
00091 GWENHYWFAR_API
00092 int GWEN_XSD_SetCurrentTargetNameSpace(GWEN_XSD_ENGINE *e, const char *s);
00093
00094 GWENHYWFAR_API
00095 int GWEN_XSD_SetNamespace(GWEN_XSD_ENGINE *e,
00096 const char *prefix,
00097 const char *name,
00098 const char *url,
00099 const char *localUrl);
00100
00101 GWENHYWFAR_API
00102 int GWEN_XSD_ImportStart(GWEN_XSD_ENGINE *e);
00103 GWENHYWFAR_API
00104 int GWEN_XSD_ImportEnd(GWEN_XSD_ENGINE *e);
00105
00106
00107 GWENHYWFAR_API
00108 int GWEN_XSD_ProfileToXml(GWEN_XSD_ENGINE *e,
00109 GWEN_XMLNODE *n);
00110
00111 GWENHYWFAR_API
00112 int GWEN_XSD_ProfileFromXml(GWEN_XSD_ENGINE *e,
00113 GWEN_XMLNODE *nRoot);
00114
00115 GWENHYWFAR_API
00116 int GWEN_XSD_GlobalizeNode(GWEN_XSD_ENGINE *e,
00117 GWEN_XMLNODE *node);
00118
00119
00120 #endif