/[ascend]/trunk/base/generic/utilities/ascDynaLoad.c
ViewVC logotype

Diff of /trunk/base/generic/utilities/ascDynaLoad.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1596 by johnpye, Thu Jan 25 06:57:40 2007 UTC revision 1597 by jpye, Fri Aug 17 05:26:05 2007 UTC
# Line 200  int Asc_DynamicLoad(CONST char *path, CO Line 200  int Asc_DynamicLoad(CONST char *path, CO
200        ERROR_REPORTER_HERE(ASC_PROG_ERR,"Required function '%s' not found", initFun);        ERROR_REPORTER_HERE(ASC_PROG_ERR,"Required function '%s' not found", initFun);
201        (void)FreeLibrary(xlib);        (void)FreeLibrary(xlib);
202        return 1;        return 1;
203      }else{  #if 0
204        }else{
205          FPRINTF(ASCERR,"FOUND INITFCN %s AT %d\n",initFun,install);          FPRINTF(ASCERR,"FOUND INITFCN %s AT %d\n",initFun,install);
206    #endif
207      }      }
208    }    }
209    if (0 != AscAddRecord(xlib,path)) {    if (0 != AscAddRecord(xlib,path)) {
# Line 499  DynamicF Asc_DynamicFunction(CONST char Line 501  DynamicF Asc_DynamicFunction(CONST char
501    SEARCHING FOR LIBRARIES    SEARCHING FOR LIBRARIES
502  */  */
503    
504    
505    /**
506        Create a library filename according to platform standard naming.
507    
508        @param partialname The partial filename (eg 'mylib')
509        @return Complete filename (eg 'libmylib.so' or 'mylib.dlll', etc)
510    
511        Basically just adds ASC_SHLIBPREFIX to start and ASC_SHLIBSUFFIX to end.
512    
513        No allowance made for 'soname' suffixes eg 'libsomething.so.1' etc. But
514        that's probably OK as those methods aren't really applicable to dlopened
515        libraries (eg the soname symlink mechanism breaks down).
516    */
517    char *dynaload_lib_filename(const char *partialname){
518        char *buffer;
519        buffer = ASC_NEW_ARRAY(char,PATH_MAX);
520    #if !defined(ASC_SHLIBSUFFIX) || !defined(ASC_SHLIBPREFIX)
521    # error "ASC_SHLIBSUFFIX and ASC_SHLIBPREFIX are not defined"
522    #endif
523        snprintf(buffer,PATH_MAX,"%s%s%s",ASC_SHLIBPREFIX,partialname,ASC_SHLIBSUFFIX);
524        return buffer;
525    }
526    
527    
528  /**  /**
529      A little structure to help with searching for libraries      A little structure to help with searching for libraries
530    
# Line 585  char *SearchArchiveLibraryPath(CONST cha Line 611  char *SearchArchiveLibraryPath(CONST cha
611          return NULL;          return NULL;
612      }      }
613    
614      buffer = importhandler_extlib_filename(s1);      buffer = dynaload_lib_filename(s1);
615    
616      fp3 = ospath_new(buffer);      fp3 = ospath_new(buffer);
617      ASC_FREE(buffer);      ASC_FREE(buffer);

Legend:
Removed from v.1596  
changed lines
  Added in v.1597

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22