Ignore:
Timestamp:
Oct 9, 2008 6:26:51 PM (16 years ago)
Author:
gah
Message:
 
Location:
trunk/packages/vizservers/nanovis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/nanovis.cpp

    r1170 r1182  
    123123FILE *NanoVis::stdin = NULL;
    124124FILE *NanoVis::logfile = NULL;
     125FILE *NanoVis::recfile = NULL;
    125126
    126127bool NanoVis::lic_on = false;
     
    449450    if (debug_flag) {
    450451        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);
    451456    }
    452457    result = Tcl_Eval(interp, Tcl_DStringValue(dsPtr));
     
    22262231            {"path",    required_argument, NULL,           2},
    22272232            {"debug",   no_argument,       NULL,           3},
     2233            {"record",  required_argument, NULL,           4},
    22282234            {0, 0, 0, 0}
    22292235        };
     
    22312237        int c;
    22322238
    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);
    22342240        if (c == -1) {
    22352241            break;
     
    22732279            }
    22742280            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;
    22752297        default:
    22762298            fprintf(stderr,"unknown option '%c'.\n", c);
  • trunk/packages/vizservers/nanovis/nanovis.h

    r1161 r1182  
    177177#endif
    178178
    179     static FILE *stdin, *logfile;
     179    static FILE *stdin, *logfile, *recfile;
    180180
    181181    static void read_screen(void) {
Note: See TracChangeset for help on using the changeset viewer.