/[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 582 by johnpye, Tue May 9 01:07:41 2006 UTC revision 583 by ben.allan, Tue May 9 19:14:25 2006 UTC
# Line 487  int AscDriver(int argc, CONST char *argv Line 487  int AscDriver(int argc, CONST char *argv
487   *    CPP_MACRO            ENVIRONMENT VAR    DEFAULT VALUE   *    CPP_MACRO            ENVIRONMENT VAR    DEFAULT VALUE
488   *    =================    ===============    =============   *    =================    ===============    =============
489   *    DIST_ENVIRONVAR      ASCENDDIST         /usr/share/ascend   *    DIST_ENVIRONVAR      ASCENDDIST         /usr/share/ascend
490   *    ASCTK_ENVIRONVAR     ASCENDTK           $ASCENDDIST/tcltk   *    ASCTK_ENVIRONVAR     ASCENDTK           $ASCENDDIST/TK
491   *    BITMAP_ENVIRONVAR    ASCENDBITMAPS      $ASCENDDIST/tcltk/bitmaps   *    BITMAP_ENVIRONVAR    ASCENDBITMAPS      $ASCENDDIST/TK/bitmaps
492   *    LIBR_ENVIRONVAR      ASCENDLIBRARY      .:$ASCENDDIST/models   *    LIBR_ENVIRONVAR      ASCENDLIBRARY      .:$ASCENDDIST/models
493   *   *
494   */   */
# Line 536  static int AscCheckEnvironVars(Tcl_Inter Line 536  static int AscCheckEnvironVars(Tcl_Inter
536        "file nativename [file dirname [file dirname [info nameofexecutable]]]";        "file nativename [file dirname [file dirname [info nameofexecutable]]]";
537      if( Tcl_Eval(interp, cmd) == TCL_OK ) {      if( Tcl_Eval(interp, cmd) == TCL_OK ) {
538        Tcl_DStringGetResult(interp, &ascenddist);        Tcl_DStringGetResult(interp, &ascenddist);
539        Tcl_DStringAppend(&ascenddist, "/share/ascend", -1);        /* Tcl_DStringAppend(&ascenddist, "/share/ascend", -1); */
540        if(Asc_SetPathList(DIST_ENVIRONVAR,Tcl_DStringValue(&ascenddist)) != 0) {        if(Asc_SetPathList(DIST_ENVIRONVAR,Tcl_DStringValue(&ascenddist)) != 0) {
541          Asc_Panic(2, "AscCheckEnvironVars",          Asc_Panic(2, "AscCheckEnvironVars",
542                    "Asc_SetPathList() returned Nonzero: "                    "Asc_SetPathList() returned Nonzero: "
# Line 599  static int AscCheckEnvironVars(Tcl_Inter Line 599  static int AscCheckEnvironVars(Tcl_Inter
599    
600    /*    /*
601     *  If the user's environment does not have ASCENDTK set, then set it     *  If the user's environment does not have ASCENDTK set, then set it
602     *  by appending 'tcltk' to ASCENDDIST.  Later in this function, we check     *  by appending 'TK' to ASCENDDIST.  Later in this function, we check
603     *  to make sure it is a valid directory by checking for the existence     *  to make sure it is a valid directory by checking for the existence
604     *  of `AscendRC' in that directory.     *  of `AscendRC' in that directory.
605       *
606       *  The location of this directory is not subject to debate. It is
607       *  $prefix/TK. If one wants it anywhere else, for any reason, one
608       *  can provide a wrapper that sets the environment variable to override
609       *  it.
610     */     */
611    if( Asc_ImportPathList(ASCTK_ENVIRONVAR) == 0 ) {    if( Asc_ImportPathList(ASCTK_ENVIRONVAR) == 0 ) {
612      if( (tmpenv = Asc_GetEnv(ASCTK_ENVIRONVAR)) == NULL ) {      if( (tmpenv = Asc_GetEnv(ASCTK_ENVIRONVAR)) == NULL ) {
# Line 616  static int AscCheckEnvironVars(Tcl_Inter Line 621  static int AscCheckEnvironVars(Tcl_Inter
621      ascfree(tmpenv);      ascfree(tmpenv);
622    } else {    } else {
623      Tcl_DStringAppend(&buffer2, Tcl_DStringValue(&ascenddist), -1);      Tcl_DStringAppend(&buffer2, Tcl_DStringValue(&ascenddist), -1);
624      /* AWW20041208:    Tcl_DStringAppend(&buffer2, "/tcltk", -1);      /* AWW20041208:    Tcl_DStringAppend(&buffer2, "/TK", -1);
625       */       */
626      Tcl_DStringAppend(&buffer2, "/tcltk", -1);      Tcl_DStringAppend(&buffer2, "/TK", -1);
627      if(NULL != (Tcl_TranslateFileName(interp, Tcl_DStringValue(&buffer2),      if(NULL != (Tcl_TranslateFileName(interp, Tcl_DStringValue(&buffer2),
628                                        &buffer1))) {                                        &buffer1))) {
629        if( Asc_SetPathList(ASCTK_ENVIRONVAR, Tcl_DStringValue(&buffer1)) != 0) {        if( Asc_SetPathList(ASCTK_ENVIRONVAR, Tcl_DStringValue(&buffer1)) != 0) {
# Line 649  static int AscCheckEnvironVars(Tcl_Inter Line 654  static int AscCheckEnvironVars(Tcl_Inter
654                 TCL_GLOBAL_ONLY);                 TCL_GLOBAL_ONLY);
655    } else {    } else {
656      Asc_Panic(2, "AscCheckEnvironVars",      Asc_Panic(2, "AscCheckEnvironVars",
657                "ERROR: Cannot find the file \"%s\" in the subdirectory \"tcltk\"\n"                "ERROR: Cannot find the file \"%s\" in the subdirectory \"TK\"\n"
658                "under the directory \"%s\"\n"                "under the directory \"%s\"\n"
659                "Please check the value of the environment variables %s and\n"                "Please check the value of the environment variables %s and\n"
660                "and %s and start ASCEND again.\n",                "and %s and start ASCEND again.\n",
# Line 673  static int AscCheckEnvironVars(Tcl_Inter Line 678  static int AscCheckEnvironVars(Tcl_Inter
678      ascfree(tmpenv);      ascfree(tmpenv);
679    } else {    } else {
680      Tcl_DStringAppend(&buffer2, Tcl_DStringValue(&ascenddist), -1);      Tcl_DStringAppend(&buffer2, Tcl_DStringValue(&ascenddist), -1);
681      Tcl_DStringAppend(&buffer2, "/tcltk/bitmaps", -1);      Tcl_DStringAppend(&buffer2, "/TK/bitmaps", -1);
682      if(NULL != (Tcl_TranslateFileName(interp, Tcl_DStringValue(&buffer2),      if(NULL != (Tcl_TranslateFileName(interp, Tcl_DStringValue(&buffer2),
683                                        &buffer1))) {                                        &buffer1))) {
684        if(Asc_SetPathList(BITMAP_ENVIRONVAR, Tcl_DStringValue(&buffer1)) != 0) {        if(Asc_SetPathList(BITMAP_ENVIRONVAR, Tcl_DStringValue(&buffer1)) != 0) {

Legend:
Removed from v.582  
changed lines
  Added in v.583

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