| return imp; |
return imp; |
| } |
} |
| |
|
| |
/* index of last '/' or '\' in file, 0 if there is none. !! Hmm, could |
| |
be implemented with strrchr and the separator should be |
| |
OS-dependent */ |
| int onlypath(char *file) |
int onlypath(char *file) |
| { |
{ |
| int i; |
int i; |
| FILE *openimage(char *fullfilename) |
FILE *openimage(char *fullfilename) |
| { |
{ |
| FILE *image_file; |
FILE *image_file; |
| |
char * expfilename = tilde_cstr(fullfilename, strlen(fullfilename), 1); |
| |
|
| image_file=fopen(fullfilename,"rb"); |
image_file=fopen(expfilename,"rb"); |
| if (image_file!=NULL && debug) |
if (image_file!=NULL && debug) |
| fprintf(stderr, "Opened image file: %s\n", fullfilename); |
fprintf(stderr, "Opened image file: %s\n", expfilename); |
| return image_file; |
return image_file; |
| } |
} |
| |
|
| |
/* try to open image file concat(path[0:len],imagename) */ |
| FILE *checkimage(char *path, int len, char *imagename) |
FILE *checkimage(char *path, int len, char *imagename) |
| { |
{ |
| int dirlen=len; |
int dirlen=len; |
| FILE * open_image_file(char * imagename, char * path) |
FILE * open_image_file(char * imagename, char * path) |
| { |
{ |
| FILE * image_file=NULL; |
FILE * image_file=NULL; |
| |
char *origpath=path; |
| |
|
| if(strchr(imagename, '/')==NULL) { |
if(strchr(imagename, '/')==NULL) { |
| /* first check the directory where the exe file is in !! 01may97jaw */ |
/* first check the directory where the exe file is in !! 01may97jaw */ |
| |
|
| if (!image_file) { |
if (!image_file) { |
| fprintf(stderr,"%s: cannot open image file %s in path %s for reading\n", |
fprintf(stderr,"%s: cannot open image file %s in path %s for reading\n", |
| progname, imagename, path); |
progname, imagename, origpath); |
| exit(1); |
exit(1); |
| } |
} |
| |
|