|
Packit Bot |
06c835 |
/* GNU gettext - internationalization aids
|
|
Packit Bot |
06c835 |
Copyright (C) 1995-1998, 2000-2006, 2012, 2015 Free Software
|
|
Packit Bot |
06c835 |
Foundation, Inc.
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
This file was written by Peter Miller <millerp@canb.auug.org.au>
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
This program is free software: you can redistribute it and/or modify
|
|
Packit Bot |
06c835 |
it under the terms of the GNU General Public License as published by
|
|
Packit Bot |
06c835 |
the Free Software Foundation; either version 3 of the License, or
|
|
Packit Bot |
06c835 |
(at your option) any later version.
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
This program is distributed in the hope that it will be useful,
|
|
Packit Bot |
06c835 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Bot |
06c835 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Bot |
06c835 |
GNU General Public License for more details.
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
You should have received a copy of the GNU General Public License
|
|
Packit Bot |
06c835 |
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
#ifndef _PO_LEX_H
|
|
Packit Bot |
06c835 |
#define _PO_LEX_H
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
#include <sys/types.h>
|
|
Packit Bot |
06c835 |
#include <stdio.h>
|
|
Packit Bot |
06c835 |
#include <stdbool.h>
|
|
Packit Bot |
06c835 |
#include "error.h"
|
|
Packit Bot |
06c835 |
#include "error-progname.h"
|
|
Packit Bot |
06c835 |
#include "xerror.h"
|
|
Packit Bot |
06c835 |
#include "pos.h"
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
#ifndef __attribute__
|
|
Packit Bot |
06c835 |
/* This feature is available in gcc versions 2.5 and later. */
|
|
Packit Bot |
06c835 |
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
|
Packit Bot |
06c835 |
# define __attribute__(Spec) /* empty */
|
|
Packit Bot |
06c835 |
# endif
|
|
Packit Bot |
06c835 |
/* The __-protected variants of 'format' and 'printf' attributes
|
|
Packit Bot |
06c835 |
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
|
|
Packit Bot |
06c835 |
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
|
Packit Bot |
06c835 |
# define __format__ format
|
|
Packit Bot |
06c835 |
# define __printf__ printf
|
|
Packit Bot |
06c835 |
# endif
|
|
Packit Bot |
06c835 |
#endif
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
#ifdef __cplusplus
|
|
Packit Bot |
06c835 |
extern "C" {
|
|
Packit Bot |
06c835 |
#endif
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
/* Lexical analyzer for reading PO files. */
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
/* Global variables from po-lex.c. */
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
/* Current position within the PO file. */
|
|
Packit Bot |
06c835 |
extern DLL_VARIABLE lex_pos_ty gram_pos;
|
|
Packit Bot |
06c835 |
extern DLL_VARIABLE int gram_pos_column;
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
/* Number of parse errors within a PO file that cause the program to
|
|
Packit Bot |
06c835 |
terminate. Cf. error_message_count, declared in <error.h>. */
|
|
Packit Bot |
06c835 |
extern DLL_VARIABLE unsigned int gram_max_allowed_errors;
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
/* True if obsolete entries shall be considered as valid. */
|
|
Packit Bot |
06c835 |
extern DLL_VARIABLE bool pass_obsolete_entries;
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
/* Prepare lexical analysis. */
|
|
Packit Bot |
06c835 |
extern void lex_start (FILE *fp, const char *real_filename,
|
|
Packit Bot |
06c835 |
const char *logical_filename);
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
/* Terminate lexical analysis. */
|
|
Packit Bot |
06c835 |
extern void lex_end (void);
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
/* Return the next token in the PO file. The return codes are defined
|
|
Packit Bot |
06c835 |
in "po-gram-gen2.h". Associated data is put in 'po_gram_lval. */
|
|
Packit Bot |
06c835 |
extern int po_gram_lex (void);
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
/* po_gram_lex() can return comments as COMMENT. Switch this on or off. */
|
|
Packit Bot |
06c835 |
extern void po_lex_pass_comments (bool flag);
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
/* po_gram_lex() can return obsolete entries as if they were normal entries.
|
|
Packit Bot |
06c835 |
Switch this on or off. */
|
|
Packit Bot |
06c835 |
extern void po_lex_pass_obsolete_entries (bool flag);
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
extern void po_gram_error (const char *fmt, ...)
|
|
Packit Bot |
06c835 |
__attribute__ ((__format__ (__printf__, 1, 2)));
|
|
Packit Bot |
06c835 |
extern void po_gram_error_at_line (const lex_pos_ty *pos, const char *fmt, ...)
|
|
Packit Bot |
06c835 |
__attribute__ ((__format__ (__printf__, 2, 3)));
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
/* Contains information about the definition of one translation. */
|
|
Packit Bot |
06c835 |
struct msgstr_def
|
|
Packit Bot |
06c835 |
{
|
|
Packit Bot |
06c835 |
char *msgstr;
|
|
Packit Bot |
06c835 |
size_t msgstr_len;
|
|
Packit Bot |
06c835 |
};
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
#ifdef __cplusplus
|
|
Packit Bot |
06c835 |
}
|
|
Packit Bot |
06c835 |
#endif
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
|
|
Packit Bot |
06c835 |
#endif
|