ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/calc.c
(Generate patch)

Comparing ray/src/cal/calc.c (file contents):
Revision 1.9 by greg, Thu Feb 9 21:54:10 2023 UTC vs.
Revision 1.11 by greg, Sat Jun 7 05:09:45 2025 UTC

# Line 12 | Line 12 | static const char      RCSid[] = "$Id$";
12   #include  <ctype.h>
13  
14   #include  "rtio.h"
15 + #include  "paths.h"
16   #include  "rterror.h"
17   #include  "calcomp.h"
18  
# Line 63 | Line 64 | main(int argc, char *argv[])
64                          epos[-1] = ' ';
65                          continue;               /* escaped newline */
66                  }
67 +                while (epos > expr && isspace(epos[-1]))
68 +                        epos--;                 /* eliminate end spaces */
69                  *epos = '\0';
70                  epos = expr;
71                  switch (expr[0]) {
# Line 71 | Line 74 | main(int argc, char *argv[])
74                  case '?':
75                          for (cp = expr+1; isspace(*cp); cp++)
76                                  ;
77 +                        if (*calcontext(NULL))
78 +                                printf("context is: %s\n", calcontext(NULL));
79                          if (*cp)
80                                  dprint(cp, stdout);
81                          else
# Line 105 | Line 110 | main(int argc, char *argv[])
110                          }
111                          fcompile(cp);
112                          eclock++;
113 +                        continue;
114 +                case '[':
115 +                        for (cp = expr+1; isspace(*cp); cp++)
116 +                                ;
117 +                        if (!isalpha(*cp)) {
118 +                                eputs("context name required\n");
119 +                                continue;
120 +                        }
121 +                        printf("context now: %s\n", pushcontext(cp));
122 +                        continue;
123 +                case ']':
124 +                        cp = popcontext();
125 +                        if (*cp)
126 +                                printf("context now: %s\n", cp);
127 +                        else
128 +                                printf("at global context\n");
129                          continue;
130                  }
131                  if ((cp = strchr(expr, '=')) != NULL ||

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines