1 |
|
#define _GNU_SOURCE |
2 |
|
|
3 |
#include <stdlib.h> |
#include <stdlib.h> |
4 |
#include <string.h> |
#include <string.h> |
5 |
#include <ctype.h> |
#include <ctype.h> |
6 |
|
#include <unistd.h> |
7 |
|
#include <sys/types.h> |
8 |
|
#include <fnmatch.h> |
9 |
|
|
10 |
|
#include "fileutil.h" |
11 |
#include "ImageMapFile.h" |
#include "ImageMapFile.h" |
12 |
|
|
13 |
#define WHITESPACE_CHARS " \t\n" |
#define WHITESPACE_CHARS " \t\n" |
98 |
char * linestart = NULL; |
char * linestart = NULL; |
99 |
char * lineend = NULL; |
char * lineend = NULL; |
100 |
int eof = 0; |
int eof = 0; |
101 |
int read; |
int size; |
102 |
|
|
103 |
read = cgul_read_config(image_map_file, &contents, getuid(), getgid()); |
size = cgul_read_config(image_map_file, &contents, getuid(), getgid()); |
104 |
if (read != 0){ |
if (size != 0){ |
105 |
// EEF_log(LOG_ERR,"Unable to safely open the image map file '%s', reason: %d (for an explenation of the reason look in cgul/fileutil/fileutil.h)",image_map_file,read); |
/*EEF_log(LOG_ERR,"Unable to safely open the image map file '%s', reason: %d (for an explenation of the reason look in cgul/fileutil/fileutil.h)",image_map_file,size);*/ |
106 |
goto failure; |
goto failure; |
107 |
} |
} |
108 |
|
|
118 |
} |
} |
119 |
*lineend = '\0'; |
*lineend = '\0'; |
120 |
|
|
121 |
read = gridmap_parse_line(linestart, &gline); |
size = gridmap_parse_line(linestart, &gline); |
122 |
linestart = lineend+1; |
linestart = lineend+1; |
123 |
|
|
124 |
/* error which is unrecoverable only will result in a non 0 value */ |
/* error which is unrecoverable only will result in a non 0 value */ |
125 |
if (read != 0) { |
if (size != 0) { |
126 |
goto failure; |
goto failure; |
127 |
} |
} |
128 |
|
|