Index: /trunk/Ohana/src/libohana/include/ohana.h
===================================================================
--- /trunk/Ohana/src/libohana/include/ohana.h	(revision 37032)
+++ /trunk/Ohana/src/libohana/include/ohana.h	(revision 37033)
@@ -71,4 +71,13 @@
 # endif
 
+# define MARKTIME(MSG,...) {			\
+    gettimeofday (&stopTimer, (void *) NULL);	\
+    float dtime = DTIME (stopTimer, startTimer);	\
+    fprintf (stderr, MSG, __VA_ARGS__); }
+
+# define INITTIME \
+  struct timeval startTimer, stopTimer; \
+  gettimeofday (&startTimer, (void *) NULL);
+
 #ifdef __GNUC__
 #define OHANA_FORMAT(style, fmt, varargs) __attribute__((format(style, fmt, varargs)))
@@ -252,8 +261,13 @@
 int     scan_line              PROTO((FILE *f, char *line)); 
 int     scan_line_maxlen       PROTO((FILE *f, char *line, int maxlen)); 
+char   *parse_nextword         PROTO((char *string));
+char   *parse_nextword_csv     PROTO((char *string));
 int     dparse                 PROTO((double *X, int NX, char *line));
 int     dparse_csv             PROTO((double *X, int NX, char *line));
 int     iparse                 PROTO((int *X, int NX, char *line));
 int     iparse_csv             PROTO((int *X, int NX, char *line));
+int     charparse_csv          PROTO((char *X, int NX, char *line));
+char   *ptrparse               PROTO((int NX, char *line));
+char   *ptrparse_csv           PROTO((int NX, char *line));
 int     charparse_csv          PROTO((char *X, int NX, char *line));
 int     charparse              PROTO((char *X, int NX, char *line));
@@ -266,4 +280,7 @@
 char   *strip_version          PROTO((char *input));
 char   *strsubs                PROTO((char *string, char *match, char *with));
+
+char   *getword                PROTO((char *string));
+char   *skipword               PROTO((char *string));
 
 /* in findexec.c */
Index: /trunk/Ohana/src/libohana/src/string.c
===================================================================
--- /trunk/Ohana/src/libohana/src/string.c	(revision 37032)
+++ /trunk/Ohana/src/libohana/src/string.c	(revision 37033)
@@ -167,5 +167,5 @@
 }
 
-char *_parse_nextword (char *string) {
+char *parse_nextword (char *string) {
 
   if (string == (char *) NULL) return ((char *) NULL);
@@ -182,5 +182,5 @@
 // ,,, : go from , to , to , to 0
 
-char *_parse_nextword_csv (char *string) {
+char *parse_nextword_csv (char *string) {
 
   if (string == (char *) NULL) return ((char *) NULL);
@@ -199,5 +199,5 @@
   word = line;
   for (i = 0; i < NX - 1; i++)
-    word = _parse_nextword (word);
+    word = parse_nextword (word);
 
   *X = strtod (word, &ptr);
@@ -215,5 +215,5 @@
   word = line;
   for (i = 0; i < NX - 1; i++)
-    word = _parse_nextword_csv (word);
+    word = parse_nextword_csv (word);
   
   if (word[0] == '"') word[0] = ' ';
@@ -237,5 +237,5 @@
   word = line;
   for (i = 0; i < NX - 1; i++)
-    word = _parse_nextword (word);
+    word = parse_nextword (word);
 
   *X = strtol (word, &ptr, 0);
@@ -253,5 +253,5 @@
   word = line;
   for (i = 0; i < NX - 1; i++)
-    word = _parse_nextword_csv (word);
+    word = parse_nextword_csv (word);
   
   if (word[0] == '"') word[0] = ' ';
@@ -274,5 +274,5 @@
   word = line;
   for (i = 0; i < NX - 1; i++)
-    word = _parse_nextword (word);
+    word = parse_nextword (word);
 
   *X = word[0];
@@ -287,5 +287,5 @@
   word = line;
   for (i = 0; i < NX - 1; i++)
-    word = _parse_nextword_csv (word);
+    word = parse_nextword_csv (word);
   
   if (word[0] == '"') word[0] = word[1];
@@ -299,4 +299,31 @@
 }
 
+// return a pointer to the start of the desired field
+char *ptrparse (int NX, char *line) {
+
+  int i;
+  char *word;
+
+  word = line;
+  for (i = 0; i < NX - 1; i++) {
+    word = parse_nextword (word);
+  }
+  return word;
+}
+
+char *ptrparse_csv (int NX, char *line) {
+
+  int i;
+  char *word;
+
+  word = line;
+  for (i = 0; i < NX - 1; i++)
+    word = parse_nextword_csv (word);
+  
+  if (word[0] == '"') word ++;
+  if (word[0] == ',') return NULL;
+  return word;
+}
+
 int tparse (time_t *X, int NX, char *line) {
 
@@ -306,5 +333,5 @@
   word = line;
   for (i = 0; i < NX - 1; i++)
-    word = _parse_nextword (word);
+    word = parse_nextword (word);
 
   status = ohana_str_to_time (word, X);
@@ -320,5 +347,5 @@
   word = line;
   for (i = 0; i < NX - 1; i++)
-    word = _parse_nextword_csv (word);
+    word = parse_nextword_csv (word);
   
   if (word[0] == '"') word[0] = ' ';
@@ -341,5 +368,5 @@
   word = line;
   for (i = 0; i < NX - 1; i++)
-    word = _parse_nextword (word);
+    word = parse_nextword (word);
 
   *X = strtod (word, &ptr);
@@ -402,2 +429,41 @@
   return (q);
 }
+
+// return a newly allocated string containing the first complete set of non-whitespace
+char *getword (char *string) {
+
+  int i, j;
+  char *word;
+
+  if (!string) return (NULL);
+
+  // find the end of the whitespace (is there any non-whitespace?)
+  for (i = 0; OHANA_WHITESPACE (string[i]); i++);
+  if (!string[i]) return (NULL);
+
+  for (j = i; string[j] && !OHANA_WHITESPACE(string[j]); j++);
+  word = strncreate (&string[i], j - i);
+  return (word);
+}
+
+// returns a pointer to the next word, or NULL if there is not a next word
+char *skipword (char *string) {
+
+  int i;
+
+  if (!string) return (NULL);
+
+  // find the end of the whitespace (is there any non-whitespace?)
+  for (i = 0; OHANA_WHITESPACE (string[i]); i++);
+  if (!string[i]) return (NULL);
+
+  // find the end of the non-whitespace (this word)
+  while (string[i] && !OHANA_WHITESPACE(string[i])) i++;
+
+  // find the end of the following whitespace
+  while (string[i] &&  OHANA_WHITESPACE(string[i])) i++;
+  if (!string[i]) return (NULL);
+
+  return (&string[i]);
+}
+
