aboutsummaryrefslogtreecommitdiff
path: root/locale/programs/locfile.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard@codesourcery.com>2013-09-06 17:20:45 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-09-06 17:20:45 +0000
commit1ecbb381aeed75d52f8abf47e03a31bb8212984e (patch)
treef6244ddf2f45891065af57085bc81775c83142c3 /locale/programs/locfile.h
parent2618d9db2da5d5f59adb8120fc6b58d8f96f5528 (diff)
downloadglibc-1ecbb381aeed75d52f8abf47e03a31bb8212984e.tar
glibc-1ecbb381aeed75d52f8abf47e03a31bb8212984e.tar.gz
glibc-1ecbb381aeed75d52f8abf47e03a31bb8212984e.tar.bz2
glibc-1ecbb381aeed75d52f8abf47e03a31bb8212984e.zip
Make localedef output generation use more logical interfaces.
Diffstat (limited to 'locale/programs/locfile.h')
-rw-r--r--locale/programs/locfile.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/locale/programs/locfile.h b/locale/programs/locfile.h
index 83bf421ece..bdd87cc426 100644
--- a/locale/programs/locfile.h
+++ b/locale/programs/locfile.h
@@ -21,15 +21,17 @@
#include <stdint.h>
#include <sys/uio.h>
+#include "obstack.h"
#include "linereader.h"
#include "localedef.h"
-
-/* Header of the locale data files. */
+/* Structure for storing the contents of a category file. */
struct locale_file
{
- int magic;
- int n;
+ size_t n_elements, next_element;
+ uint32_t *offsets;
+ struct obstack data;
+ int structure_stage;
};
@@ -66,9 +68,26 @@ extern void write_all_categories (struct localedef_t *definitions,
const char *output_path);
/* Write out the data. */
+extern void init_locale_data (struct locale_file *file, size_t n_elements);
+extern void align_locale_data (struct locale_file *file, size_t boundary);
+extern void add_locale_empty (struct locale_file *file);
+extern void add_locale_raw_data (struct locale_file *file, const void *data,
+ size_t size);
+extern void add_locale_raw_obstack (struct locale_file *file,
+ struct obstack *obstack);
+extern void add_locale_string (struct locale_file *file, const char *string);
+extern void add_locale_wstring (struct locale_file *file,
+ const uint32_t *string);
+extern void add_locale_uint32 (struct locale_file *file, uint32_t value);
+extern void add_locale_uint32_array (struct locale_file *file,
+ const uint32_t *data, size_t n_elems);
+extern void add_locale_char (struct locale_file *file, char value);
+extern void start_locale_structure (struct locale_file *file);
+extern void end_locale_structure (struct locale_file *file);
+extern void start_locale_prelude (struct locale_file *file);
+extern void end_locale_prelude (struct locale_file *file);
extern void write_locale_data (const char *output_path, int catidx,
- const char *category, size_t n_elem,
- struct iovec *vec);
+ const char *category, struct locale_file *file);
/* Entrypoints for the parsers of the individual categories. */