xmlnode.c.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?xml version='1.0' encoding='iso-8859-1'?>
  2. <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  3. <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
  4. <head>
  5. <title>
  6. xmlnode.c
  7. </title>
  8. <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
  9. <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
  10. <meta name='author' content='cmaier@cmassoc.net'/>
  11. <meta name='robots' content='noindex,nofollow'/>
  12. <link href='toolkit.css' rel='stylesheet' type='text/css'/>
  13. </head>
  14. <body>
  15. <div class='headerlink'>
  16. [<a href='xmlfree.c.html' title=' xmlfree.c '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='xmlopen.c.html' title=' xmlopen.c '>NEXT</a>]
  19. </div>
  20. <pre>
  21. /*====================================================================*
  22. *
  23. * NODE * xmlnode (NODE * root);
  24. *
  25. * node.h
  26. *
  27. * create an empty node and attach it as the last child below the
  28. * root node;
  29. *
  30. * Motley Tools by Charles Maier &lt;cmaier@cmassoc.net&gt;;
  31. * Copyright (c) 2001-2006 by Charles Maier Associates;
  32. * Licensed under the Internet Software Consortium License;
  33. *
  34. *--------------------------------------------------------------------*/
  35. #ifndef XMLNODE_SOURCE
  36. #define XMLNODE_SOURCE
  37. #include &lt;memory.h&gt;
  38. #include &quot;../nodes/node.h&quot;
  39. #include &quot;../tools/memory.h&quot;
  40. NODE * xmlnode (NODE * root)
  41. {
  42. NODE * node = NEW (NODE);
  43. memset (node, 0, sizeof (NODE));
  44. if (!root)
  45. {
  46. return (node);
  47. }
  48. if (root-&gt;below)
  49. {
  50. NODE * temp = root-&gt;below;
  51. while (temp-&gt;after)
  52. {
  53. temp = temp-&gt;after;
  54. }
  55. node-&gt;above = root;
  56. temp-&gt;after = node;
  57. node-&gt;prior = temp;
  58. return (node);
  59. }
  60. root-&gt;below = node;
  61. node-&gt;above = root;
  62. return (node);
  63. }
  64. #endif
  65. </pre>
  66. <div class='footerlink'>
  67. [<a href='xmlfree.c.html' title=' xmlfree.c '>PREV</a>]
  68. [<a href='toolkit.html' title=' Index '>HOME</a>]
  69. [<a href='xmlopen.c.html' title=' xmlopen.c '>NEXT</a>]
  70. </div>
  71. </body>
  72. </html>