IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 17, 2006, 5:04:25 PM (20 years ago)
Author:
eugene
Message:

added additional chars to whitespace checks

Location:
trunk/Ohana/src/opihi
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/init.c

    r9726 r10073  
    100100int vgrid            PROTO((int, char **));
    101101int vgauss           PROTO((int, char **));
     102int vmaxwell         PROTO((int, char **));
    102103int vload            PROTO((int, char **));
    103104int vstat            PROTO((int, char **));
     
    211212  {"select",       vect_select,      "selective vector assignment"},
    212213  {"vgauss",       vgauss,           ""},
     214  {"vmaxwell",     vmaxwell,         ""},
    213215  {"vgrid",        vgrid,            ""},
    214216  {"vload",        vload,            "load vectors on Kii"},
  • trunk/Ohana/src/opihi/lib.shell/expand_vars.c

    r9844 r10073  
    3838    if (*L == 0) break;
    3939
    40     V1 = aftervar (L);           /* V1 points to the first non-whitespace after the variable */
     40    V1 = aftervar (L);           /* V1 points to the first non-WHITESPACE after the variable */
    4141    V0 = thisvar (L);            /* V0 points to the name of the var */
    4242    /* note: V1 points to a fraction of L, it does not need to be freed */
  • trunk/Ohana/src/opihi/lib.shell/expand_vectors.c

    r7917 r10073  
    5050
    5151    /* find vector name */
    52     for (w = p - 1; (w >= line) && !whitespace(*w) && (isalnum(*w) || (*w == ':') || (*w == '_')); w--);
     52    for (w = p - 1; (w >= line) && !OHANA_WHITESPACE(*w) && (isalnum(*w) || (*w == ':') || (*w == '_')); w--);
    5353    w ++;
    5454    n = (int)(p - w);
  • trunk/Ohana/src/opihi/lib.shell/isolate_elements.c

    r7917 r10073  
    121121      }
    122122      /* not an operator, not a quoted string */
    123       if (!whitespace (in[i][j])) {
     123      if (!OHANA_WHITESPACE (in[i][j])) {
    124124        InsertValue (in[i][j]);
    125125      } else {
  • trunk/Ohana/src/opihi/lib.shell/opihi.c

    r7917 r10073  
    3333      continue;
    3434    }
     35
    3536    Nbad = 0;
    3637    ohana_memregister (line);
  • trunk/Ohana/src/opihi/lib.shell/parse.c

    r7917 r10073  
    5151    if (*V1 != '=') goto error;
    5252
    53     /* find first non-whitespace character after = */
     53    /* find first non-WHITESPACE character after = */
    5454    V1 ++;
    5555    while (isspace (*V1)) V1++;
     
    9393      val = dvomath (1, &V1, &size, 0);
    9494      if (val == NULL) {
    95         while (whitespace (*V1)) V1++;
     95        while (OHANA_WHITESPACE (*V1)) V1++;
    9696        val = strcreate (V1);
    9797      }
  • trunk/Ohana/src/opihi/lib.shell/string.c

    r7917 r10073  
    33/**********************************************************************/
    44/* returns a pointer to an isolated string containing the first word,
    5    removing leading whitespace.  A "word" is a contiguous set of
     5   removing leading WHITESPACE.  A "word" is a contiguous set of
    66   characters from the set: alphanumerics, and any of: / . _ -
    7    Any other single, non-whitespace characters are considered to be
     7   Any other single, non-WHITESPACE characters are considered to be
    88   complete words in themselves.  Any characters surrounded by quotes
    99   make a single word
     
    1717  if (string == (char *) NULL) return ((char *) NULL);
    1818
    19   for (i = 0; whitespace (string[i]); i++);
     19  for (i = 0; OHANA_WHITESPACE (string[i]); i++);
    2020  if (string[i] == 0) return ((char *)NULL);
    2121  if (string[i] == ';') {
     
    6363
    6464
    65   for (j = i; (string[j] != 0) && (string[j] != ';') && !whitespace(string[j]); j++);
     65  for (j = i; (string[j] != 0) && (string[j] != ';') && !OHANA_WHITESPACE(string[j]); j++);
    6666  word = strncreate (&string[i], j - i);
    6767  return (word);
     
    7070
    7171/* returns a pointer to an isolated string containing the first command,
    72    removing leading whitespace.  A command ends with the first non whitespace */
     72   removing leading WHITESPACE.  A command ends with the first non WHITESPACE */
    7373char *thiscomm (char *string) {
    7474
     
    7878  if (string == (char *) NULL) return ((char *) NULL);
    7979
    80   for (i = 0; whitespace (string[i]); i++);
     80  for (i = 0; OHANA_WHITESPACE (string[i]); i++);
    8181  if (string[i] == 0) return ((char *)NULL);
    8282
    83   for (j = i; ((string[j] != 0) && !whitespace (string[j])); j++);
     83  for (j = i; ((string[j] != 0) && !OHANA_WHITESPACE (string[j])); j++);
    8484  if (i == j) return ((char *) NULL);
    8585
     
    122122  if (string == (char *) NULL) return ((char *) NULL);
    123123
    124   for (i = 0; whitespace (string[i]); i++);
     124  for (i = 0; OHANA_WHITESPACE (string[i]); i++);
    125125  if (string[i] == 0) return ((char *)NULL);
    126126
     
    134134    }
    135135    i++;
    136     for (; (string[i] != 0) && whitespace (string[i]); i++);
     136    for (; (string[i] != 0) && OHANA_WHITESPACE (string[i]); i++);
    137137    if (string[i] == 0) return ((char *) NULL);
    138138    return (&string[i]);
     
    155155      return ((char *)NULL);
    156156    }
    157     for (; (string[i] != 0) && whitespace (string[i]); i++);
     157    for (; (string[i] != 0) && OHANA_WHITESPACE (string[i]); i++);
    158158    if (string[i] == 0) return ((char *) NULL);
    159159    return (&string[i]);
     
    161161
    162162  if (string[i] == ';') i++;
    163   for (; (string[i] != 0) && (string[i] != ';') && !whitespace(string[i]); i++);
    164   for (; (string[i] != 0) && whitespace (string[i]); i++);
     163  for (; (string[i] != 0) && (string[i] != ';') && !OHANA_WHITESPACE(string[i]); i++);
     164  for (; (string[i] != 0) && OHANA_WHITESPACE (string[i]); i++);
    165165  if (string[i] == 0) return ((char *) NULL);
    166166
     
    169169
    170170/* returns a pointer to the next command, or (char *) NULL
    171    if there is not a next command.  A command is bounded by whitespace */
     171   if there is not a next command.  A command is bounded by WHITESPACE */
    172172char *nextcomm (char *string) {
    173173
     
    176176  if (string == (char *) NULL) return ((char *) NULL);
    177177 
    178   for (i = 0; (string[i] != 0) && !whitespace (string[i]); i++);
     178  for (i = 0; (string[i] != 0) && !OHANA_WHITESPACE (string[i]); i++);
    179179  if (string[i] == 0) return ((char *) NULL);
    180180 
    181   for (; whitespace (string[i]); i++);
     181  for (; OHANA_WHITESPACE (string[i]); i++);
    182182  if (string[i] == 0) return ((char *) NULL);
    183183
     
    193193  if (c == (char *) NULL) return ((char *) NULL);
    194194
    195   for (; !whitespace(*c) && (c >= string); c--);
     195  for (; !OHANA_WHITESPACE(*c) && (c >= string); c--);
    196196  if (c < string) return ((char *)NULL);
    197197
    198   for (; whitespace(*c) && (c >= string); c--);
     198  for (; OHANA_WHITESPACE(*c) && (c >= string); c--);
    199199  if (c < string)
    200200    return ((char *)NULL);
    201   for (; !whitespace(*c) && (c >= string); c--);
     201  for (; !OHANA_WHITESPACE(*c) && (c >= string); c--);
    202202  c++;
    203203  return (c);
     
    207207
    208208/* take a pointer to the beginning of a variable (ie $fred) and return
    209    a pointer to the next thing (non whitespace) which is not part of the
     209   a pointer to the next thing (non WHITESPACE) which is not part of the
    210210   variable extract only the variable name */
    211211
     
    224224  if (i == start) return ((char *) NULL);
    225225
    226   for (j = i; whitespace (string[j]); j++);
     226  for (j = i; OHANA_WHITESPACE (string[j]); j++);
    227227  if (string[j] == 0) return ((char *)NULL);
    228228
     
    240240  if (c == (char *) NULL) return ((char *) NULL);
    241241
    242   for (; (c >= string) && whitespace(*c); c--);
     242  for (; (c >= string) && OHANA_WHITESPACE(*c); c--);
    243243  if (c < string) return ((char *)NULL);
    244244
Note: See TracChangeset for help on using the changeset viewer.