85#define INF_DEBUG_FOUND FALSE
86#define INF_DEBUG_NOT_FOUND FALSE
88#define INF_MAGIC (0xabdc0132)
143#define inf_log(inf, level, message, ...) \
144 if (log_do_output_for_level(level)) { \
145 do_log(__FILE__, __FUNCTION__, __FC_LINE__, FALSE, level, "%s", \
146 inf_log_str(inf, message, ## __VA_ARGS__)); \
148#define inf_warn(inf, message) \
149 inf_log(inf, LOG_NORMAL, "%s", message);
156 return (c ==
'#' || c ==
';');
171 inf->line_num =
inf->cur_line_pos = 0;
173 inf->string_start_line = 0;
209 return inf->filename;
211 return "(anonymous)";
306 if (
inf->included_from) {
366 static size_t len = 0;
381 ||
inf->cur_line_pos > 0) {
401 "Did not find opening doublequote for '*include' line");
408 while (*c !=
'\0' && *c !=
'\"') c++;
411 "Did not find closing doublequote for '*include' line");
448 }
while ((
inc =
inc->included_from));
507 if (
inf->in_string) {
541 inf->cur_line_pos = 0;
549 if (
inf->included_from) {
570 static char str[512];
584 (
inf->at_eof ?
", EOF" :
""));
590 if (
inf->in_string) {
592 "\n processing string starting at line %d",
593 inf->string_start_line);
595 while ((
inf =
inf->included_from)) {
663 const char *c, *start;
672 while (*c !=
'\0' && *c !=
']') {
678 *((
char *) c) =
'\0';
691 const char *c, *start, *end;
707 if (!(*c !=
'\0' && (
fc_isspace(*c) || *c ==
'='))) {
711 while (*c !=
'\0' && *c !=
'=' && !
is_comment(*c)) {
718 *((
char *) end) =
'\0';
747 inf->cur_line_pos = 0;
806 const char *c, *start;
821 if (*c ==
'-' || *c ==
'+' ||
fc_isdigit(*c)) {
841 *((
char *) c) =
'\0';
851 if (*c ==
'_' && *(c + 1) ==
'(') {
874 if (*c ==
'\0' || *c ==
'\n') {
887 *((
char *) (c - 1)) =
'\0';
892 _(
"Cannot find stringfile \"%s\"."), start);
900 _(
"Cannot open stringfile \"%s\"."),
rfname);
903 log_debug(
"Stringfile \"%s\" opened ok", start);
942 *((
char *) c) =
'\0';
965 inf->string_start_line =
inf->line_num;
968 partial = &
inf->partial;
977 if (*c ==
'\\' && *(c + 1) !=
'\0') {
993 "Bad return for multi-line string from read_a_line");
1001 *((
char *) c) =
'\0';
1011 inf->cur_line_pos++;
1013 inf_warn(
inf,
"Missing end of i18n string marking");
void astr_free(struct astring *astr)
void astr_set(struct astring *astr, const char *format,...)
void astr_reserve(struct astring *astr, size_t n)
void astr_clear(struct astring *astr)
void astr_init(struct astring *astr)
void astr_add(struct astring *astr, const char *format,...)
static size_t astr_capacity(const struct astring *astr) fc__attribute((nonnull(1)))
static size_t astr_len(const struct astring *astr) fc__attribute((nonnull(1)))
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
static bool astr_empty(const struct astring *astr) fc__attribute((nonnull(1)))
char * fz_fgets(char *buffer, int size, fz_FILE *fp)
fz_FILE * fz_from_file(const char *filename, const char *in_mode, enum fz_method method, int compress_level)
const char * fz_strerror(fz_FILE *fp)
int fz_fclose(fz_FILE *fp)
int fz_ferror(fz_FILE *fp)
#define fc_assert_ret(condition)
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
#define log_error(message,...)
const char * fileinfoname(const struct strvec *dirs, const char *filename)
const struct strvec * get_data_dirs(void)
int cat_snprintf(char *str, size_t n, const char *format,...)
int fc_vsnprintf(char *str, size_t n, const char *format, va_list ap)
#define sz_strlcat(dest, src)
#define fc_strncmp(_s1_, _s2_, _len_)