/* Reading PO files.
- Copyright (C) 1995-1998, 2000-2003, 2005-2006, 2008-2009 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2003, 2005-2006, 2008-2009, 2015 Free
+ Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
This program is free software: you can redistribute it and/or modify
this->range.min = -1;
this->range.max = -1;
this->do_wrap = undecided;
+ for (i = 0; i < NSYNTAXCHECKS; i++)
+ this->do_syntax_check[i] = undecided;
}
default_destructor (abstract_catalog_reader_ty *that)
{
default_catalog_reader_ty *this = (default_catalog_reader_ty *) that;
+ size_t j;
/* Do not free this->mdlp and this->mlp. */
if (this->handle_comments)
if (this->comment_dot != NULL)
string_list_free (this->comment_dot);
}
- if (this->handle_filepos_comments)
- {
- size_t j;
- for (j = 0; j < this->filepos_count; ++j)
- free (this->filepos[j].file_name);
- if (this->filepos != NULL)
- free (this->filepos);
- }
+ for (j = 0; j < this->filepos_count; ++j)
+ free (this->filepos[j].file_name);
+ if (this->filepos != NULL)
+ free (this->filepos);
}
void
default_parse_brief (abstract_catalog_reader_ty *that)
{
- /* We need to parse comments, because even if this->handle_comments and
- this->handle_filepos_comments are false, we need to know which messages
- are fuzzy. */
+ /* We need to parse comments, because even if this->handle_comments
+ is false, we need to know which messages are fuzzy. */
po_lex_pass_comments (true);
}
for (j = 0; j < this->comment_dot->nitems; ++j)
message_comment_dot_append (mp, this->comment_dot->item[j]);
}
- if (this->handle_filepos_comments)
+ for (j = 0; j < this->filepos_count; ++j)
{
- for (j = 0; j < this->filepos_count; ++j)
- {
- lex_pos_ty *pp;
+ lex_pos_ty *pp;
- pp = &this->filepos[j];
- message_comment_filepos (mp, pp->file_name, pp->line_number);
- }
+ pp = &this->filepos[j];
+ message_comment_filepos (mp, pp->file_name, pp->line_number);
}
mp->is_fuzzy = this->is_fuzzy;
for (i = 0; i < NFORMATS; i++)
mp->is_format[i] = this->is_format[i];
mp->range = this->range;
mp->do_wrap = this->do_wrap;
+ for (i = 0; i < NSYNTAXCHECKS; i++)
+ mp->do_syntax_check[i] = this->do_syntax_check[i];
}
this->comment_dot = NULL;
}
}
- if (this->handle_filepos_comments)
- {
- for (j = 0; j < this->filepos_count; ++j)
- free (this->filepos[j].file_name);
- if (this->filepos != NULL)
- free (this->filepos);
- this->filepos_count = 0;
- this->filepos = NULL;
- }
+ for (j = 0; j < this->filepos_count; ++j)
+ free (this->filepos[j].file_name);
+ if (this->filepos != NULL)
+ free (this->filepos);
+ this->filepos_count = 0;
+ this->filepos = NULL;
this->is_fuzzy = false;
for (i = 0; i < NFORMATS; i++)
this->is_format[i] = undecided;
this->range.min = -1;
this->range.max = -1;
this->do_wrap = undecided;
+ for (i = 0; i < NSYNTAXCHECKS; i++)
+ this->do_syntax_check[i] = undecided;
}
const char *name, size_t line)
{
default_catalog_reader_ty *this = (default_catalog_reader_ty *) that;
-
- if (this->handle_filepos_comments)
- {
- size_t nbytes;
- lex_pos_ty *pp;
-
- nbytes = (this->filepos_count + 1) * sizeof (this->filepos[0]);
- this->filepos = xrealloc (this->filepos, nbytes);
- pp = &this->filepos[this->filepos_count++];
- pp->file_name = xstrdup (name);
- pp->line_number = line;
- }
+ size_t nbytes;
+ lex_pos_ty *pp;
+
+ nbytes = (this->filepos_count + 1) * sizeof (this->filepos[0]);
+ this->filepos = xrealloc (this->filepos, nbytes);
+ pp = &this->filepos[this->filepos_count++];
+ pp->file_name = xstrdup (name);
+ pp->line_number = line;
}
default_catalog_reader_ty *this = (default_catalog_reader_ty *) that;
po_parse_comment_special (s, &this->is_fuzzy, this->is_format, &this->range,
- &this->do_wrap);
+ &this->do_wrap, this->do_syntax_check);
}
/* Exported functions. */
-/* If nonzero, remember comments for file name and line number for each
- msgid, if present in the reference input. Defaults to true. */
-int line_comment = 1;
-
/* If false, duplicate msgids in the same domain and file generate an error.
If true, such msgids are allowed; the caller should treat them
appropriately. Defaults to false. */
pop = default_catalog_reader_alloc (&default_methods);
pop->handle_comments = true;
- pop->handle_filepos_comments = (line_comment != 0);
pop->allow_domain_directives = true;
pop->allow_duplicates = allow_duplicates;
pop->allow_duplicates_if_same_msgstr = false;