Changeset 2792 for trunk/Ohana/src/opihi/lib.shell/check_stack.c
- Timestamp:
- Dec 22, 2004, 1:23:23 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/lib.shell/check_stack.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/lib.shell/check_stack.c
r2598 r2792 1 1 # include "opihi.h" 2 2 3 int check_stack (StackVar *stack, int Nstack ) {3 int check_stack (StackVar *stack, int Nstack, int validsize) { 4 4 5 int i, Nx, Ny, Nv ;5 int i, Nx, Ny, Nv, size; 6 6 char *c, line[128]; 7 7 … … 10 10 for (i = 0; i < Nstack; i++) { 11 11 if (stack[i].type == 'X') { 12 12 13 /** if this is a number, put it on the list of scalers and move on **/ 13 14 stack[i].Float = strtod (stack[i].name, &c); … … 17 18 continue; 18 19 } 20 21 /** if we demand a scalar, interpret strings as strings */ 22 if (validsize == 0) { 23 stack[i].type = 'W'; 24 continue; 25 } 26 19 27 /** if this is a matrix, find the dimensions and check with existing values **/ 20 28 if (IsBuffer (stack[i].name)) { … … 38 46 continue; 39 47 } 48 40 49 /** if this is a vector, find the dimensions and check with existing values **/ 41 50 if (IsVector (stack[i].name)) { … … 63 72 } 64 73 65 /* we return a value which is 1 greater than the object dimension */ 66 if (Nx != -1) return (2); 67 if (Nv != -1) return (1); 68 return (0); 74 /* return object dimensions */ 75 size = 0; 76 if (Nv != -1) size = 1; 77 if (Nx != -1) size = 2; 78 if (validsize == -1) return (size); 79 if (validsize != size) return (-1); 80 return (size); 69 81 }
Note:
See TracChangeset
for help on using the changeset viewer.
