Changeset 4604

Show
Ignore:
Timestamp:
02/10/10 14:32:35 (4 years ago)
Author:
douglask
Message:

Modifications to allow redirecting the stdout of 'vic -Q' on Windows to a file, e.g:

vic -Q > devices.txt

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vic/branches/mpeg4/main.cpp

    r4603 r4604  
    414414} 
    415415 
     416#ifdef WIN32 
     417#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION == 0) 
     418int 
     419SimplePutsCmd(ClientData clientData, Tcl_Interp *interp, int argc, char **argv) 
     420#else 
     421int 
     422SimplePutsCmd(ClientData clientData, Tcl_Interp *interp, int argc, const char **argv) 
     423#endif 
     424{ 
     425    int i, newline; 
     426 
     427    i = 1; 
     428    newline = 1; 
     429    if ((argc >= 2) && (strcmp(argv[1], "-nonewline") == 0)) { 
     430                newline = 0; 
     431                i++; 
     432    } 
     433        printf("%s", argv[i]); 
     434        if (newline) printf("\n"); 
     435 
     436        return TCL_OK; 
     437} 
     438#endif 
     439 
    416440void print_input_device_details(Tcl& tcl) 
    417441{ 
     442#ifdef WIN32 
     443                tcl.CreateCommand("puts", SimplePutsCmd, NULL); 
     444#endif 
     445 
    418446        tcl.evalc("print_input_device_details"); 
    419447        exit(0);