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 |
} |
} |
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){ |
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; |