summaryrefslogtreecommitdiffstats
path: root/unix/tclLoadNext.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-08-06 07:59:01 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-08-06 07:59:01 (GMT)
commit276404432ecf07fa12997ae2aecf6cf8ef0f9714 (patch)
tree9726218d2767be111aba0feda74cd0ac220f4355 /unix/tclLoadNext.c
parent33bcb6e718ec30da522f10e0388743eafab975c7 (diff)
parent22298666ade7c7396ece86e2976309e955e9abd5 (diff)
downloadtcl-276404432ecf07fa12997ae2aecf6cf8ef0f9714.zip
tcl-276404432ecf07fa12997ae2aecf6cf8ef0f9714.tar.gz
tcl-276404432ecf07fa12997ae2aecf6cf8ef0f9714.tar.bz2
merge trunk
Diffstat (limited to 'unix/tclLoadNext.c')
-rw-r--r--unix/tclLoadNext.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/unix/tclLoadNext.c b/unix/tclLoadNext.c
index c74a29a..06df2db 100644
--- a/unix/tclLoadNext.c
+++ b/unix/tclLoadNext.c
@@ -16,10 +16,9 @@
/* Static procedures defined within this file */
-static void* FindSymbol(Tcl_Interp* interp, Tcl_LoadHandle loadHandle,
- const char* symbol);
-static void UnloadFile(Tcl_LoadHandle loadHandle);
-
+static void * FindSymbol(Tcl_Interp *interp,
+ Tcl_LoadHandle loadHandle, const char* symbol);
+static void UnloadFile(Tcl_LoadHandle loadHandle);
/*
*----------------------------------------------------------------------
@@ -93,15 +92,15 @@ TclpDlopen(
char *data;
int len, maxlen;
- NXGetMemoryBuffer(errorStream,&data,&len,&maxlen);
- Tcl_AppendResult(interp, "couldn't load file \"", fileName, "\": ",
- data, NULL);
+ NXGetMemoryBuffer(errorStream, &data, &len, &maxlen);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "couldn't load file \"%s\": %s", fileName, data));
NXCloseMemory(errorStream, NX_FREEBUFFER);
return TCL_ERROR;
}
NXCloseMemory(errorStream, NX_FREEBUFFER);
- newHandle = ckalloc(sizeof(*newHandle));
+ newHandle = ckalloc(sizeof(Tcl_LoadHandle));
newHandle->clientData = INT2PTR(1);
newHandle->findSymbolProcPtr = &FindSymbol;
newHandle->unloadFileProcPtr = &UnloadFile;
@@ -127,25 +126,25 @@ TclpDlopen(
*----------------------------------------------------------------------
*/
-static void*
+static void *
FindSymbol(
Tcl_Interp *interp,
Tcl_LoadHandle loadHandle,
const char *symbol)
{
Tcl_PackageInitProc *proc = NULL;
- if (symbol) {
+
+ if (symbol) {
char sym[strlen(symbol) + 2];
sym[0] = '_';
sym[1] = 0;
strcat(sym, symbol);
- rld_lookup(NULL, sym, (unsigned long *)&proc);
+ rld_lookup(NULL, sym, (unsigned long *) &proc);
}
if (proc == NULL && interp != NULL) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "cannot find symbol \"", symbol,
- "\"", NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "cannot find symbol \"%s\"", symbol));
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, NULL);
}
return proc;