summaryrefslogtreecommitdiffstats
path: root/unix/tclLoadNext.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2002-07-17 20:00:44 (GMT)
committervincentdarley <vincentdarley>2002-07-17 20:00:44 (GMT)
commit7074d76f2ba74ea9a53f47fb4815145982285625 (patch)
tree7bf708f2c17514ad40291886268bc3cf73d95ddc /unix/tclLoadNext.c
parent5625494c13f92f83294785e3691a89450f40c21a (diff)
downloadtcl-7074d76f2ba74ea9a53f47fb4815145982285625.zip
tcl-7074d76f2ba74ea9a53f47fb4815145982285625.tar.gz
tcl-7074d76f2ba74ea9a53f47fb4815145982285625.tar.bz2
load internals refactoring
Diffstat (limited to 'unix/tclLoadNext.c')
-rw-r--r--unix/tclLoadNext.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/unix/tclLoadNext.c b/unix/tclLoadNext.c
index d19b22e..cb09d38 100644
--- a/unix/tclLoadNext.c
+++ b/unix/tclLoadNext.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclLoadNext.c,v 1.7 2002/01/09 19:09:28 kennykb Exp $
+ * RCS: @(#) $Id: tclLoadNext.c,v 1.8 2002/07/17 20:00:46 vincentdarley Exp $
*/
#include "tclInt.h"
@@ -39,17 +39,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;
@@ -72,25 +66,27 @@ TclpLoadFile(interp, pathPtr, sym1, sym2, proc1Ptr, proc2Ptr,
}
NXCloseMemory(errorStream,NX_FREEBUFFER);
- *proc1Ptr=NULL;
- if(sym1) {
- char sym[strlen(sym1)+2];
- sym[0]='_'; sym[1]=0; strcat(sym,sym1);
- rld_lookup(NULL,sym,(unsigned long *)proc1Ptr);
- }
-
- *proc2Ptr=NULL;
- if(sym2) {
- char sym[strlen(sym2)+2];
- sym[0]='_'; sym[1]=0; strcat(sym,sym2);
- rld_lookup(NULL,sym,(unsigned long *)proc2Ptr);
- }
- *clientDataPtr = NULL;
+ *loadHandle = (TclLoadHandle)1; /* A dummy non-NULL value */
*unloadProcPtr = &TclpUnloadFile;
return TCL_OK;
}
+Tcl_PackageInitProc*
+TclpFindSymbol(interp, loadHandle, symbol)
+ Tcl_Interp *interp;
+ TclLoadHandle loadHandle;
+ CONST char *symbol;
+{
+ Tcl_PackageInitProc *proc=NULL;
+ if(symbol) {
+ char sym[strlen(symbol)+2];
+ sym[0]='_'; sym[1]=0; strcat(sym,symbol);
+ rld_lookup(NULL,sym,(unsigned long *)&proc);
+ }
+ return proc;
+}
+
/*
*----------------------------------------------------------------------
*