IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 22, 2004, 1:23:23 PM (22 years ago)
Author:
eugene
Message:

fixing dvomath for strings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.shell/check_stack.c

    r2598 r2792  
    11# include "opihi.h"
    22
    3 int check_stack (StackVar *stack, int Nstack) {
     3int check_stack (StackVar *stack, int Nstack, int validsize) {
    44
    5   int i, Nx, Ny, Nv;
     5  int i, Nx, Ny, Nv, size;
    66  char *c, line[128];
    77
     
    1010  for (i = 0; i < Nstack; i++) {
    1111    if (stack[i].type == 'X') {
     12
    1213      /** if this is a number, put it on the list of scalers and move on **/
    1314      stack[i].Float = strtod (stack[i].name, &c);
     
    1718        continue;
    1819      }
     20
     21      /** if we demand a scalar, interpret strings as strings */
     22      if (validsize == 0) {
     23        stack[i].type  = 'W';
     24        continue;
     25      }
     26       
    1927      /** if this is a matrix, find the dimensions and check with existing values **/
    2028      if (IsBuffer (stack[i].name)) {
     
    3846        continue;
    3947      }
     48
    4049      /** if this is a vector, find the dimensions and check with existing values **/
    4150      if (IsVector (stack[i].name)) {
     
    6372  }
    6473
    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);
    6981}
Note: See TracChangeset for help on using the changeset viewer.