diff options
Diffstat (limited to 'unix/tclLoadAix.c')
-rw-r--r-- | unix/tclLoadAix.c | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/unix/tclLoadAix.c b/unix/tclLoadAix.c index 4336663..88e6b50 100644 --- a/unix/tclLoadAix.c +++ b/unix/tclLoadAix.c @@ -1,4 +1,4 @@ -/* +/* * tclLoadAix.c -- * * This file implements the dlopen and dlsym APIs under the AIX operating @@ -17,8 +17,6 @@ * for any results of using the software, alterations are clearly marked * as such, and this notice is not modified. * - * RCS: @(#) $Id: tclLoadAix.c,v 1.4 2005/07/19 13:37:18 dkf Exp $ - * * Note: this file has been altered from the original in a few ways in order * to work properly with Tcl. */ @@ -95,8 +93,10 @@ static int readExports(ModulePtr); static void terminate(void); static void *findMain(void); -VOID * -dlopen(const char *path, int mode) +void * +dlopen( + const char *path, + int mode) { register ModulePtr mp; static void *mainModule; @@ -122,7 +122,7 @@ dlopen(const char *path, int mode) for (mp = modList; mp; mp = mp->next) { if (strcmp(mp->name, path) == 0) { mp->refCnt++; - return (VOID *) mp; + return (void *) mp; } } @@ -131,7 +131,7 @@ dlopen(const char *path, int mode) errvalid++; strcpy(errbuf, "calloc: "); strcat(errbuf, strerror(errno)); - return (VOID *) NULL; + return NULL; } mp->name = malloc((unsigned) (strlen(path) + 1)); @@ -169,7 +169,7 @@ dlopen(const char *path, int mode) } else { strcat(errbuf, strerror(errno)); } - return (VOID *) NULL; + return NULL; } mp->refCnt = 1; @@ -182,7 +182,7 @@ dlopen(const char *path, int mode) errvalid++; strcpy(errbuf, "loadbind: "); strcat(errbuf, strerror(errno)); - return (VOID *) NULL; + return NULL; } /* @@ -202,7 +202,7 @@ dlopen(const char *path, int mode) if (readExports(mp) == -1) { dlclose(mp); - return (VOID *) NULL; + return NULL; } /* @@ -211,7 +211,7 @@ dlopen(const char *path, int mode) if (mp->info = (struct dl_info *)dlsym(mp, "dl_info")) { if (mp->info->init) { - (*mp->info->init)(); + mp->info->init(); } } else { errvalid = 0; @@ -224,14 +224,14 @@ dlopen(const char *path, int mode) if (mp->cdtors = (CdtorPtr) dlsym(mp, "__cdtors")) { while (mp->cdtors->init) { - (*mp->cdtors->init)(); + mp->cdtors->init(); mp->cdtors++; } } else { errvalid = 0; } - return (VOID *) mp; + return (void *) mp; } /* @@ -240,7 +240,8 @@ dlopen(const char *path, int mode) */ static void -caterr(char *s) +caterr( + char *s) { register char *p = s; @@ -276,8 +277,10 @@ caterr(char *s) } } -VOID * -dlsym(void *handle, const char *symbol) +void * +dlsym( + void *handle, + const char *symbol) { register ModulePtr mp = (ModulePtr)handle; register ExportPtr ep; @@ -311,7 +314,8 @@ dlerror(void) } int -dlclose(void *handle) +dlclose( + void *handle) { register ModulePtr mp = (ModulePtr)handle; int result; @@ -322,12 +326,12 @@ dlclose(void *handle) } if (mp->info && mp->info->fini) { - (*mp->info->fini)(); + mp->info->fini(); } if (mp->cdtors) { while (mp->cdtors->term) { - (*mp->cdtors->term)(); + mp->cdtors->term(); mp->cdtors++; } } @@ -378,7 +382,8 @@ terminate(void) */ static int -readExports(ModulePtr mp) +readExports( + ModulePtr mp) { LDFILE *ldp = NULL; SCNHDR sh, shdata; |