Changeset 10073 for trunk/Ohana/src/libohana
- Timestamp:
- Nov 17, 2006, 5:04:25 PM (20 years ago)
- Location:
- trunk/Ohana/src/libohana
- Files:
-
- 3 edited
-
include/ohana.h (modified) (1 diff)
-
src/config.c (modified) (2 diffs)
-
src/string.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libohana/include/ohana.h
r8633 r10073 93 93 # endif /* FOPEN */ 94 94 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 95 104 /* socket / pipe communication buffer */ 96 105 typedef struct { -
trunk/Ohana/src/libohana/src/config.c
r2647 r10073 1 1 # include <ohana.h> 2 # ifndef whitespace3 # define whitespace(c) (((c) == ' ') || ((c) == '\t'))4 # endif5 2 6 3 # define D_NBYTES 4096 … … 278 275 } 279 276 p2 = tmp + strlen (tfield); 280 if ( whitespace(*p2)) {277 if (OHANA_WHITESPACE (*p2)) { 281 278 p = p2; 282 279 i++; -
trunk/Ohana/src/libohana/src/string.c
r8633 r10073 1 1 # include <ohana.h> 2 2 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. */ 8 4 int stripwhite (char *string) { 9 5 … … 12 8 if (string == (char *) NULL) return (FALSE); 13 9 14 for (i = 0; whitespace(string[i]); i++);10 for (i = 0; OHANA_WHITESPACE (string[i]); i++); 15 11 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--); 17 13 string[++i] = 0; 18 14 return (i);
Note:
See TracChangeset
for help on using the changeset viewer.
