~ubuntu-branches/ubuntu/breezy/gettext/breezy

« back to all changes in this revision

Viewing changes to gettext-tools/src/gettext-po.h

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2004-03-14 17:40:02 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040314174002-p1ad5ldve1hqzhye
Tags: 0.14.1-2
* Added libexpat1-dev to Build-Depends, for glade support.
* Added libc0.1-dev to Build-Depends, for GNU/kFreeBSD.
* Removed special-casing of knetbsd-gnu in debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Public API for GNU gettext PO files - contained in libgettextpo.
 
2
   Copyright (C) 2003 Free Software Foundation, Inc.
 
3
   Written by Bruno Haible <bruno@clisp.org>, 2003.
 
4
 
 
5
   This program is free software; you can redistribute it and/or modify
 
6
   it under the terms of the GNU General Public License as published by
 
7
   the Free Software Foundation; either version 2, or (at your option)
 
8
   any later version.
 
9
 
 
10
   This program is distributed in the hope that it will be useful,
 
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
   GNU General Public License for more details.
 
14
 
 
15
   You should have received a copy of the GNU General Public License
 
16
   along with this program; if not, write to the Free Software Foundation,
 
17
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
18
 
 
19
#ifndef _GETTEXT_PO_H
 
20
#define _GETTEXT_PO_H 1
 
21
 
 
22
#ifdef __cplusplus
 
23
extern "C" {
 
24
#endif
 
25
 
 
26
 
 
27
/* ================================= Types ================================= */
 
28
 
 
29
/* A po_file_t represents the contents of a PO file.  */
 
30
typedef struct po_file *po_file_t;
 
31
 
 
32
/* A po_message_iterator_t represents an iterator through a domain of a
 
33
   PO file.  */
 
34
typedef struct po_message_iterator *po_message_iterator_t;
 
35
 
 
36
/* A po_message_t represents a message in a PO file.  */
 
37
typedef struct po_message *po_message_t;
 
38
 
 
39
/* Memory allocation:
 
40
   The memory allocations performed by these functions use xmalloc(),
 
41
   therefore will cause a program exit if memory is exhausted.
 
42
   The memory allocated by po_file_read, and implicitly returned through
 
43
   the po_message_* functions, lasts until freed with po_file_free.  */
 
44
 
 
45
 
 
46
/* ============================= po_file_t API ============================= */
 
47
 
 
48
/* Read a PO file into memory.
 
49
   Return its contents.  Upon failure, return NULL and set errno.  */
 
50
extern po_file_t po_file_read (const char *filename);
 
51
 
 
52
/* Free a PO file from memory.  */
 
53
extern void po_file_free (po_file_t file);
 
54
 
 
55
/* Return the names of the domains covered by a PO file in memory.  */
 
56
extern const char * const * po_file_domains (po_file_t file);
 
57
 
 
58
 
 
59
/* =========================== Header entry API ============================ */
 
60
 
 
61
/* Return the header entry of a domain of a PO file in memory.
 
62
   The domain NULL denotes the default domain.
 
63
   Return NULL if there is no header entry.  */
 
64
extern const char * po_file_domain_header (po_file_t file, const char *domain);
 
65
 
 
66
/* Return the value of a field in a header entry.
 
67
   The return value is either a freshly allocated string, to be freed by the
 
68
   caller, or NULL.  */
 
69
extern char * po_header_field (const char *header, const char *field);
 
70
 
 
71
 
 
72
/* ======================= po_message_iterator_t API ======================= */
 
73
 
 
74
/* Create an iterator for traversing a domain of a PO file in memory.
 
75
   The domain NULL denotes the default domain.  */
 
76
extern po_message_iterator_t po_message_iterator (po_file_t file, const char *domain);
 
77
 
 
78
/* Free an iterator.  */
 
79
extern void po_message_iterator_free (po_message_iterator_t iterator);
 
80
 
 
81
/* Return the next message, and advance the iterator.
 
82
   Return NULL at the end of the message list.  */
 
83
extern po_message_t po_next_message (po_message_iterator_t iterator);
 
84
 
 
85
 
 
86
/* =========================== po_message_t API ============================ */
 
87
 
 
88
/* Return the msgid (untranslated English string) of a message.  */
 
89
extern const char * po_message_msgid (po_message_t message);
 
90
 
 
91
/* Return the msgid_plural (untranslated English plural string) of a message,
 
92
   or NULL for a message without plural.  */
 
93
extern const char * po_message_msgid_plural (po_message_t message);
 
94
 
 
95
/* Return the msgstr (translation) of a message.
 
96
   Return the empty string for an untranslated message.  */
 
97
extern const char * po_message_msgstr (po_message_t message);
 
98
 
 
99
/* Return the msgstr[index] for a message with plural handling, or
 
100
   NULL when the index is out of range or for a message without plural.  */
 
101
extern const char * po_message_msgstr_plural (po_message_t message, int index);
 
102
 
 
103
/* Return true if the message is marked obsolete.  */
 
104
extern int po_message_is_obsolete (po_message_t message);
 
105
 
 
106
/* Return true if the message is marked fuzzy.  */
 
107
extern int po_message_is_fuzzy (po_message_t message);
 
108
 
 
109
/* Return true if the message is marked as being a format string of the given
 
110
   type (e.g. "c-format").  */
 
111
extern int po_message_is_format (po_message_t message, const char *format_type);
 
112
 
 
113
 
 
114
#ifdef __cplusplus
 
115
}
 
116
#endif
 
117
 
 
118
#endif /* _GETTEXT_PO_H */