亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mxml.html

?? minixml2.5最新的版本。 嵌入式xml 解析、查找、生成、遍歷 功能,全部實現是標準c,移植很容易。 最新的2.5
?? HTML
?? 第 1 頁 / 共 5 頁
字號:
    FILE *fp;    mxml_node_t *tree;    fp = fopen(&quot;filename.xml&quot;, &quot;w&quot;);    mxmlSaveFile(tree, fp, <B>whitespace_cb</B>);    fclose(fp);</PRE><!-- NEED 10 --><H2><A NAME="4_3">Custom Data Types</A></H2><P>Mini-XML supports custom data types via global load and save callbacks. Only a single set of callbacks can be active at any time, however your callbacks can store additional information in order to support multiple custom data types as needed. The <TT>MXML_CUSTOM</TT> node type identifies custom data nodes.</P><P>The load callback receives a pointer to the current data node and a string of opaque character data from the XML source with character entities converted to the corresponding UTF-8 characters. For example, if we wanted to support a custom date/time type whose value is encoded as &quot;yyyy-mm-ddThh:mm:ssZ&quot; (ISO format), the load callback would look like the following:</P><PRE>    typedef struct    {      unsigned      year,    /* Year */                    month,   /* Month */                    day,     /* Day */                    hour,    /* Hour */                    minute,  /* Minute */                    second;  /* Second */      time_t        unix;    /* UNIX time */    } iso_date_time_t;    int    load_custom(mxml_node_t *node,                const char *data)    {      iso_date_time_t *dt;      struct tm tmdata;     /*      * Allocate data structure...      */      dt = calloc(1, sizeof(iso_date_time_t));     /*      * Try reading 6 unsigned integers from the      * data string...      */      if (sscanf(data, &quot;%u-%u-%uT%u:%u:%uZ&quot;,                 &amp;(dt-&gt;year), &amp;(dt-&gt;month),                 &amp;(dt-&gt;day), &amp;(dt-&gt;hour),                 &amp;(dt-&gt;minute),                 &amp;(dt-&gt;second)) != 6)      {       /*        * Unable to read numbers, free the data        * structure and return an error...        */        free(dt);        return (-1);      }     /*      * Range check values...      */      if (dt-&gt;month &lt;1 || dt-&gt;month &gt; 12 ||          dt-&gt;day  &lt;1 || dt-&gt;day &gt; 31 ||          dt-&gt;hour  &lt;0 || dt-&gt;hour &gt; 23 ||          dt-&gt;minute  &lt;0 || dt-&gt;minute &gt; 59 ||          dt-&gt;second  &lt;0 || dt-&gt;second &gt; 59)      {       /*        * Date information is out of range...        */        free(dt);        return (-1);      }     /*      * Convert ISO time to UNIX time in      * seconds...      */      tmdata.tm_year = dt-&gt;year - 1900;      tmdata.tm_mon  = dt-&gt;month - 1;      tmdata.tm_day  = dt-&gt;day;      tmdata.tm_hour = dt-&gt;hour;      tmdata.tm_min  = dt-&gt;minute;      tmdata.tm_sec  = dt-&gt;second;      dt-&gt;unix = gmtime(&amp;tmdata);     /*      * Assign custom node data and destroy      * function pointers...      */      node-&gt;value.custom.data    = dt;      node-&gt;value.custom.destroy = free;     /*      * Return with no errors...      */      return (0);    }</PRE><P>The function itself can return 0 on success or -1 if it is unable to decode the custom data or the data contains an error. Custom data nodes contain a <TT>void</TT> pointer to the allocated custom data for the node and a pointer to a destructor function which will free the custom data when the node is deleted.</P><P>The save callback receives the node pointer and returns an allocated string containing the custom data value. The following save callback could be used for our ISO date/time type:</P><PRE>    char *    save_custom(mxml_node_t *node)    {      char data[255];      iso_date_time_t *dt;      dt = (iso_date_time_t *)node-&gt;custom.data;      snprintf(data, sizeof(data),               &quot;%04u-%02u-%02uT%02u:%02u:%02uZ&quot;,               dt-&gt;year, dt-&gt;month, dt-&gt;day,               dt-&gt;hour, dt-&gt;minute, dt-&gt;second);      return (strdup(data));    }</PRE><P>You register the callback functions using the <A href="#mxmlSetCustomHandlers"><TT>mxmlSetCustomHandlers()</TT></A> function:</P><PRE>    mxmlSetCustomHandlers(<B>load_custom</B>,                          <B>save_custom</B>);</PRE><!-- NEED 20 --><H2><A NAME="4_4">Changing Node Values</A></H2><P>All of the examples so far have concentrated on creating and loading new XML data nodes. Many applications, however, need to manipulate or change the nodes during their operation, so Mini-XML provides functions to change node values safely and without leaking memory.</P><P>Existing nodes can be changed using the <A href="#mxmlSetElement"><TT>mxmlSetElement()</TT></A>, <A href="#mxmlSetInteger"><TT>mxmlSetInteger()</TT></A>, <A href="#mxmlSetOpaque"><TT>mxmlSetOpaque()</TT></A>, <A href="#mxmlSetReal"><TT>mxmlSetReal()</TT></A>, <A href="#mxmlSetText"><TT>mxmlSetText()</TT></A>, and <A href="#mxmlSetTextf"><TT>mxmlSetTextf()</TT></A> functions. For example, use the following function call to change a text node to contain the text &quot;new&quot; with leading whitespace:</P><PRE>    mxml_node_t *node;    mxmlSetText(node, 1, &quot;new&quot;);</PRE><H2><A NAME="4_5">Formatted Text</A></H2><P>The <A href="#mxmlNewTextf"><TT>mxmlNewTextf()</TT></A> and <A href="#mxmlSetTextf"><TT>mxmlSetTextf()</TT></A> functions create and change text nodes, respectively, using <TT>printf</TT>-style format strings and arguments. For example, use the following function call to create a new text node containing a constructed filename:</P><PRE>    mxml_node_t *node;    node = mxmlNewTextf(node, 1, &quot;%s/%s&quot;,                        path, filename);</PRE><H2><A NAME="4_6">Indexing</A></H2><P>Mini-XML provides functions for managing indices of nodes. The current implementation provides the same functionality as <A href="#mxmlFindElement"><TT>mxmlFindElement()</TT></A>. The advantage of using an index is that searching and enumeration of elements is significantly faster. The only disadvantage is that each index is a static snapshot of the XML document, so indices are not well suited to XML data that is updated more often than it is searched. The overhead of creating an index is approximately equal to walking the XML document tree. Nodes in the index are sorted by element name and attribute value.</P><P>Indices are stored in <A href="#mxml_index_t"><TT>mxml_index_t</TT></A> structures. The <A href="#mxmlIndexNew"><TT>mxmlIndexNew()</TT></A> function creates a new index:</P><PRE>    mxml_node_t *tree;    mxml_index_t *ind;    ind = mxmlIndexNew(tree, &quot;element&quot;,                       &quot;attribute&quot;);</PRE><P>The first argument is the XML node tree to index. Normally this will be a pointer to the <TT>?xml</TT> element.</P><P>The second argument contains the element to index; passing <TT>NULL</TT> indexes all element nodes alphabetically.</P><P>The third argument contains the attribute to index; passing <TT>NULL</TT> causes only the element name to be indexed.</P><P>Once the index is created, the <A href="#mxmlIndexEnum"><TT>mxmlIndexEnum()</TT></A>, <A href="#mxmlIndexFind"><TT>mxmlIndexFind()</TT></A>, and <A href="#mxmlIndexReset"><TT>mxmlIndexReset()</TT></A> functions are used to access the nodes in the index. The <A href="#mxmlIndexReset"><TT>mxmlIndexReset()</TT></A> function resets the &quot;current&quot; node pointer in the index, allowing you to do new searches and enumerations on the same index. Typically you will call this function prior to your calls to <A href="#mxmlIndexEnum"><TT>mxmlIndexEnum()</TT></A> and <A href="#mxmlIndexFind"><TT>mxmlIndexFind()</TT></A>.</P><P>The <A href="#mxmlIndexEnum"><TT>mxmlIndexEnum()</TT></A> function enumerates each of the nodes in the index and can be used in a loop as follows:</P><PRE>    mxml_node_t *node;    mxmlIndexReset(ind);    while ((node = mxmlIndexEnum(ind)) != NULL)    {      // do something with node    }</PRE><P>The <A href="#mxmlIndexFind"><TT>mxmlIndexFind()</TT></A> function locates the next occurrence of the named element and attribute value in the index. It can be used to find all matching elements in an index, as follows:</P><PRE>    mxml_node_t *node;    mxmlIndexReset(ind);    while ((node = mxmlIndexFind(ind, &quot;element&quot;,                                 &quot;attr-value&quot;))                != NULL)    {      // do something with node    }</PRE><P>The second and third arguments represent the element name and attribute value, respectively. A <TT>NULL</TT> pointer is used to return all elements or attributes in the index. Passing <TT>NULL</TT> for both the element name and attribute value is equivalent to calling <TT>mxmlIndexEnum</TT>.</P><P>When you are done using the index, delete it using the <A href="#mxmlIndexDelete()"><TT>mxmlIndexDelete()</TT></A> function:</P><PRE>    mxmlIndexDelete(ind);</PRE><H2><A NAME="4_7">SAX (Stream) Loading of Documents</A></H2><P>Mini-XML supports an implementation of the Simple API for XML (SAX) which allows you to load and process an XML document as a stream of nodes. Aside from allowing you to process XML documents of any size, the Mini-XML implementation also allows you to retain portions of the document in memory for later processing.</P><P>The <A href="#mxmlSAXLoad"><TT>mxmlSAXLoadFd</TT></A>, <A href="#mxmlSAXLoadFile"><TT>mxmlSAXLoadFile</TT></A>, and <A href="#mxmlSAXLoadString"><TT>mxmlSAXLoadString</TT></A> functions provide the SAX loading APIs. Each function works like the corresponding <TT>mxmlLoad</TT> function but uses a callback to process each node as it is read.</P><P>The callback function receives the node, an event code, and a user data pointer you supply:</P><PRE>    void    sax_cb(mxml_node_t *node,           mxml_sax_event_t event,           void *data)    {      ... do something ...    }</PRE><P>The event will be one of the following:</P><UL><LI><TT>MXML_SAX_CDATA</TT> - CDATA was just read</LI><LI><TT>MXML_SAX_COMMENT</TT> - A comment was just read</LI><LI><TT>MXML_SAX_DATA</TT> - Data (custom, integer, opaque, real, or text) was just read</LI><LI><TT>MXML_SAX_DIRECTIVE</TT> - A processing directive was just read</LI><LI><TT>MXML_SAX_ELEMENT_CLOSE</TT> - An open element was just read (<TT>&lt;element&gt;</TT>)</LI><LI><TT>MXML_SAX_ELEMENT_OPEN</TT> - A close element was just read (<TT>&lt;/element&gt;</TT>)</LI></UL><P>Elements are<EM> released</EM> after the close element is processed. All other nodes are released after they are processed. The SAX callback can<EM> retain</EM> the node using the <A href="#mxmlRetain"><TT>mxmlRetain</TT></A> function. For example, the following SAX callback will retain all nodes, effectively simulating a normal in-memory load:</P><PRE>    void    sax_cb(mxml_node_t *node,           mxml_sax_event_t event,           void *data)    {      if (event != MXML_SAX_ELEMENT_CLOSE)        mxmlRetain(node);    }</PRE><P>More typically the SAX callback will only retain a small portion of the document that is needed for post-processing. For example, the following SAX callback will retain the title and headings in an XHTML file. It also retains the (parent) elements like <TT>&lt;html&gt;</TT>, <TT>&lt;head&gt;</TT>, and <TT>&lt;body&gt;</TT>, and processing directives like <TT>&lt;?xml ... ?&gt;</TT> and <TT>&lt;!DOCTYPE ... &gt;</TT>:</P><!-- NEED 10 --><PRE>    void    sax_cb(mxml_node_t *node,           mxml_sax_event_t event,           void *data)    {      if (event == MXML_SAX_ELEMENT_OPEN)      {       /*        * Retain headings and titles...        */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久桃色tv| 亚洲欧洲精品一区二区三区 | 一区二区三区精品视频| 欧美精品丝袜中出| 不卡的av中国片| 免费在线看成人av| 亚洲精品高清在线| 国产婷婷精品av在线| 日韩女优av电影| 欧美视频一区二区在线观看| av电影天堂一区二区在线观看| 久久精品国产999大香线蕉| 亚洲自拍偷拍网站| 中文字幕在线不卡视频| 久久久无码精品亚洲日韩按摩| 777亚洲妇女| 欧美丝袜自拍制服另类| 91网站在线播放| 国产精品99久久久久久久vr| 久久99国产精品久久99果冻传媒| 亚洲福利国产精品| 一区二区三区日韩精品视频| 中文字幕人成不卡一区| 欧美国产激情二区三区| 国产视频视频一区| 久久婷婷综合激情| 2023国产精品视频| 久久一区二区三区四区| 2024国产精品视频| 久久综合网色—综合色88| 欧美r级在线观看| 欧美不卡一区二区三区| 欧美白人最猛性xxxxx69交| 51久久夜色精品国产麻豆| 欧美人动与zoxxxx乱| 51精品秘密在线观看| 6080午夜不卡| 日韩精品一区二区在线观看| 日韩精品一区二区三区视频在线观看| 欧美一级生活片| 日韩精品一区二区三区视频播放| 日韩精品一区二区三区swag | 一色屋精品亚洲香蕉网站| 亚洲国产精华液网站w| 国产精品久线观看视频| 最近中文字幕一区二区三区| 亚洲精品乱码久久久久久久久| 亚洲精品国产视频| 亚洲成人在线观看视频| 日韩国产精品久久久| 久久精品国产精品亚洲综合| 国产一二三精品| 国产精品88av| 99国产精品久久久久久久久久 | 91精品国产91久久久久久一区二区| 91麻豆精品国产综合久久久久久| 日韩女同互慰一区二区| 日本一区二区成人| 亚洲免费观看在线视频| 日韩精品每日更新| 国产原创一区二区三区| 成人国产精品免费网站| 91久久精品一区二区二区| 欧美高清www午色夜在线视频| 欧美一级日韩不卡播放免费| 国产欧美日韩另类视频免费观看| 亚洲三级在线免费| 偷拍自拍另类欧美| 久久99精品国产91久久来源| 波多野结衣视频一区| 欧美体内she精高潮| 亚洲精品一线二线三线无人区| 国产精品毛片大码女人| 日韩精品一二三| 国产在线播放一区二区三区| 色狠狠色狠狠综合| 26uuu色噜噜精品一区二区| 一区二区三区中文在线观看| 看片的网站亚洲| 91亚洲精品一区二区乱码| 日韩一区二区在线播放| 亚洲色图欧洲色图婷婷| 久草在线在线精品观看| 在线视频你懂得一区二区三区| 欧美电影免费提供在线观看| 亚洲激情图片一区| 国产99一区视频免费| 欧美日韩国产在线播放网站| 国产亚洲精品精华液| 午夜婷婷国产麻豆精品| 成人自拍视频在线观看| 日韩一区二区在线观看视频播放| 亚洲色欲色欲www在线观看| 狠狠色狠狠色综合| 欧美日韩大陆一区二区| 国产精品三级在线观看| 美女视频黄频大全不卡视频在线播放| 99综合影院在线| 精品国产91乱码一区二区三区 | 亚洲成精国产精品女| 成人黄色在线看| 精品久久久久久久久久久久久久久 | 蜜桃视频免费观看一区| 日本道精品一区二区三区| 欧美国产视频在线| 极品尤物av久久免费看| 91麻豆精品国产综合久久久久久| 亚洲久本草在线中文字幕| 国产成人在线观看免费网站| 日韩一区二区免费在线观看| 亚洲午夜在线电影| av不卡在线观看| 国产偷国产偷亚洲高清人白洁 | 国产精品国产三级国产aⅴ原创| 麻豆成人av在线| 欧美视频一区在线| 亚洲精品少妇30p| 一本一道久久a久久精品综合蜜臀| 国产喂奶挤奶一区二区三区| 国产精品自在欧美一区| 精品国产污网站| 麻豆精品一区二区综合av| 精品视频999| 亚洲一二三区不卡| 欧美视频精品在线| 一区二区三区在线观看国产 | 欧美肥大bbwbbw高潮| 亚洲综合免费观看高清在线观看| 97久久超碰国产精品| 国产精品美女视频| 99国产欧美久久久精品| 亚洲天堂成人在线观看| 色哟哟国产精品免费观看| 亚洲欧洲成人自拍| 91免费观看视频在线| 亚洲日本一区二区| 91成人免费电影| 亚洲图片有声小说| 欧美三级电影一区| 日本伊人色综合网| 26uuu色噜噜精品一区二区| 激情另类小说区图片区视频区| 精品国产乱码久久久久久浪潮| 久久99国产精品免费网站| 久久久久久97三级| www.久久精品| 亚洲综合视频在线| 日韩欧美一二区| 国产揄拍国内精品对白| 中文字幕精品在线不卡| 91免费在线播放| 亚洲国产一二三| 欧美一区二区三区免费| 国产伦精品一区二区三区免费迷| 中文字幕不卡的av| 色悠久久久久综合欧美99| 日韩电影在线观看电影| 国产亚洲1区2区3区| 色先锋aa成人| 蜜桃av噜噜一区二区三区小说| 久久久久久黄色| 91小视频在线观看| 日韩av一区二区在线影视| 久久美女艺术照精彩视频福利播放| 成人晚上爱看视频| 亚洲成人动漫精品| 久久久精品中文字幕麻豆发布| 91麻豆高清视频| 久久99久国产精品黄毛片色诱| 中文字幕日韩一区二区| 69av一区二区三区| 波多野结衣在线aⅴ中文字幕不卡| 亚洲午夜精品久久久久久久久| 欧美mv日韩mv国产| 91久久香蕉国产日韩欧美9色| 久久国产福利国产秒拍| 亚洲精品免费在线观看| 久久先锋影音av| 在线亚洲一区观看| 国产成人在线观看| 日韩激情视频在线观看| 中文字幕一区二区三区在线播放| 正在播放亚洲一区| av动漫一区二区| 久久99精品一区二区三区| 亚洲综合视频网| 中文字幕免费在线观看视频一区| 欧美一区二区三区四区在线观看| 99久久综合99久久综合网站| 美女视频一区二区| 亚洲午夜成aⅴ人片| 国产精品天干天干在观线| 日韩三级在线观看| 欧美怡红院视频| www.欧美亚洲| 国产成人综合在线观看| 日本免费在线视频不卡一不卡二| 亚洲精品水蜜桃| 中日韩av电影| 久久婷婷一区二区三区|