00001
00002
00003
00004
00005
00006
00007 #ifndef XAP_H
00008 #define XAP_H
00009
00010 #ifndef DYSTRING_H
00011 #include "dystring.h"
00012 #endif
00013
00014 struct xapStack
00015
00016 {
00017 void *object;
00018 char *elName;
00019 struct dyString *text;
00020 };
00021
00022 struct xap
00023
00024 {
00025 struct xapStack *stack;
00026 struct xapStack stackBuf[128];
00027 struct xapStack *endStack;
00028 int stackDepth;
00029 int skipDepth;
00030 void *(*startHandler)(struct xap *xap, char *name, char **atts);
00031 void (*endHandler)(struct xap *xap, char *name);
00032 struct xp *xp;
00033 char *fileName;
00034 char *topType;
00035 void *topObject;
00036 FILE *f;
00037 };
00038
00039 struct xap *xapNew(void *(*startHandler)(struct xap *xap, char *name, char **atts),
00040 void (*endHandler)(struct xap *xap, char *name) ,
00041 char *fileName);
00042
00043
00044 void xapFree(struct xap **pXp);
00045
00046
00047 void xapParseFile(struct xap *xap, char *fileName);
00048
00049
00050 void xapError(struct xap *xap, char *format, ...);
00051
00052
00053 void xapIndent(int count, FILE *f);
00054
00055
00056 void xapSkip(struct xap *xap);
00057
00058
00059 void xapParseAny(char *fileName, char *type,
00060 void *(*startHandler)(struct xap *xap, char *name, char **atts),
00061 void (*endHandler)(struct xap *xap, char *name),
00062 char **retType, void *retObj);
00063
00064
00065
00066
00067
00068 struct xap *xapOpen(char *fileName,
00069 void *(*startHandler)(struct xap *xap, char *name, char **atts),
00070 void (*endHandler)(struct xap *xap, char *name));
00071
00072
00073
00074
00075 void *xapNext(struct xap *xap, char *tag);
00076
00077 #endif
00078