Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13298
Modified Files: Tag: desiredata desire.c m_class.c m_pd.h s_stuff.h s_loader.c s_path.c Log Message: loader from pd 0.40
Index: s_loader.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_loader.c,v retrieving revision 1.4.4.5.2.10 retrieving revision 1.4.4.5.2.10.2.1 diff -C2 -d -r1.4.4.5.2.10 -r1.4.4.5.2.10.2.1 *** s_loader.c 10 Aug 2006 00:33:09 -0000 1.4.4.5.2.10 --- s_loader.c 20 Dec 2006 04:01:33 -0000 1.4.4.5.2.10.2.1 *************** *** 3,13 **** * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
- #ifdef __APPLE__ - #include <AvailabilityMacros.h> - #if !defined(DL_OPEN) && defined(MAC_OS_X_VERSION_10_3) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 - #define DL_OPEN - #endif - #endif - #ifdef DL_OPEN #include <dlfcn.h> --- 3,6 ---- *************** *** 21,25 **** #include <windows.h> #endif ! #if defined(__APPLE__) && !defined(DL_OPEN) #include <mach-o/dyld.h> #endif --- 14,18 ---- #include <windows.h> #endif ! #ifdef __APPLE__ #include <mach-o/dyld.h> #endif *************** *** 31,117 **** typedef void (*t_xxx)(void);
! static char sys_dllextent[] = #ifdef __FreeBSD__ ! ".pd_freebsd"; #endif ! #ifdef IRIX ! #ifdef N32 ! ".pd_irix6"; #else ! ".pd_irix5"; ! #endif #endif - #ifdef __linux__ - ".pd_linux"; #endif #ifdef __APPLE__ ! ".pd_darwin"; #endif - #if defined(MSW) || defined(__CYGWIN__) - ".dll"; #endif
void class_set_extern_dir(t_symbol *s);
! static int sys_load_lib_alt(char *dirname, char *classname, char *altname) { char symname[MAXPDSTRING], filename[MAXPDSTRING], dirbuf[MAXPDSTRING], ! classname2[MAXPDSTRING], *nameptr, *lastdot, ! altsymname[MAXPDSTRING]; void *dlobj; t_xxx makeout = NULL; ! int fd; #ifdef MSW HINSTANCE ntdll; #endif ! #if 0 ! fprintf(stderr, "lib %s %s\n", dirname, classname); ! #endif ! /* try looking in the path for (classname).(sys_dllextent) ... */ ! if ((fd = open_via_path(dirname, classname, sys_dllextent, ! dirbuf, &nameptr, MAXPDSTRING, 1)) < 0) { ! /* next try (classname)/(classname).(sys_dllextent) ... */ ! strncpy(classname2, classname, MAXPDSTRING); ! filename[MAXPDSTRING-2] = 0; ! strcat(classname2, "/"); ! strncat(classname2, classname, MAXPDSTRING-strlen(classname2)); ! filename[MAXPDSTRING-1] = 0; ! if ((fd = open_via_path(dirname, classname2, sys_dllextent, ! dirbuf, &nameptr, MAXPDSTRING, 1)) < 0) { ! /* next try (alternative_classname).(sys_dllextent) */ ! if(altname) ! { ! if ((fd = open_via_path(dirname, altname, sys_dllextent, ! dirbuf, &nameptr, MAXPDSTRING, 1)) < 0) ! { ! ! /* next try (alternative_classname)/(alternative_classname).(sys_dllextent) ... */ ! strncpy(classname2, altname, MAXPDSTRING); ! filename[MAXPDSTRING-2] = 0; ! strcat(classname2, "/"); ! strncat(classname2, altname, MAXPDSTRING-strlen(classname2)); ! filename[MAXPDSTRING-1] = 0; ! if ((fd = open_via_path(dirname, classname2, sys_dllextent, ! dirbuf, &nameptr, MAXPDSTRING, 1)) < 0) ! { ! return 0; ! } ! } ! } ! else ! return (0); } } ! ! #ifdef QUALIFIED_NAME ! pd_set_library_name(nameptr); #endif ! close(fd); class_set_extern_dir(gensym(dirbuf));
! /* refabricate the pathname */ strncpy(filename, dirbuf, MAXPDSTRING); filename[MAXPDSTRING-2] = 0; --- 24,162 ---- typedef void (*t_xxx)(void);
! /* naming convention for externs. The names are kept distinct for those ! who wich to make "fat" externs compiled for many platforms. Less specific ! fallbacks are provided, primarily for back-compatibility; these suffice if ! you are building a package which will run with a single set of compiled ! objects. The specific name is the letter b, l, d, or m for BSD, linux, ! darwin, or microsoft, followed by a more specific string, either "fat" for ! a fat binary or an indication of the instruction set. */ ! #ifdef __FreeBSD__ ! static char sys_dllextent[] = ".b_i386", sys_dllextent2[] = ".pd_freebsd"; #endif ! #ifdef __linux__ ! #ifdef __ia64__ ! static char sys_dllextent[] = ".l_ia64", sys_dllextent2[] = ".pd_linux"; #else ! static char sys_dllextent[] = ".l_i386", sys_dllextent2[] = ".pd_linux"; #endif #endif #ifdef __APPLE__ ! #ifndef MACOSX3 ! static char sys_dllextent[] = ".d_fat", sys_dllextent2[] = ".pd_darwin"; ! #else ! static char sys_dllextent[] = ".d_ppc", sys_dllextent2[] = ".pd_darwin"; #endif #endif + #ifdef MSW + static char sys_dllextent[] = ".m_i386", sys_dllextent2[] = ".dll"; + #endif + + /* maintain list of loaded modules to avoid repeating loads */ + typedef struct _loadedlist + { + struct _loadedlist *ll_next; + t_symbol *ll_name; + } t_loadlist; + + static t_loadlist *sys_loaded; + int sys_onloadlist(char *classname) /* return true if already loaded */ + { + t_symbol *s = gensym(classname); + t_loadlist *ll; + for (ll = sys_loaded; ll; ll = ll->ll_next) + if (ll->ll_name == s) + return (1); + return (0); + } + + void sys_putonloadlist(char *classname) /* add to list of loaded modules */ + { + t_loadlist *ll = (t_loadlist *)getbytes(sizeof(*ll)); + ll->ll_name = gensym(classname); + ll->ll_next = sys_loaded; + sys_loaded = ll; + /* post("put on list %s", classname); */ + }
void class_set_extern_dir(t_symbol *s);
! static int sys_do_load_lib(t_canvas *canvas, char *objectname) { char symname[MAXPDSTRING], filename[MAXPDSTRING], dirbuf[MAXPDSTRING], ! *classname, *nameptr, altsymname[MAXPDSTRING]; void *dlobj; t_xxx makeout = NULL; ! int i, hexmunge = 0, fd; #ifdef MSW HINSTANCE ntdll; #endif ! if (classname = strrchr(objectname, '/')) ! classname++; ! else classname = objectname; ! if (sys_onloadlist(objectname)) { ! post("%s: already loaded", objectname); ! return (1); ! } ! for (i = 0, nameptr = classname; i < MAXPDSTRING-7 && *nameptr; nameptr++) ! { ! char c = *nameptr; ! if ((c>='0' && c<='9') || (c>='A' && c<='Z')|| ! (c>='a' && c<='z' )|| c == '_') { ! symname[i] = c; ! i++; ! } ! /* trailing tilde becomes "_tilde" */ ! else if (c == '~' && nameptr[1] == 0) ! { ! strcpy(symname+i, "_tilde"); ! i += strlen(symname+i); ! } ! else /* anything you can't put in a C symbol is sprintf'ed in hex */ ! { ! sprintf(symname+i, "0x%02x", c); ! i += strlen(symname+i); ! hexmunge = 1; } } ! symname[i] = 0; ! if (hexmunge) ! { ! memmove(symname+6, symname, strlen(symname+1)); ! strncpy(symname, "setup_", 6); ! } ! else strcat(symname, "_setup"); ! ! #if 0 ! fprintf(stderr, "lib: %s\n", classname); #endif ! /* try looking in the path for (objectname).(sys_dllextent) ... */ ! if ((fd = canvas_open(canvas, objectname, sys_dllextent, ! dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0) ! goto gotone; ! /* same, with the more generic sys_dllextent2 */ ! if ((fd = canvas_open(canvas, objectname, sys_dllextent2, ! dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0) ! goto gotone; ! /* next try (objectname)/(classname).(sys_dllextent) ... */ ! strncpy(filename, objectname, MAXPDSTRING); ! filename[MAXPDSTRING-2] = 0; ! strcat(filename, "/"); ! strncat(filename, classname, MAXPDSTRING-strlen(filename)); ! filename[MAXPDSTRING-1] = 0; ! if ((fd = canvas_open(canvas, filename, sys_dllextent, ! dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0) ! goto gotone; ! if ((fd = canvas_open(canvas, filename, sys_dllextent2, ! dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0) ! goto gotone; ! return (0); ! gotone: close(fd); class_set_extern_dir(gensym(dirbuf));
! /* rebuild the absolute pathname */ strncpy(filename, dirbuf, MAXPDSTRING); filename[MAXPDSTRING-2] = 0; *************** *** 119,148 **** strncat(filename, nameptr, MAXPDSTRING-strlen(filename)); filename[MAXPDSTRING-1] = 0; - /* extract the setup function name */ - if (lastdot = strrchr(nameptr, '.')) - *lastdot = 0;
- #if defined(__APPLE__) && !defined(DL_OPEN) - strcpy(symname, "_"); - strcat(symname, nameptr); - if(altname) - { - strcpy(altsymname, "_setup_"); - strcat(symname, altname); - } - #else - strcpy(symname, nameptr); - if(altname) - { - strcpy(altsymname, "setup_"); - strcat(altsymname, altname); - } - #endif - - /* if the last character is a tilde, replace with "_tilde" */ - if (symname[strlen(symname) - 1] == '~') - strcpy(symname + (strlen(symname) - 1), "_tilde"); - /* and append _setup to form the C setup function name */ - strcat(symname, "_setup"); #ifdef DL_OPEN dlobj = dlopen(filename, RTLD_NOW | RTLD_GLOBAL); --- 164,168 ---- *************** *** 154,159 **** } makeout = (t_xxx)dlsym(dlobj, symname); ! if(!makeout)makeout = (t_xxx)dlsym(dlobj, altsymname); ! #elif defined(MSW) sys_bashfilename(filename, filename); ntdll = LoadLibrary(filename); --- 174,179 ---- } makeout = (t_xxx)dlsym(dlobj, symname); ! #endif ! #ifdef MSW sys_bashfilename(filename, filename); ntdll = LoadLibrary(filename); *************** *** 165,212 **** } makeout = (t_xxx)GetProcAddress(ntdll, symname); - if(!makeout)makeout = (t_xxx)GetProcAddress(ntdll, altsymname); - #elif defined(__APPLE__) && !defined(DL_OPEN) - { - NSObjectFileImage image; - void *ret; - NSSymbol s; - NSObjectFileImageReturnCode err = NSCreateObjectFileImageFromFile( filename, &image); - if(err != NSObjectFileImageSuccess ) - { - const char *errcode; - switch(err) - { - case NSObjectFileImageFailure: errcode = "failure"; break; - case NSObjectFileImageInappropriateFile: errcode = "inappropriate file"; break; - case NSObjectFileImageArch: errcode = "wrong arch"; break; - case NSObjectFileImageFormat: errcode = "wrong format"; break; - case NSObjectFileImageAccess: errcode = "access failure"; break; - default: errcode = "???"; - } - - post("%s: couldn't load (%s)", filename,errcode); - class_set_extern_dir(&s_); - return 0; - } - ret = NSLinkModule( image, filename, - NSLINKMODULE_OPTION_BINDNOW | - NSLINKMODULE_OPTION_RETURN_ON_ERROR); - - if (ret == NULL) { - int err; - const char *fname, *errt; - NSLinkEditErrors c; - NSLinkEditError(&c, &err, &fname, &errt); - post("link error %d %s %s", err, fname, errt); - return 0; - } - s = NSLookupSymbolInModule(ret, symname); - - if(!s)s=NSLookupSymbolInModule(ret, altsymname); - - if (s) - makeout = (t_xxx)NSAddressOfSymbol( s); - else makeout = 0; - } #endif
--- 185,188 ---- *************** *** 214,241 **** { post("load_object: Symbol "%s" not found", symname); - if(altname) - post("load_object: Symbol "%s" not found", altsymname); - class_set_extern_dir(&s_); - return 0; - } - #if _MSC_VER - __try { - #endif - (*makeout)(); - #if _MSC_VER - } - __except(EXCEPTION_EXECUTE_HANDLER) { - // EXCEPTION_POINTERS *ep = GetExceptionInformation(); - post("an exception occurred loading %s", classname); class_set_extern_dir(&s_); return 0; } ! #endif class_set_extern_dir(&s_); return (1); }
! //* callback type definition */ ! typedef int (*loader_t)(char *dirname, char *classname, char *altname);
/* linked list of loaders */ --- 190,204 ---- { post("load_object: Symbol "%s" not found", symname); class_set_extern_dir(&s_); return 0; } ! (*makeout)(); class_set_extern_dir(&s_); + sys_putonloadlist(objectname); return (1); }
! /* callback type definition */ ! typedef int (*loader_t)(t_canvas *canvas, char *classname);
/* linked list of loaders */ *************** *** 245,249 **** } loader_queue_t;
! static loader_queue_t loaders = {sys_load_lib_alt, NULL};
/* register class loader function */ --- 208,212 ---- } loader_queue_t;
! static loader_queue_t loaders = {sys_do_load_lib, NULL};
/* register class loader function */ *************** *** 265,270 **** }
! ! int sys_load_lib(char *dirname, char *classname, char *altname) { int dspstate = canvas_suspend_dsp(); --- 228,232 ---- }
! int sys_load_lib(t_canvas *canvas, char *classname) { int dspstate = canvas_suspend_dsp(); *************** *** 272,278 **** loader_queue_t *q; for(q = &loaders; q; q = q->next) ! if(ok = q->loader(dirname, classname, altname)) break; ! ! canvas_resume_dsp(dspstate); return ok; } --- 234,240 ---- loader_queue_t *q; for(q = &loaders; q; q = q->next) ! if (ok = q->loader(canvas, classname)) break; ! canvas_resume_dsp(dspstate); return ok; } +
Index: m_class.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_class.c,v retrieving revision 1.3.4.7.2.22.2.11 retrieving revision 1.3.4.7.2.22.2.12 diff -C2 -d -r1.3.4.7.2.22.2.11 -r1.3.4.7.2.22.2.12 *** m_class.c 20 Dec 2006 02:40:51 -0000 1.3.4.7.2.22.2.11 --- m_class.c 20 Dec 2006 04:01:33 -0000 1.3.4.7.2.22.2.12 *************** *** 490,518 **** { t_pd *current; - t_symbol *dir = canvas_getcurrentdir(); int fd; char dirbuf[MAXPDSTRING], *nameptr; ! char *altname=alternative_classname(s->s_name); ! if (tryingalready) ! { ! if (altname) ! freebytes(altname, sizeof(char)*MAXPDSTRING); ! return; ! } newest = 0; class_loadsym = s; ! if (sys_load_lib(dir->s_name, s->s_name, altname)) { tryingalready = 1; typedmess((t_pd *)dummy, s, argc, argv); tryingalready = 0; - if (altname) - freebytes(altname, sizeof(char)*MAXPDSTRING); return; } class_loadsym = 0; current = s__X.s_thing; ! if ((fd = open_via_path(dir->s_name, s->s_name, ".pd", dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0 || ! (fd = open_via_path(dir->s_name, s->s_name, ".pat", dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0) { close(fd); if (!pd_setloadingabstraction(s)) { --- 490,509 ---- { t_pd *current; int fd; char dirbuf[MAXPDSTRING], *nameptr; ! if (tryingalready) return; newest = 0; class_loadsym = s; ! if (sys_load_lib(canvas_getcurrent(), s->s_name)) { tryingalready = 1; typedmess((t_pd *)dummy, s, argc, argv); tryingalready = 0; return; } class_loadsym = 0; current = s__X.s_thing; ! if ((fd = canvas_open(canvas_getcurrent(), s->s_name, ".pd", dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0 || ! (fd = canvas_open(canvas_getcurrent(), s->s_name, ".pat", dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0) { close(fd); if (!pd_setloadingabstraction(s)) { *************** *** 526,531 **** } else newest = 0; - if (altname) - freebytes(altname, sizeof(char)*MAXPDSTRING); }
--- 517,520 ----
Index: s_path.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_path.c,v retrieving revision 1.3.4.6.2.8.2.4 retrieving revision 1.3.4.6.2.8.2.5 diff -C2 -d -r1.3.4.6.2.8.2.4 -r1.3.4.6.2.8.2.5 *** s_path.c 8 Dec 2006 04:48:00 -0000 1.3.4.6.2.8.2.4 --- s_path.c 20 Dec 2006 04:01:33 -0000 1.3.4.6.2.8.2.5 *************** *** 13,17 **** /* #define DEBUG(x) x */ #define DEBUG(x) - void readsf_banana( void); /* debugging */
#include <stdlib.h> --- 13,16 ---- *************** *** 170,173 **** --- 169,256 ---- #endif
+ /* try to open a file in the directory "dir", named "name""ext", + for reading. "Name" may have slashes. The directory is copied to + "dirresult" which must be at least "size" bytes. "nameresult" is set + to point to the filename (copied elsewhere into the same buffer). + The "bin" flag requests opening for binary (which only makes a difference + on Windows). */ + + int sys_trytoopenone(const char *dir, const char *name, const char* ext, + char *dirresult, char **nameresult, unsigned int size, int bin) + { + int fd; + if (strlen(dir) + strlen(name) + strlen(ext) + 4 > size) + return (-1); + strcpy(dirresult, dir); + if (*dirresult && dirresult[strlen(dirresult)-1] != '/') + strcat(dirresult, "/"); + strcat(dirresult, name); + strcat(dirresult, ext); + sys_bashfilename(dirresult, dirresult); + + DEBUG(post("looking for %s",dirresult)); + /* see if we can open the file for reading */ + if ((fd=open(dirresult,O_RDONLY | MSWOPENFLAG(bin))) >= 0) + { + /* in unix, further check that it's not a directory */ + #ifdef UNISTD + struct stat statbuf; + int ok = ((fstat(fd, &statbuf) >= 0) && + !S_ISDIR(statbuf.st_mode)); + if (!ok) + { + if (sys_verbose) post("tried %s; stat failed or directory", + dirresult); + close (fd); + fd = -1; + } + else + #endif + { + char *slash; + if (sys_verbose) post("tried %s and succeeded", dirresult); + sys_unbashfilename(dirresult, dirresult); + slash = strrchr(dirresult, '/'); + if (slash) + { + *slash = 0; + *nameresult = slash + 1; + } + else *nameresult = dirresult; + + return (fd); + } + } + else + { + if (sys_verbose) post("tried %s and failed", dirresult); + } + return (-1); + } + + /* check if we were given an absolute pathname, if so try to open it + and return 1 to signal the caller to cancel any path searches */ + int sys_open_absolute(const char *name, const char* ext, + char *dirresult, char **nameresult, unsigned int size, int bin, int *fdp) + { + if (name[0] == '/' + #ifdef MSW + || (name[1] == ':' && name[2] == '/') + #endif + ) + { + char dirbuf[MAXPDSTRING]; + int dirlen = (strrchr(name, '/') - name); + if (dirlen > MAXPDSTRING-1) + dirlen = MAXPDSTRING-1; + strncpy(dirbuf, name, dirlen); + dirbuf[dirlen] = 0; + *fdp = sys_trytoopenone(dirbuf, name+(dirlen+1), ext, + dirresult, nameresult, size, bin); + return (1); + } + else return (0); + } + /* search for a file in a specified directory, then along the globally defined search path, using ext as filename extension. Exception:
Index: s_stuff.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_stuff.h,v retrieving revision 1.5.4.10.2.8.2.5 retrieving revision 1.5.4.10.2.8.2.6 diff -C2 -d -r1.5.4.10.2.8.2.5 -r1.5.4.10.2.8.2.6 *** s_stuff.h 8 Dec 2006 04:37:26 -0000 1.5.4.10.2.8.2.5 --- s_stuff.h 20 Dec 2006 04:01:33 -0000 1.5.4.10.2.8.2.6 *************** *** 16,23 **** /* in s_path.c */
! typedef struct _namelist ! { ! struct _namelist *nl_next; ! char *nl_string; } t_namelist;
--- 16,22 ---- /* in s_path.c */
! typedef struct _namelist { /* element in a linked list of stored strings */ ! struct _namelist *nl_next; /* next in list */ ! char *nl_string; /* the string */ } t_namelist;
*************** *** 40,45 **** #endif
! ! /* s_file.c */
/* s_main.c */ --- 39,46 ---- #endif
! int sys_open_absolute(const char *name, const char* ext, ! char *dirresult, char **nameresult, unsigned int size, int bin, int *fdp); ! int sys_trytoopenone(const char *dir, const char *name, const char* ext, ! char *dirresult, char **nameresult, unsigned int size, int bin);
/* s_main.c */ *************** *** 61,66 ****
/* s_loader.c */ ! int sys_load_lib(char *dirname, char *filename, char *altname); ! /* s_audio.c */
--- 62,67 ----
/* s_loader.c */ ! int sys_load_lib(t_canvas *canvas, char *filename); ! /* s_audio.c */
Index: m_pd.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v retrieving revision 1.4.4.11.2.33.2.13 retrieving revision 1.4.4.11.2.33.2.14 diff -C2 -d -r1.4.4.11.2.33.2.13 -r1.4.4.11.2.33.2.14 *** m_pd.h 19 Dec 2006 19:25:04 -0000 1.4.4.11.2.33.2.13 --- m_pd.h 20 Dec 2006 04:01:33 -0000 1.4.4.11.2.33.2.14 *************** *** 517,522 **** EXTERN int class_getfieldindex(t_class *x, const char *s);
! /* grrrr: register class loader */ ! EXTERN void sys_register_loader(int (*callback) (char *dirname,char *classname,char *altname));
/* ------------ printing --------------------------------- */ --- 517,522 ---- EXTERN int class_getfieldindex(t_class *x, const char *s);
! typedef int (*t_loader)(t_canvas *canvas, char *classname); ! EXTERN void sys_register_loader(t_loader loader);
/* ------------ printing --------------------------------- */
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.217.2.86 retrieving revision 1.1.2.217.2.87 diff -C2 -d -r1.1.2.217.2.86 -r1.1.2.217.2.87 *** desire.c 20 Dec 2006 03:31:34 -0000 1.1.2.217.2.86 --- desire.c 20 Dec 2006 04:01:31 -0000 1.1.2.217.2.87 *************** *** 7392,7397 ****
/* first check if "name" is absolute (and if so, try to open) */ ! /*FIXME: undefined symbol */ ! /* if (sys_open_absolute(name, ext, dirresult, nameresult, size, bin, &fd)) return fd; */
/* otherwise "name" is relative; start trying in directories named --- 7392,7396 ----
/* first check if "name" is absolute (and if so, try to open) */ ! if (sys_open_absolute(name, ext, dirresult, nameresult, size, bin, &fd)) return fd;
/* otherwise "name" is relative; start trying in directories named *************** *** 7800,7804 **** /* load dynamic libraries specified with "-lib" args */ for (nl = sys_externlist; nl; nl = nl->nl_next) ! if (!sys_load_lib(cwd, nl->nl_string, 0)) post("%s: can't load library", nl->nl_string); /* open patches specified with "-open" args */ --- 7799,7803 ---- /* load dynamic libraries specified with "-lib" args */ for (nl = sys_externlist; nl; nl = nl->nl_next) ! if (!sys_load_lib(0, nl->nl_string)) post("%s: can't load library", nl->nl_string); /* open patches specified with "-open" args */