diff options
Diffstat (limited to 'unix/tclLoadDyld.c')
-rw-r--r-- | unix/tclLoadDyld.c | 73 |
1 files changed, 37 insertions, 36 deletions
diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c index 3c1fc82..b963e43 100644 --- a/unix/tclLoadDyld.c +++ b/unix/tclLoadDyld.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclLoadDyld.c,v 1.19 2005/07/30 07:57:48 das Exp $ + * RCS: @(#) $Id: tclLoadDyld.c,v 1.20 2005/11/11 23:46:34 dkf Exp $ */ #include "tclInt.h" @@ -93,14 +93,14 @@ DyldOFIErrorMsg(int err) { */ MODULE_SCOPE int -TclpDlopen(interp, pathPtr, loadHandle, unloadProcPtr) - Tcl_Interp *interp; /* Used for error reporting. */ - Tcl_Obj *pathPtr; /* Name of the file containing the desired +TclpDlopen( + Tcl_Interp *interp, /* Used for error reporting. */ + Tcl_Obj *pathPtr, /* Name of the file containing the desired * code (UTF-8). */ - Tcl_LoadHandle *loadHandle; /* Filled with token for dynamically loaded + Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded * file which will be passed back to * (*unloadProcPtr)() to unload the file. */ - Tcl_FSUnloadFileProc **unloadProcPtr; + Tcl_FSUnloadFileProc **unloadProcPtr) /* Filled with address of Tcl_FSUnloadFileProc * function which should be used for this * file. */ @@ -146,7 +146,8 @@ TclpDlopen(interp, pathPtr, loadHandle, unloadProcPtr) if (!dyldLibHeader) { NSLinkEditError(&editError, &errorNumber, &name, &msg); } - } else if ((editError==NSLinkEditFileFormatError && errorNumber==EBADMACHO) + } else if ((editError==NSLinkEditFileFormatError + && errorNumber==EBADMACHO) || editError == NSLinkEditOtherError){ /* * The requested file was found but was not of type MH_DYLIB, @@ -159,14 +160,14 @@ TclpDlopen(interp, pathPtr, loadHandle, unloadProcPtr) } if (!dyldLibHeader && !dyldObjFileImage) { - Tcl_AppendResult(interp, msg, (char *) NULL); + Tcl_AppendResult(interp, msg, NULL); if (msg && *msg) { - Tcl_AppendResult(interp, "\n", (char *) NULL); + Tcl_AppendResult(interp, "\n", NULL); } if (objFileImageErrMsg) { Tcl_AppendResult(interp, "NSCreateObjectFileImageFromFile() error: ", - objFileImageErrMsg, (char *) NULL); + objFileImageErrMsg, NULL); } return TCL_ERROR; } @@ -186,7 +187,7 @@ TclpDlopen(interp, pathPtr, loadHandle, unloadProcPtr) CONST char *name, *msg; NSLinkEditError(&editError, &errorNumber, &name, &msg); - Tcl_AppendResult(interp, msg, (char *) NULL); + Tcl_AppendResult(interp, msg, NULL); return TCL_ERROR; } @@ -221,16 +222,16 @@ TclpDlopen(interp, pathPtr, loadHandle, unloadProcPtr) *---------------------------------------------------------------------- */ -MODULE_SCOPE Tcl_PackageInitProc* -TclpFindSymbol(interp, loadHandle, symbol) - Tcl_Interp *interp; /* For error reporting. */ - Tcl_LoadHandle loadHandle; /* Handle from TclpDlopen. */ - CONST char *symbol; /* Symbol name to look up. */ +MODULE_SCOPE Tcl_PackageInitProc * +TclpFindSymbol( + Tcl_Interp *interp, /* For error reporting. */ + Tcl_LoadHandle loadHandle, /* Handle from TclpDlopen. */ + CONST char *symbol) /* Symbol name to look up. */ { NSSymbol nsSymbol; CONST char *native; Tcl_DString newName, ds; - Tcl_PackageInitProc* proc = NULL; + Tcl_PackageInitProc *proc = NULL; Tcl_DyldLoadHandle *dyldLoadHandle = (Tcl_DyldLoadHandle *) loadHandle; /* @@ -277,7 +278,7 @@ TclpFindSymbol(interp, loadHandle, symbol) CONST char *name, *msg; NSLinkEditError(&editError, &errorNumber, &name, &msg); - Tcl_AppendResult(interp, msg, (char *) NULL); + Tcl_AppendResult(interp, msg, NULL); } } else { nsSymbol = NSLookupSymbolInModule(dyldLoadHandle->modulePtr->module, @@ -313,8 +314,8 @@ TclpFindSymbol(interp, loadHandle, symbol) */ MODULE_SCOPE void -TclpUnloadFile(loadHandle) - Tcl_LoadHandle loadHandle; /* loadHandle returned by a previous call to +TclpUnloadFile( + Tcl_LoadHandle loadHandle) /* loadHandle returned by a previous call to * TclpDlopen(). The loadHandle is a token * that represents the loaded file. */ { @@ -354,10 +355,10 @@ TclpUnloadFile(loadHandle) */ MODULE_SCOPE int -TclGuessPackageName(fileName, bufPtr) - CONST char *fileName; /* Name of file containing package (already +TclGuessPackageName( + CONST char *fileName, /* Name of file containing package (already * translated to local form if needed). */ - Tcl_DString *bufPtr; /* Initialized empty dstring. Append package + Tcl_DString *bufPtr) /* Initialized empty dstring. Append package * name to this if possible. */ { return 0; @@ -380,10 +381,10 @@ TclGuessPackageName(fileName, bufPtr) *---------------------------------------------------------------------- */ -MODULE_SCOPE void* -TclpLoadMemoryGetBuffer(interp, size) - Tcl_Interp *interp; /* Used for error reporting. */ - int size; /* Size of desired buffer. */ +MODULE_SCOPE void * +TclpLoadMemoryGetBuffer( + Tcl_Interp *interp, /* Used for error reporting. */ + int size) /* Size of desired buffer. */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); void *buffer = NULL; @@ -434,18 +435,18 @@ TclpLoadMemoryGetBuffer(interp, size) */ MODULE_SCOPE int -TclpLoadMemory(interp, buffer, size, codeSize, loadHandle, unloadProcPtr) - Tcl_Interp *interp; /* Used for error reporting. */ - void *buffer; /* Buffer containing the desired code +TclpLoadMemory( + Tcl_Interp *interp, /* Used for error reporting. */ + void *buffer, /* Buffer containing the desired code * (allocated with TclpLoadMemoryGetBuffer). */ - int size; /* Allocation size of buffer. */ - int codeSize; /* Size of code data read into buffer or -1 if + int size, /* Allocation size of buffer. */ + int codeSize, /* Size of code data read into buffer or -1 if * an error occurred and the buffer should * just be freed. */ - Tcl_LoadHandle *loadHandle; /* Filled with token for dynamically loaded + Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded * file which will be passed back to * (*unloadProcPtr)() to unload the file. */ - Tcl_FSUnloadFileProc **unloadProcPtr; + Tcl_FSUnloadFileProc **unloadProcPtr) /* Filled with address of Tcl_FSUnloadFileProc * function which should be used for this * file. */ @@ -490,7 +491,7 @@ TclpLoadMemory(interp, buffer, size, codeSize, loadHandle, unloadProcPtr) if (objFileImageErrMsg != NULL) { Tcl_AppendResult(interp, "NSCreateObjectFileImageFromFile() error: ", - objFileImageErrMsg, (char *) NULL); + objFileImageErrMsg, NULL); } return TCL_ERROR; } @@ -509,7 +510,7 @@ TclpLoadMemory(interp, buffer, size, codeSize, loadHandle, unloadProcPtr) CONST char *name, *msg; NSLinkEditError(&editError, &errorNumber, &name, &msg); - Tcl_AppendResult(interp, msg, (char *) NULL); + Tcl_AppendResult(interp, msg, NULL); return TCL_ERROR; } |