[Expat-checkins] expat/examples elements.c,1.1,1.2 outline.c,1.2,1.3

fdrake@users.sourceforge.net fdrake@users.sourceforge.net
Mon Jul 1 07:46:48 2002


Update of /cvsroot/expat/expat/examples
In directory usw-pr-cvs1:/tmp/cvs-serv25187

Modified Files:
	elements.c outline.c 
Log Message:
De-tabify; minor code-style consistency changes.

Index: elements.c
===================================================================
RCS file: /cvsroot/expat/expat/examples/elements.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- elements.c	26 Jul 2001 21:54:43 -0000	1.1
+++ elements.c	1 Jul 2002 14:45:51 -0000	1.2
@@ -1,7 +1,8 @@
 /* This is simple demonstration of how to use expat. This program
-reads an XML document from standard input and writes a line with the
-name of each element to standard output indenting child elements by
-one tab stop more than their parent element. */
+   reads an XML document from standard input and writes a line with
+   the name of each element to standard output indenting child
+   elements by one tab stop more than their parent element.
+*/
 
 #include <stdio.h>
 #include "expat.h"
@@ -38,9 +39,9 @@
     done = len < sizeof(buf);
     if (!XML_Parse(parser, buf, len, done)) {
       fprintf(stderr,
-	      "%s at line %d\n",
-	      XML_ErrorString(XML_GetErrorCode(parser)),
-	      XML_GetCurrentLineNumber(parser));
+              "%s at line %d\n",
+              XML_ErrorString(XML_GetErrorCode(parser)),
+              XML_GetCurrentLineNumber(parser));
       return 1;
     }
   } while (!done);

Index: outline.c
===================================================================
RCS file: /cvsroot/expat/expat/examples/outline.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- outline.c	25 Jul 2001 17:04:22 -0000	1.2
+++ outline.c	1 Jul 2002 14:45:51 -0000	1.3
@@ -24,14 +24,15 @@
 #include <stdio.h>
 #include <expat.h>
 
-#define BUFFSIZE	8192
+#define BUFFSIZE        8192
 
 char Buff[BUFFSIZE];
 
 int Depth;
 
 static void
-start(void *data, const char *el, const char **attr) {
+start(void *data, const char *el, const char **attr)
+{
   int i;
 
   for (i = 0; i < Depth; i++)
@@ -45,15 +46,17 @@
 
   printf("\n");
   Depth++;
-}  /* End of start handler */
+}
 
 static void
-end(void *data, const char *el) {
+end(void *data, const char *el)
+{
   Depth--;
-}  /* End of end handler */
+}
 
 int
-main(int argc, char *argv[]) {
+main(int argc, char *argv[])
+{
   XML_Parser p = XML_ParserCreate(NULL);
   if (! p) {
     fprintf(stderr, "Couldn't allocate memory for parser\n");
@@ -75,8 +78,8 @@
 
     if (! XML_Parse(p, Buff, len, done)) {
       fprintf(stderr, "Parse error at line %d:\n%s\n",
-	      XML_GetCurrentLineNumber(p),
-	      XML_ErrorString(XML_GetErrorCode(p)));
+              XML_GetCurrentLineNumber(p),
+              XML_ErrorString(XML_GetErrorCode(p)));
       exit(-1);
     }
 
@@ -84,5 +87,4 @@
       break;
   }
   return 0;
-}  /* End of main */
-
+}