/[ascend]/trunk/tcltk/generic/interface/Driver.c
ViewVC logotype

Diff of /trunk/tcltk/generic/interface/Driver.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1575 by jpye, Sat Jun 30 23:21:49 2007 UTC revision 1576 by jpye, Sun Aug 5 09:44:07 2007 UTC
# Line 34  Line 34 
34  #include <general/ospath.h>  #include <general/ospath.h>
35  #include <utilities/ascPrint.h>  #include <utilities/ascPrint.h>
36  #include <utilities/error.h>  #include <utilities/error.h>
37    #include <solver/solver.h>
38  #ifdef ASC_SIGNAL_TRAPS  #ifdef ASC_SIGNAL_TRAPS
39  # include <utilities/ascSignal.h>  # include <utilities/ascSignal.h>
40  #endif  #endif
# Line 78  Line 79 
79  #include "SolverProc.h"  #include "SolverProc.h"
80  #include "UnitsProc.h"  #include "UnitsProc.h"
81    
 #ifndef lint  
 static CONST char DriverID[] = "$Id: Driver.c,v 1.48 2003/08/23 18:43:06 ballan Exp $";  
 #endif  
   
82  /*  /*
83   *  EXPORTED VARIABLES   *  EXPORTED VARIABLES
84   */   */
# Line 112  static void AscTrap(int); Line 109  static void AscTrap(int);
109  static void  AscCheckEnvironVars(Tcl_Interp*,const char *progname);  static void  AscCheckEnvironVars(Tcl_Interp*,const char *progname);
110  static void AscPrintHelpExit(CONST char *);  static void AscPrintHelpExit(CONST char *);
111  static int  AscProcessCommandLine(Tcl_Interp*, int, CONST char **);  static int  AscProcessCommandLine(Tcl_Interp*, int, CONST char **);
 static void Prompt(Tcl_Interp*, int);  
112  static int  AscSetStartupFile(Tcl_Interp*);  static int  AscSetStartupFile(Tcl_Interp*);
113  static void StdinProc(ClientData, int);  static void StdinProc(ClientData, int);
114  #ifdef DEBUG_MALLOC  #ifdef DEBUG_MALLOC
# Line 391  int AscDriver(int argc, CONST char **arg Line 387  int AscDriver(int argc, CONST char **arg
387                               (ClientData) inChannel);                               (ClientData) inChannel);
388    }    }
389    if (tty) {    if (tty) {
390      Prompt(interp, 0);      Asc_Prompt(interp, 0);
391    }    }
392    outChannel = Tcl_GetStdChannel(TCL_STDOUT);    outChannel = Tcl_GetStdChannel(TCL_STDOUT);
393    if (outChannel) {    if (outChannel) {
# Line 518  static void AscCheckEnvironVars(Tcl_Inte Line 514  static void AscCheckEnvironVars(Tcl_Inte
514      char *distdir, *tkdir, *bitmapsdir, *librarydir, *solversdir;      char *distdir, *tkdir, *bitmapsdir, *librarydir, *solversdir;
515      struct FilePath *fp, *fp1, *distfp, *tkfp, *bitmapsfp, *libraryfp, *solversfp;      struct FilePath *fp, *fp1, *distfp, *tkfp, *bitmapsfp, *libraryfp, *solversfp;
516      char envcmd[MAX_ENV_VAR_LENGTH];      char envcmd[MAX_ENV_VAR_LENGTH];
517    # ifndef ASC_ABSOLUTE_PATHS
518      char s1[PATH_MAX];      char s1[PATH_MAX];
519    #endif
520      int err;      int err;
521      int guessedtk=0;      int guessedtk=0;
522      FILE *f;      FILE *f;
# Line 890  int Asc_LoadWin(ClientData cdata, Tcl_In Line 888  int Asc_LoadWin(ClientData cdata, Tcl_In
888  }  }
889    
890  /*---------------------------------------------------------------------  /*---------------------------------------------------------------------
891    The following StdinProc() and Prompt() are from tkMain.c in    The following StdinProc() and Asc_Prompt() are from tkMain.c in
892    the Tk4.1 distribution (and did not change in Tk8.0).    the Tk4.1 distribution (and did not change in Tk8.0).
893    ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
894    
# Line 979  StdinProc(ClientData clientData, int mas Line 977  StdinProc(ClientData clientData, int mas
977    
978   prompt:   prompt:
979    if (tty) {    if (tty) {
980      Prompt(interp, gotPartial);      Asc_Prompt(interp, gotPartial);
981    }    }
982    Tcl_ResetResult(interp);    Tcl_ResetResult(interp);
983  }  }
# Line 1000  StdinProc(ClientData clientData, int mas Line 998  StdinProc(ClientData clientData, int mas
998       partial   Non-zero means there already exists a partial       partial   Non-zero means there already exists a partial
999                 command, so use the secondary prompt.                 command, so use the secondary prompt.
1000  */  */
1001  static void  void
1002  Prompt(Tcl_Interp *interp, int partial)  Asc_Prompt(Tcl_Interp *interp, int partial)
1003  {  {
1004    CONST84 char *promptCmd;    CONST84 char *promptCmd;
1005    int code;    int code;
1006    Tcl_Channel outChannel, errChannel;    Tcl_Channel outChannel, errChannel;
1007    CONST84 char *subPrompt;    CONST84 char *subPrompt;
1008    
1009      color_on(stdout,"0;32");
1010    
1011    errChannel = Tcl_GetChannel(interp, "stderr", NULL);    errChannel = Tcl_GetChannel(interp, "stderr", NULL);
1012    
1013    subPrompt = (partial ? "tcl_prompt2" : "tcl_prompt1");    subPrompt = (partial ? "tcl_prompt2" : "tcl_prompt1");
1014    promptCmd = Tcl_GetVar(interp, subPrompt, TCL_GLOBAL_ONLY);    promptCmd = Tcl_GetVar(interp, subPrompt, TCL_GLOBAL_ONLY);
1015    if (promptCmd == NULL) {    if (promptCmd == NULL) {
1016    defaultPrompt:  defaultPrompt:
1017    
1018      /*      /*
1019       * We must check that outChannel is a real channel - it       * We must check that outChannel is a real channel - it
# Line 1021  Prompt(Tcl_Interp *interp, int partial) Line 1021  Prompt(Tcl_Interp *interp, int partial)
1021       * this interpreter with "interp transfer".       * this interpreter with "interp transfer".
1022       */       */
1023    
1024    
1025      outChannel = Tcl_GetChannel(interp, "stdout", NULL);      outChannel = Tcl_GetChannel(interp, "stdout", NULL);
1026      if (outChannel != (Tcl_Channel) NULL) {      if (outChannel != (Tcl_Channel) NULL) {
1027        if (!partial) {        if (!partial) {
# Line 1052  Prompt(Tcl_Interp *interp, int partial) Line 1053  Prompt(Tcl_Interp *interp, int partial)
1053    if (outChannel != (Tcl_Channel) NULL) {    if (outChannel != (Tcl_Channel) NULL) {
1054      Tcl_Flush(outChannel);      Tcl_Flush(outChannel);
1055    }    }
1056      color_off(stdout);
1057  }  }
1058    
1059  #ifdef DEBUG_MALLOC  #ifdef DEBUG_MALLOC

Legend:
Removed from v.1575  
changed lines
  Added in v.1576

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22