Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch initsubsystems2 Excluding Merge-Ins
This is equivalent to a diff from 3f78dfe593 to be1a739694
2013-03-29
| ||
15:05 | Win32: Fossil now understands Cygwin paths containing one or more of the characters <nowiki>"*:<>?|</nowiki>. Those are normally forbidden in win32. This means that the win32 fossil.exe is better usable in a Cygwin environment. See [http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-specialchars]. check-in: fc413110eb user: jan.nijtmans tags: trunk | |
2013-03-28
| ||
22:30 | (!Experiment, not meant for trunk, ever!) How would the fossil code look like, if the Tcl_InitSubsystems() function (TIP #414) was available. Closed-Leaf check-in: be1a739694 user: jan.nijtmans tags: initsubsystems2 | |
05:45 | Update autosetup to the latest version (0.6.5) Closed-Leaf check-in: 55a85b2dd1 user: steveb tags: autosetup | |
2013-03-27
| ||
23:13 | Make the intent of the code in commit_warning() clearer. Style cleanup. check-in: 3f78dfe593 user: mistachkin tags: trunk | |
20:53 | Update the built-in SQLite sources to the latest 3.7.16.1 beta for the purpose of testing SQLite. check-in: 2e9be37f50 user: drh tags: trunk | |
Changes to src/main.c.
︙ | ︙ | |||
95 96 97 98 99 100 101 | ** definition has been copied from and should be kept in sync with the one in ** "th_tcl.c". */ struct TclContext { int argc; /* Number of original (expanded) arguments. */ char **argv; /* Full copy of the original (expanded) arguments. */ void *library; /* The Tcl library module handle. */ | < | | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | ** definition has been copied from and should be kept in sync with the one in ** "th_tcl.c". */ struct TclContext { int argc; /* Number of original (expanded) arguments. */ char **argv; /* Full copy of the original (expanded) arguments. */ void *library; /* The Tcl library module handle. */ void *xInitSubsystems; /* See tcl_InitSubsystemsProc in th_tcl.c. */ Tcl_Interp *interp; /* The on-demand created Tcl interpreter. */ char *setup; /* The optional Tcl setup script. */ void *xPreEval; /* Optional, called before Tcl_Eval*(). */ void *pPreContext; /* Optional, provided to xPreEval(). */ void *xPostEval; /* Optional, called after Tcl_Eval*(). */ void *pPostContext; /* Optional, provided to xPostEval(). */ }; |
︙ | ︙ |
Changes to src/th_tcl.c.
︙ | ︙ | |||
111 112 113 114 115 116 117 | # define TCL_LIBRARY_NAME "libtcl8.6.so\0" # endif # ifndef TCL_MINOR_OFFSET # define TCL_MINOR_OFFSET (8) # endif # endif /* defined(__CYGWIN__) */ # endif /* defined(_WIN32) */ | < < < | | | < | | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | # define TCL_LIBRARY_NAME "libtcl8.6.so\0" # endif # ifndef TCL_MINOR_OFFSET # define TCL_MINOR_OFFSET (8) # endif # endif /* defined(__CYGWIN__) */ # endif /* defined(_WIN32) */ # ifndef TCL_INITSUBSYSTEMS_NAME # define TCL_INITSUBSYSTEMS_NAME "_Tcl_InitSubsystems" # endif #endif /* defined(USE_TCL_STUBS) */ /* ** The function types for Tcl_InitSubsystems are needed ** when the Tcl library is being loaded dynamically by a stubs-enabled ** application (i.e. the inverse of using a stubs-enabled package). These are ** the only Tcl API functions that MUST be called prior to being able to call ** Tcl_InitStubs (i.e. because it requires a Tcl interpreter). */ typedef Tcl_Interp *(tcl_InitSubsystemsProc) (int flags, ...); /* ** The function types for the "hook" functions to be called before and after a ** TH1 command makes a call to evaluate a Tcl script. If the "pre" function ** returns anything but TH_OK, then evaluation of the Tcl script is skipped and ** that value is used as the return code. If the "post" function returns ** anything other than its rc argument, that will become the new return code |
︙ | ︙ | |||
185 186 187 188 189 190 191 | ** Tcl context information used by TH1. This structure definition has been ** copied from and should be kept in sync with the one in "main.c". */ struct TclContext { int argc; /* Number of original arguments. */ char **argv; /* Full copy of the original arguments. */ void *library; /* The Tcl library module handle. */ | | < | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | ** Tcl context information used by TH1. This structure definition has been ** copied from and should be kept in sync with the one in "main.c". */ struct TclContext { int argc; /* Number of original arguments. */ char **argv; /* Full copy of the original arguments. */ void *library; /* The Tcl library module handle. */ tcl_InitSubsystemsProc *xInitSubsystems; /* Tcl_FindExecutable() pointer. */ Tcl_Interp *interp; /* The on-demand created Tcl interpreter. */ char *setup; /* The optional Tcl setup script. */ tcl_NotifyProc *xPreEval; /* Optional, called before Tcl_Eval*(). */ void *pPreContext; /* Optional, provided to xPreEval(). */ tcl_NotifyProc *xPostEval; /* Optional, called after Tcl_Eval*(). */ void *pPostContext; /* Optional, provided to xPostEval(). */ }; |
︙ | ︙ | |||
523 524 525 526 527 528 529 | ** interpreter and initialize the stubs mechanism; otherwise, simply setup ** the function pointers provided by the caller with the statically linked ** functions. */ static int loadTcl( Th_Interp *interp, void **pLibrary, | < | | < | | < < < < < < < < < < < | | | | | < | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < | < < < < < < < | 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 | ** interpreter and initialize the stubs mechanism; otherwise, simply setup ** the function pointers provided by the caller with the statically linked ** functions. */ static int loadTcl( Th_Interp *interp, void **pLibrary, tcl_InitSubsystemsProc **pxInitSubsystems ){ #if defined(USE_TCL_STUBS) char fileName[] = TCL_LIBRARY_NAME; #endif if( !pLibrary || !pxInitSubsystems ){ Th_ErrorMessage(interp, "invalid Tcl loader argument(s)", (const char *)"", 0); return TH_ERROR; } #if defined(USE_TCL_STUBS) do { void *library = dlopen(fileName, RTLD_NOW | RTLD_GLOBAL); if( library ){ tcl_InitSubsystemsProc *xInitSubsystems; const char *procName = TCL_INITSUBSYSTEMS_NAME; xInitSubsystems = (tcl_InitSubsystemsProc *)dlsym(library, procName + 1); if( !xInitSubsystems ){ xInitSubsystems = (tcl_InitSubsystemsProc *)dlsym(library, procName); } if( !xInitSubsystems ){ Th_ErrorMessage(interp, "could not locate Tcl_InitSubsystems", (const char *)"", 0); dlclose(library); return TH_ERROR; } *pLibrary = library; *pxInitSubsystems = xInitSubsystems; return TH_OK; } } while( --fileName[TCL_MINOR_OFFSET]>'3' ); /* Tcl 8.4+ */ Th_ErrorMessage(interp, "could not load Tcl shared library \"" TCL_LIBRARY_NAME "\"", (const char *)"", 0); return TH_ERROR; #else *pLibrary = 0; *pxInitSubsystems = Tcl_InitSubsystems; return TH_OK; #endif } /* ** Creates and initializes a Tcl interpreter for use with the specified TH1 ** interpreter. Stores the created Tcl interpreter in the Tcl context supplied ** by the caller. */ static int createTclInterp( Th_Interp *interp, void *pContext ){ struct TclContext *tclContext = (struct TclContext *)pContext; int argc; char **argv; Tcl_Interp *tclInterp; char *setup; if ( !tclContext ){ Th_ErrorMessage(interp, "invalid Tcl context", (const char *)"", 0); return TH_ERROR; } if ( tclContext->interp ){ return TH_OK; } if( loadTcl(interp, &tclContext->library, &tclContext->xInitSubsystems)!=TH_OK ){ return TH_ERROR; } argc = tclContext->argc; argv = tclContext->argv; tclInterp = tclContext->xInitSubsystems(TCL_INIT_CREATE_UTF8, argc, argv); if( !tclInterp || #if defined(USE_TCL_STUBS) !Tcl_InitStubs(tclInterp, "8.4", 0) || #endif Tcl_InterpDeleted(tclInterp) ){ Th_ErrorMessage(interp, "could not create Tcl interpreter", (const char *)"", 0); return TH_ERROR; } tclContext->interp = tclInterp; if( Tcl_Init(tclInterp)!=TCL_OK ){ Th_ErrorMessage(interp, "Tcl initialization error:", Tcl_GetStringResult(tclInterp), -1); Tcl_DeleteInterp(tclInterp); tclContext->interp = tclInterp = 0; return TH_ERROR; } /* Add the TH1 integration commands to Tcl. */ Tcl_CallWhenDeleted(tclInterp, Th1DeleteProc, interp); Tcl_CreateObjCommand(tclInterp, "th1Eval", Th1EvalObjCmd, interp, NULL); Tcl_CreateObjCommand(tclInterp, "th1Expr", Th1ExprObjCmd, interp, NULL); |
︙ | ︙ |