diff options
author | vincentdarley <vincentdarley@noemail.net> | 2002-07-17 20:00:44 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley@noemail.net> | 2002-07-17 20:00:44 (GMT) |
commit | 8da9f5e952e536d074667c8c6e48da85176f0811 (patch) | |
tree | 7bf708f2c17514ad40291886268bc3cf73d95ddc /unix/tclLoadOSF.c | |
parent | bb4c26c9c7f06f9cf4dfa26d3f12d647336e6162 (diff) | |
download | tcl-8da9f5e952e536d074667c8c6e48da85176f0811.zip tcl-8da9f5e952e536d074667c8c6e48da85176f0811.tar.gz tcl-8da9f5e952e536d074667c8c6e48da85176f0811.tar.bz2 |
load internals refactoring
FossilOrigin-Name: bbffcec48d3efc0e02e13b0bbdcdb98281bf431f
Diffstat (limited to 'unix/tclLoadOSF.c')
-rw-r--r-- | unix/tclLoadOSF.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/unix/tclLoadOSF.c b/unix/tclLoadOSF.c index 76c0c7c..8740feb 100644 --- a/unix/tclLoadOSF.c +++ b/unix/tclLoadOSF.c @@ -31,7 +31,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclLoadOSF.c,v 1.7 2002/01/09 19:09:28 kennykb Exp $ + * RCS: @(#) $Id: tclLoadOSF.c,v 1.8 2002/07/17 20:00:46 vincentdarley Exp $ */ #include "tclInt.h" @@ -60,17 +60,11 @@ */ int -TclpLoadFile(interp, pathPtr, sym1, sym2, proc1Ptr, proc2Ptr, - clientDataPtr, unloadProcPtr) +TclpDlopen(interp, pathPtr, loadHandle, unloadProcPtr) Tcl_Interp *interp; /* Used for error reporting. */ Tcl_Obj *pathPtr; /* Name of the file containing the desired - * code. */ - CONST char *sym1, *sym2; /* Names of two procedures to look up in - * the file's symbol table. */ - Tcl_PackageInitProc **proc1Ptr, **proc2Ptr; - /* Where to return the addresses corresponding - * to sym1 and sym2. */ - ClientData *clientDataPtr; /* Filled with token for dynamically loaded + * code (UTF-8). */ + TclLoadHandle *loadHandle; /* Filled with token for dynamically loaded * file which will be passed back to * (*unloadProcPtr)() to unload the file. */ Tcl_FSUnloadFileProc **unloadProcPtr; @@ -99,16 +93,25 @@ TclpLoadFile(interp, pathPtr, sym1, sym2, proc1Ptr, proc2Ptr, * I build loadable modules with a makefile rule like * ld ... -export $@: -o $@ $(OBJS) */ - if ((pkg = strrchr(fileName, '/')) == NULL) - pkg = fileName; - else + if ((pkg = strrchr(fileName, '/')) == NULL) { + pkg = fileName; + } else { pkg++; - *proc1Ptr = ldr_lookup_package(pkg, sym1); - *proc2Ptr = ldr_lookup_package(pkg, sym2); + } + *loadHandle = pkg; *unloadProcPtr = &TclpUnloadFile; return TCL_OK; } +Tcl_PackageInitProc* +TclpFindSymbol(interp, loadHandle, symbol) + Tcl_Interp *interp; + TclLoadHandle loadHandle; + CONST char *symbol; +{ + return ldr_lookup_package((char *)loadHandle, symbol); +} + /* *---------------------------------------------------------------------- * |