version 1.27, 1999/05/11 19:37:25
|
version 1.28, 1999/06/17 15:32:14
|
Line 455 Address loader(FILE *imagefile, char* fi
|
Line 455 Address loader(FILE *imagefile, char* fi
|
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; |
Line 469 int onlypath(char *file)
|
Line 472 int onlypath(char *file)
|
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; |
Line 491 FILE *checkimage(char *path, int len, ch
|
Line 496 FILE *checkimage(char *path, int len, ch
|
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 */ |
Line 511 FILE * open_image_file(char * imagename,
|
Line 517 FILE * open_image_file(char * imagename,
|
|
|
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); |
} |
} |
|
|