/[ascend]/trunk/ascend/compiler/packages.c
ViewVC logotype

Diff of /trunk/ascend/compiler/packages.c

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

revision 2335 by jpye, Wed Dec 15 06:35:43 2010 UTC revision 2336 by jpye, Sun Dec 26 03:44:24 2010 UTC
# Line 79  Line 79 
79  #include "packages.h"  #include "packages.h"
80  #include "defaultpaths.h"  #include "defaultpaths.h"
81    
82  /* #define PACKAGE_DEBUG */  /* #define PACKAGES_DEBUG */
83    
84  /*  /*
85      Initialise the slv data structures used when calling external fns      Initialise the slv data structures used when calling external fns
# Line 115  int Builtins_Init(void){ Line 115  int Builtins_Init(void){
115          ,NULL /* destroy fn */          ,NULL /* destroy fn */
116    );    );
117    
118    #ifdef PACKAGES_DEBUG
119    CONSOLE_DEBUG("Registering EXTERNAL defaultself_visit_childatoms");    CONSOLE_DEBUG("Registering EXTERNAL defaultself_visit_childatoms");
120    #endif
121    result = CreateUserFunctionMethod("defaultself_visit_childatoms"    result = CreateUserFunctionMethod("defaultself_visit_childatoms"
122          ,defaultself_visit_childatoms          ,defaultself_visit_childatoms
123          ,1 /* num of args */          ,1 /* num of args */
# Line 124  int Builtins_Init(void){ Line 126  int Builtins_Init(void){
126          ,NULL /* destroy fn */          ,NULL /* destroy fn */
127    );    );
128    
129    #ifdef PACKAGES_DEBUG
130    CONSOLE_DEBUG("Registering EXTERNAL defaultself_visit_submodels");    CONSOLE_DEBUG("Registering EXTERNAL defaultself_visit_submodels");
131    #endif
132    result = CreateUserFunctionMethod("defaultself_visit_submodels"    result = CreateUserFunctionMethod("defaultself_visit_submodels"
133          ,defaultself_visit_submodels          ,defaultself_visit_submodels
134          ,1 /* num of args */          ,1 /* num of args */
# Line 153  int package_load(CONST char *partialpath Line 157  int package_load(CONST char *partialpath
157          /*CONSOLE_DEBUG("Default ASCENDLIBRARY set to '%s'", default_library_path);*/          /*CONSOLE_DEBUG("Default ASCENDLIBRARY set to '%s'", default_library_path);*/
158      }      }
159    
160  #ifdef PACKAGE_DEBUG  #ifdef PACKAGES_DEBUG
161      CONSOLE_DEBUG("Searching for external library '%s'",partialpath);      CONSOLE_DEBUG("Searching for external library '%s'",partialpath);
162  #endif  #endif
163    
# Line 170  int package_load(CONST char *partialpath Line 174  int package_load(CONST char *partialpath
174              partialpath, default_library_path, ASC_ENV_LIBRARY,&handler              partialpath, default_library_path, ASC_ENV_LIBRARY,&handler
175          );          );
176          if(fp1==NULL){          if(fp1==NULL){
177    #ifdef PACKAGES_DEBUG
178              CONSOLE_DEBUG("External library '%s' not found",partialpath);              CONSOLE_DEBUG("External library '%s' not found",partialpath);
179    #endif
180              ERROR_REPORTER_NOLINE(ASC_USER_ERROR,"External library '%s' not found.",partialpath);              ERROR_REPORTER_NOLINE(ASC_USER_ERROR,"External library '%s' not found.",partialpath);
181              return 1; /* failure */              return 1; /* failure */
182          }          }
183  #ifdef PACKAGE_DEBUG  #ifdef PACKAGES_DEBUG
184          else{          else{
185              CONSOLE_DEBUG("FOUND in $ASCENDLIBRARY");              CONSOLE_DEBUG("FOUND in $ASCENDLIBRARY");
186          }          }
# Line 185  int package_load(CONST char *partialpath Line 191  int package_load(CONST char *partialpath
191    
192      asc_assert(handler!=NULL);      asc_assert(handler!=NULL);
193    
194  #ifdef PACKAGE_DEBUG  #ifdef PACKAGES_DEBUG
195      CONSOLE_DEBUG("About to import external library...");      CONSOLE_DEBUG("About to import external library...");
196  #endif  #endif
197    
198      /* run the import handlers' importfn to do the actual loading, registration etc. */      /* run the import handlers' importfn to do the actual loading, registration etc. */
199      result = (*(handler->importfn))(fp1,initfunc,partialpath);      result = (*(handler->importfn))(fp1,initfunc,partialpath);
200      if(result){      if(result){
201  #ifdef PACKAGE_DEBUG  #ifdef PACKAGES_DEBUG
202          CONSOLE_DEBUG("Error %d when importing external library of type '%s'",result,handler->name);          CONSOLE_DEBUG("Error %d when importing external library of type '%s'",result,handler->name);
203  #endif  #endif
204          ERROR_REPORTER_HERE(ASC_PROG_ERROR,"Error importing external library '%s'",partialpath);          ERROR_REPORTER_HERE(ASC_PROG_ERROR,"Error importing external library '%s'",partialpath);

Legend:
Removed from v.2335  
changed lines
  Added in v.2336

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