diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-08-04 13:04:41 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-08-04 13:04:41 (GMT) |
commit | 911e356870519d1379c9246402fcfdd3076c484c (patch) | |
tree | 5461b99cb700bf228c1f2b4c16f4b7dbfa8c453d /unix/tclLoadNext.c | |
parent | c1c198bb1f699e668cb78c2bf0275ceb6eb25435 (diff) | |
download | tcl-911e356870519d1379c9246402fcfdd3076c484c.zip tcl-911e356870519d1379c9246402fcfdd3076c484c.tar.gz tcl-911e356870519d1379c9246402fcfdd3076c484c.tar.bz2 |
more result generation conversion
Diffstat (limited to 'unix/tclLoadNext.c')
-rw-r--r-- | unix/tclLoadNext.c | 27 |
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; |