Changeset 1182 for trunk/packages/vizservers/nanovis
- Timestamp:
- Oct 9, 2008, 6:26:51 PM (16 years ago)
- Location:
- trunk/packages/vizservers/nanovis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/nanovis.cpp
r1170 r1182 123 123 FILE *NanoVis::stdin = NULL; 124 124 FILE *NanoVis::logfile = NULL; 125 FILE *NanoVis::recfile = NULL; 125 126 126 127 bool NanoVis::lic_on = false; … … 449 450 if (debug_flag) { 450 451 fprintf(NanoVis::logfile, "%s\n", Tcl_DStringValue(dsPtr)); 452 } 453 if (NanoVis::recfile != NULL) { 454 fprintf(NanoVis::recfile, "%s\n", Tcl_DStringValue(dsPtr)); 455 fflush(NanoVis::recfile); 451 456 } 452 457 result = Tcl_Eval(interp, Tcl_DStringValue(dsPtr)); … … 2226 2231 {"path", required_argument, NULL, 2}, 2227 2232 {"debug", no_argument, NULL, 3}, 2233 {"record", required_argument, NULL, 4}, 2228 2234 {0, 0, 0, 0} 2229 2235 }; … … 2231 2237 int c; 2232 2238 2233 c = getopt_long(argc, argv, ":dp:i:l: ", long_options, &option_index);2239 c = getopt_long(argc, argv, ":dp:i:l:r:", long_options, &option_index); 2234 2240 if (c == -1) { 2235 2241 break; … … 2273 2279 } 2274 2280 break; 2281 case 4: 2282 case 'r': 2283 Tcl_DString ds; 2284 char buf[200]; 2285 2286 fprintf(stderr, "Recording commands to %s\n", optarg); 2287 Tcl_DStringInit(&ds); 2288 Tcl_DStringAppend(&ds, optarg, -1); 2289 sprintf(buf, ".%d", getpid()); 2290 Tcl_DStringAppend(&ds, buf, -1); 2291 NanoVis::recfile = fopen(Tcl_DStringValue(&ds), "w"); 2292 if (NanoVis::recfile == NULL) { 2293 perror(optarg); 2294 return 2; 2295 } 2296 break; 2275 2297 default: 2276 2298 fprintf(stderr,"unknown option '%c'.\n", c); -
trunk/packages/vizservers/nanovis/nanovis.h
r1161 r1182 177 177 #endif 178 178 179 static FILE *stdin, *logfile ;179 static FILE *stdin, *logfile, *recfile; 180 180 181 181 static void read_screen(void) {
Note: See TracChangeset
for help on using the changeset viewer.