/[ascend]/trunk/base/generic/compiler/importhandler.c
ViewVC logotype

Diff of /trunk/base/generic/compiler/importhandler.c

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

revision 1025 by johnpye, Mon Dec 18 05:49:00 2006 UTC revision 1026 by johnpye, Wed Jan 3 12:03:08 2007 UTC
# Line 216  int importhandler_createlibrary(){ Line 216  int importhandler_createlibrary(){
216  }  }
217    
218  int importhandler_remove(const char *name){  int importhandler_remove(const char *name){
219        if(importhandler_library==NULL)return 2;
220        CONSOLE_DEBUG("Removing importhandler '%s'", name);
221      ERROR_REPORTER_HERE(ASC_PROG_ERR,"%s not implemented",__FUNCTION__);      ERROR_REPORTER_HERE(ASC_PROG_ERR,"%s not implemented",__FUNCTION__);
222      return 1;      return 1;
223  }  }
# Line 225  struct ImportHandler *importhandler_look Line 227  struct ImportHandler *importhandler_look
227      return NULL;      return NULL;
228  }  }
229    
230    /** @return 0 on success */
231  int importhandler_destroylibrary(){  int importhandler_destroylibrary(){
232      ERROR_REPORTER_HERE(ASC_PROG_ERR,"%s not implemented",__FUNCTION__);      int i;
233      CONSOLE_DEBUG("NOT IMPLEMENTED");      int err = 0;
234      return 1;      CONSOLE_DEBUG("Destroying importhandler library...");
235        importhandler_printlibrary(stderr);
236        for(i=IMPORTHANDLER_MAX - 1; i >= 0; --i){
237            if(importhandler_library[i]==NULL)continue;
238            err = err | importhandler_remove(importhandler_library[i]->name);
239        }
240        if(err)ERROR_REPORTER_HERE(ASC_PROG_WARNING,"Failed to destroy importhandler library");
241        return err;
242  }  }
243    
244    /** @return 0 on success */
245  int importhandler_printlibrary(FILE *fp){  int importhandler_printlibrary(FILE *fp){
246      CONSOLE_DEBUG("NOT IMPLEMENTED");      int i;
247      return 1;      if(importhandler_library==NULL){
248            fprintf(fp,"# importhandler_printlibrary: empty\n");
249            return 0;
250        }else{
251            fprintf(fp,"# importhandler_printlibrary: start\n");
252            for(i=0; i < IMPORTHANDLER_MAX && importhandler_library[i] != NULL; ++i){
253                fprintf(fp,"%s\n",importhandler_library[i]->name);
254            }
255            fprintf(fp,"# importhandler_printlibrary: end\n");
256            return 0;
257        }
258  }  }
259    
260  int importhandler_printhandler(FILE *fp, struct ImportHandler *handler){  int importhandler_printhandler(FILE *fp, struct ImportHandler *handler){
# Line 275  int importhandler_search_test(struct Fil Line 295  int importhandler_search_test(struct Fil
295          to store the full path when found */          to store the full path when found */
296      FILE *f;      FILE *f;
297      char *filename;      char *filename;
298      char *fullpath;      /* char *fullpath; */
299      struct ImportHandlerSearch *searchdata;      struct ImportHandlerSearch *searchdata;
300      struct FilePath *fp, *fp1, *fp2;      struct FilePath *fp, *fp1, *fp2;
301      int i;      int i;

Legend:
Removed from v.1025  
changed lines
  Added in v.1026

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