Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1058772
  • 博文数量: 573
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 66
  • 用 户 组: 普通用户
  • 注册时间: 2016-06-28 16:21
文章分类

全部博文(573)

文章存档

2018年(3)

2016年(48)

2015年(522)

分类: C/C++

2015-12-02 20:00:14

编译命令

点击(此处)折叠或打开

  1. cc -I /home/eas/src/libxml/libxml2-2.6.30/include/ -I /home/eas/src/libiconv/libiconv-1.13.1/include/ -L/home/eas/src/libxml/libxml2-2.6.30/.libs -L/home/eas/src/libiconv/libiconv-1.13.1/lib/.libs/ -lxml2 -liconv -lz -lpthread -lm -o parseMemory parseMemory.c


点击(此处)折叠或打开

  1. #include    <stdio.h>
  2. #include    <stdlib.h>
  3. #include    <string.h>
  4. #include    <math.h>
  5. #include    <ctype.h>
  6. #include    <sys/stat.h>
  7. #include    <unistd.h>
  8. #include    <stdbool.h>
  9. #include    <sys/timeb.h>
  10. #include    <time.h>

  11. #include    <libxml/parser.h>                /* LIBXML2 Header File */
  12. #include    <libxml/tree.h>                    /* LIBXML2 Header File */
  13. #include     <libxml/xmlmemory.h>            /* LIBXML2 Header File */
  14. #include    <libxml/xpath.h>                /* LIBXML2 Header File */
  15. #include    <iconv.h>                        /* LIBXML2 Header File */

  16. #define FMLFLD_NOTARRAY 0 /* 非数组(用于下标参数) */
  17. #define FMLFLD_OPTIONAL 0 /* 可选域 */
  18. #define FMLFLD_REQUIRED 1 /* 必需域 */
  19. #define    SYM_FML_FS    0x40    /* 域分隔符0x1E*/
  20. #define    SYM_FML_NV    ':'     /* 名值分隔符*/
  21. #define    SYM_FML_AN    '#'     /* 数组下标起始符*/
  22. #define RC_SUCC 0
  23. #define RC_NFND -1
  24. #define RC_NSPC -2

  25. #define SZ_DATA_BUS (32*1024)            /* 数据总线宽度 */
  26. typedef char T_DATABUS[SZ_DATA_BUS];    /* 数据总线 */

  27. void FmlDataClear(char *    cFmlData);
  28. char *FmlFieldSeek(const char *cFmlData, const char *cFieldName,int    iIndex);
  29. int    FmlFieldPut(char *cFmlData,int iBufSize,char *cFieldName,int iIndex,char *cFieldValue);
  30. int FmlFieldGet(const char *cFmlData,const char *cFieldName,int    iIndex,    char *cFieldValue,int iValueSize);
  31. int    FmlFieldNum(const char *cFmlData, const char *cFieldName, int *iNum);

  32. int CodeConvert(char* from_charset, char* to_charset, char* inbuf,size_t inlen, char* outbuf, size_t outlen);
  33. char* u2g(char *inbuf);
  34. char* g2u(char *inbuf);
  35. char * StrTrim(char * pstr);
  36. int JugeFileExist(char *lFileName);
  37. int    GetDateTime(char * cDate, char * cTime);

  38. int GetXmlThirdNodeNum(T_DATABUS tDataBus, char* pFilename, int iQueryNum, int * iRowNum, char* secNodeName);
  39. int GetXmlSecNodeNum(T_DATABUS tDataBus, char* pFilename, int * iQueryNum, char* secNodeName);
  40. int XmlParseFile(T_DATABUS tDataBus, char* pFilename, int iQueryNum, int iRowNum, char* secNodeName);


  41. int main(int argc, char **argv)
  42. {
  43.     bool bflag = true;
  44.     int i=0;
  45.     char *nodeName = NULL;
  46.     char *nodeValue = NULL;
  47.     char *eleName;
  48.     char *eleValue;
  49.     xmlChar* szAttr;
  50.     xmlAttrPtr attrPtr;

  51.     /* 定义解析文档指针 */
  52.     xmlDocPtr doc;
  53.     /* 定义结点指针 */
  54.     xmlNodePtr curNode;
  55.     
  56.     T_DATABUS tDataBus;
  57.     FmlDataClear(tDataBus);
  58.     
  59.     printf("***************************************************\n");
  60.     
  61.     char    buffer[10240];
  62.     memset(buffer, 0, sizeof(buffer));
  63.     strcpy(buffer, "
    阅读(766) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~