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/libohana
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libohana/include/ohana.h

    r8633 r10073  
    9393# endif /* FOPEN */
    9494
     95/*
     96  isspace is c99 : do we require c99 now?
     97  isspace()
     98   checks  for white-space characters.  In the "C" and "POSIX" locales, these are: space, form-feed ('\f'), newline ('\n'),
     99   carriage return ('\r'), horizontal tab ('\t'), and vertical tab ('\v').
     100   horiz. tab: 0x09, vert. tab: 0x0b, newline: 0x0a, form-feed: 0x0c, return: 0x0d, space: 0x20,
     101*/
     102# define OHANA_WHITESPACE(c)(((c) == 0x09) || ((c) == 0x0a) || ((c) == 0x0b) || ((c) == 0x0b) || ((c) == 0x0c) || ((c) == 0x0d) || ((c) == 0x20))
     103
    95104/* socket / pipe communication buffer */
    96105typedef struct {
  • trunk/Ohana/src/libohana/src/config.c

    r2647 r10073  
    11# include <ohana.h>
    2 # ifndef whitespace
    3 # define whitespace(c) (((c) == ' ') || ((c) == '\t'))
    4 # endif
    52
    63# define D_NBYTES 4096
     
    278275    }
    279276    p2 = tmp + strlen (tfield);
    280     if (whitespace (*p2)) {
     277    if (OHANA_WHITESPACE (*p2)) {
    281278      p = p2;
    282279      i++;
  • trunk/Ohana/src/libohana/src/string.c

    r8633 r10073  
    11# include <ohana.h>
    22
    3 #ifndef whitespace
    4 #define whitespace(c) (((c) == ' ') || ((c) == '\t'))
    5 #endif
    6 
    7 /* Strip whitespace from the start and end of STRING. */
     3/* Strip WHITESPACE from the start and end of STRING. */
    84int stripwhite (char *string) {
    95
     
    128  if (string == (char *) NULL) return (FALSE);
    139
    14   for (i = 0; whitespace (string[i]); i++);
     10  for (i = 0; OHANA_WHITESPACE (string[i]); i++);
    1511  if (i) memmove (string, string + i, strlen(string+i)+1);
    16   for (i = strlen (string) - 1; (i > 0) && whitespace (string[i]); i--);
     12  for (i = strlen (string) - 1; (i > 0) && OHANA_WHITESPACE (string[i]); i--);
    1713  string[++i] = 0;
    1814  return (i);
Note: See TracChangeset for help on using the changeset viewer.