Changeset 10073 for trunk/Ohana/src/opihi
- Timestamp:
- Nov 17, 2006, 5:04:25 PM (20 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 7 edited
-
cmd.data/init.c (modified) (2 diffs)
-
lib.shell/expand_vars.c (modified) (1 diff)
-
lib.shell/expand_vectors.c (modified) (1 diff)
-
lib.shell/isolate_elements.c (modified) (1 diff)
-
lib.shell/opihi.c (modified) (1 diff)
-
lib.shell/parse.c (modified) (2 diffs)
-
lib.shell/string.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.data/init.c
r9726 r10073 100 100 int vgrid PROTO((int, char **)); 101 101 int vgauss PROTO((int, char **)); 102 int vmaxwell PROTO((int, char **)); 102 103 int vload PROTO((int, char **)); 103 104 int vstat PROTO((int, char **)); … … 211 212 {"select", vect_select, "selective vector assignment"}, 212 213 {"vgauss", vgauss, ""}, 214 {"vmaxwell", vmaxwell, ""}, 213 215 {"vgrid", vgrid, ""}, 214 216 {"vload", vload, "load vectors on Kii"}, -
trunk/Ohana/src/opihi/lib.shell/expand_vars.c
r9844 r10073 38 38 if (*L == 0) break; 39 39 40 V1 = aftervar (L); /* V1 points to the first non- whitespaceafter the variable */40 V1 = aftervar (L); /* V1 points to the first non-WHITESPACE after the variable */ 41 41 V0 = thisvar (L); /* V0 points to the name of the var */ 42 42 /* 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 50 50 51 51 /* 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--); 53 53 w ++; 54 54 n = (int)(p - w); -
trunk/Ohana/src/opihi/lib.shell/isolate_elements.c
r7917 r10073 121 121 } 122 122 /* not an operator, not a quoted string */ 123 if (! whitespace(in[i][j])) {123 if (!OHANA_WHITESPACE (in[i][j])) { 124 124 InsertValue (in[i][j]); 125 125 } else { -
trunk/Ohana/src/opihi/lib.shell/opihi.c
r7917 r10073 33 33 continue; 34 34 } 35 35 36 Nbad = 0; 36 37 ohana_memregister (line); -
trunk/Ohana/src/opihi/lib.shell/parse.c
r7917 r10073 51 51 if (*V1 != '=') goto error; 52 52 53 /* find first non- whitespacecharacter after = */53 /* find first non-WHITESPACE character after = */ 54 54 V1 ++; 55 55 while (isspace (*V1)) V1++; … … 93 93 val = dvomath (1, &V1, &size, 0); 94 94 if (val == NULL) { 95 while ( whitespace(*V1)) V1++;95 while (OHANA_WHITESPACE (*V1)) V1++; 96 96 val = strcreate (V1); 97 97 } -
trunk/Ohana/src/opihi/lib.shell/string.c
r7917 r10073 3 3 /**********************************************************************/ 4 4 /* returns a pointer to an isolated string containing the first word, 5 removing leading whitespace. A "word" is a contiguous set of5 removing leading WHITESPACE. A "word" is a contiguous set of 6 6 characters from the set: alphanumerics, and any of: / . _ - 7 Any other single, non- whitespacecharacters are considered to be7 Any other single, non-WHITESPACE characters are considered to be 8 8 complete words in themselves. Any characters surrounded by quotes 9 9 make a single word … … 17 17 if (string == (char *) NULL) return ((char *) NULL); 18 18 19 for (i = 0; whitespace(string[i]); i++);19 for (i = 0; OHANA_WHITESPACE (string[i]); i++); 20 20 if (string[i] == 0) return ((char *)NULL); 21 21 if (string[i] == ';') { … … 63 63 64 64 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++); 66 66 word = strncreate (&string[i], j - i); 67 67 return (word); … … 70 70 71 71 /* 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 */ 73 73 char *thiscomm (char *string) { 74 74 … … 78 78 if (string == (char *) NULL) return ((char *) NULL); 79 79 80 for (i = 0; whitespace(string[i]); i++);80 for (i = 0; OHANA_WHITESPACE (string[i]); i++); 81 81 if (string[i] == 0) return ((char *)NULL); 82 82 83 for (j = i; ((string[j] != 0) && ! whitespace(string[j])); j++);83 for (j = i; ((string[j] != 0) && !OHANA_WHITESPACE (string[j])); j++); 84 84 if (i == j) return ((char *) NULL); 85 85 … … 122 122 if (string == (char *) NULL) return ((char *) NULL); 123 123 124 for (i = 0; whitespace(string[i]); i++);124 for (i = 0; OHANA_WHITESPACE (string[i]); i++); 125 125 if (string[i] == 0) return ((char *)NULL); 126 126 … … 134 134 } 135 135 i++; 136 for (; (string[i] != 0) && whitespace(string[i]); i++);136 for (; (string[i] != 0) && OHANA_WHITESPACE (string[i]); i++); 137 137 if (string[i] == 0) return ((char *) NULL); 138 138 return (&string[i]); … … 155 155 return ((char *)NULL); 156 156 } 157 for (; (string[i] != 0) && whitespace(string[i]); i++);157 for (; (string[i] != 0) && OHANA_WHITESPACE (string[i]); i++); 158 158 if (string[i] == 0) return ((char *) NULL); 159 159 return (&string[i]); … … 161 161 162 162 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++); 165 165 if (string[i] == 0) return ((char *) NULL); 166 166 … … 169 169 170 170 /* 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 */ 172 172 char *nextcomm (char *string) { 173 173 … … 176 176 if (string == (char *) NULL) return ((char *) NULL); 177 177 178 for (i = 0; (string[i] != 0) && ! whitespace(string[i]); i++);178 for (i = 0; (string[i] != 0) && !OHANA_WHITESPACE (string[i]); i++); 179 179 if (string[i] == 0) return ((char *) NULL); 180 180 181 for (; whitespace(string[i]); i++);181 for (; OHANA_WHITESPACE (string[i]); i++); 182 182 if (string[i] == 0) return ((char *) NULL); 183 183 … … 193 193 if (c == (char *) NULL) return ((char *) NULL); 194 194 195 for (; ! whitespace(*c) && (c >= string); c--);195 for (; !OHANA_WHITESPACE(*c) && (c >= string); c--); 196 196 if (c < string) return ((char *)NULL); 197 197 198 for (; whitespace(*c) && (c >= string); c--);198 for (; OHANA_WHITESPACE(*c) && (c >= string); c--); 199 199 if (c < string) 200 200 return ((char *)NULL); 201 for (; ! whitespace(*c) && (c >= string); c--);201 for (; !OHANA_WHITESPACE(*c) && (c >= string); c--); 202 202 c++; 203 203 return (c); … … 207 207 208 208 /* 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 the209 a pointer to the next thing (non WHITESPACE) which is not part of the 210 210 variable extract only the variable name */ 211 211 … … 224 224 if (i == start) return ((char *) NULL); 225 225 226 for (j = i; whitespace(string[j]); j++);226 for (j = i; OHANA_WHITESPACE (string[j]); j++); 227 227 if (string[j] == 0) return ((char *)NULL); 228 228 … … 240 240 if (c == (char *) NULL) return ((char *) NULL); 241 241 242 for (; (c >= string) && whitespace(*c); c--);242 for (; (c >= string) && OHANA_WHITESPACE(*c); c--); 243 243 if (c < string) return ((char *)NULL); 244 244
Note:
See TracChangeset
for help on using the changeset viewer.
