Lines Matching full:info
14 const char *filename, void *parse_arg, parse_info_t ** info) in parse_init() argument
33 *info = tmp_info; in parse_init()
37 void parse_release(parse_info_t * info) in parse_release() argument
40 parse_close(info); in parse_release()
41 parse_dispose_line(info); in parse_release()
42 free(info); in parse_release()
45 int parse_open(semanage_handle_t * handle, parse_info_t * info) in parse_open() argument
48 info->file_stream = fopen(info->filename, "r"); in parse_open()
49 if (!info->file_stream && (errno != ENOENT)) { in parse_open()
51 info->filename, strerror(errno)); in parse_open()
54 if (info->file_stream) in parse_open()
55 __fsetlocking(info->file_stream, FSETLOCKING_BYCALLER); in parse_open()
60 void parse_close(parse_info_t * info) in parse_close() argument
63 if (info->file_stream) in parse_close()
64 fclose(info->file_stream); in parse_close()
65 info->file_stream = NULL; in parse_close()
68 void parse_dispose_line(parse_info_t * info) in parse_dispose_line() argument
70 if (info->orig_line) { in parse_dispose_line()
71 free(info->orig_line); in parse_dispose_line()
72 info->orig_line = NULL; in parse_dispose_line()
75 if (info->working_copy) { in parse_dispose_line()
76 free(info->working_copy); in parse_dispose_line()
77 info->working_copy = NULL; in parse_dispose_line()
80 info->ptr = NULL; in parse_dispose_line()
83 int parse_skip_space(semanage_handle_t * handle, parse_info_t * info) in parse_skip_space() argument
88 int lineno = info->lineno; in parse_skip_space()
92 if (info->ptr) { in parse_skip_space()
93 while (*(info->ptr) && isspace(*(info->ptr))) in parse_skip_space()
94 info->ptr++; in parse_skip_space()
96 if (*(info->ptr)) in parse_skip_space()
100 parse_dispose_line(info); in parse_skip_space()
102 while (info->file_stream && in parse_skip_space()
103 ((len = getline(&buffer, &buf_len, info->file_stream)) > 0)) { in parse_skip_space()
121 info->lineno = lineno; in parse_skip_space()
122 info->working_copy = buffer; in parse_skip_space()
123 info->orig_line = tmp; in parse_skip_space()
124 info->ptr = ptr; in parse_skip_space()
141 int parse_assert_noeof(semanage_handle_t * handle, parse_info_t * info) in parse_assert_noeof() argument
144 if (!info->ptr) { in parse_assert_noeof()
146 info->filename, info->lineno); in parse_assert_noeof()
153 int parse_assert_space(semanage_handle_t * handle, parse_info_t * info) in parse_assert_space() argument
156 if (parse_assert_noeof(handle, info) < 0) in parse_assert_space()
159 if (*(info->ptr) && !isspace(*(info->ptr))) { in parse_assert_space()
161 info->filename, info->lineno, info->orig_line); in parse_assert_space()
165 if (parse_skip_space(handle, info) < 0) in parse_assert_space()
172 parse_info_t * info, const char ch) in parse_assert_ch() argument
175 if (parse_assert_noeof(handle, info) < 0) in parse_assert_ch()
178 if (*(info->ptr) != ch) { in parse_assert_ch()
180 "(%s: %u):\n%s", ch, *(info->ptr), info->filename, in parse_assert_ch()
181 info->lineno, info->orig_line); in parse_assert_ch()
185 info->ptr++; in parse_assert_ch()
191 parse_info_t * info, const char *assert_str) in parse_assert_str() argument
196 if (parse_assert_noeof(handle, info) < 0) in parse_assert_str()
199 if (strncmp(info->ptr, assert_str, len)) { in parse_assert_str()
201 "(%s: %u):\n%s", assert_str, info->ptr, in parse_assert_str()
202 info->filename, info->lineno, info->orig_line); in parse_assert_str()
207 info->ptr += len; in parse_assert_str()
211 int parse_optional_ch(parse_info_t * info, const char ch) in parse_optional_ch() argument
214 if (!info->ptr) in parse_optional_ch()
216 if (*(info->ptr) != ch) in parse_optional_ch()
219 info->ptr++; in parse_optional_ch()
223 int parse_optional_str(parse_info_t * info, const char *str) in parse_optional_str() argument
227 if (strncmp(info->ptr, str, len)) in parse_optional_str()
230 info->ptr += len; in parse_optional_str()
235 parse_info_t * info, int *num, char delim) in parse_fetch_int() argument
242 if (parse_fetch_string(handle, info, &str, delim) < 0) in parse_fetch_int()
247 info->filename, info->lineno, info->orig_line); in parse_fetch_int()
254 "(%s: %u)\n%s", str, info->filename, in parse_fetch_int()
255 info->lineno, info->orig_line); in parse_fetch_int()
270 parse_info_t * info, char **str, char delim) in parse_fetch_string() argument
273 char *start = info->ptr; in parse_fetch_string()
277 if (parse_assert_noeof(handle, info) < 0) in parse_fetch_string()
280 while (*(info->ptr) && !isspace(*(info->ptr)) && in parse_fetch_string()
281 (*(info->ptr) != delim)) { in parse_fetch_string()
282 info->ptr++; in parse_fetch_string()
288 "find one (%s: %u):\n%s", info->filename, info->lineno, in parse_fetch_string()
289 info->orig_line); in parse_fetch_string()