[or-cvs] Document parsing functions in routerlist.c, and separate pa...

Nick Mathewson nickm at seul.org
Tue Dec 9 04:29:54 UTC 2003


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv20405/src/or

Modified Files:
	routerlist.c 
Log Message:
Document parsing functions in routerlist.c, and separate parsing from non-parsing functions.

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- routerlist.c	8 Dec 2003 23:45:36 -0000	1.3
+++ routerlist.c	9 Dec 2003 04:29:52 -0000	1.4
@@ -21,8 +21,50 @@
 
 /****************************************************************************/
 
-struct directory_token_t;
-typedef struct directory_token_t directory_token_t;
+/* Enumeration of possible token types.  The ones starting with K_ correspond
+ * to directory 'keywords'.  _SIGNATURE and _PUBLIC_KEY are self-explanitory.
+ * _ERR is an error in the tokenizing process, _EOF is an end-of-file marker,
+ * and _NIL is used to encode not-a-token.
+ */
+typedef enum {
[...1092 lines suppressed...]
+  }
+  end = strchr(end, '\n');
+  if (!end) {
+    log_fn(LOG_WARN,"couldn't find EOL");
+    return -1;
+  }
+  ++end;
+
+  if (crypto_SHA_digest(start, end-start, digest)) {
+    log_fn(LOG_WARN,"couldn't compute digest");
+    return -1;
+  }
+
+  return 0;
 }
+
+
 
 /*
   Local Variables:



More information about the tor-commits mailing list