about summary refs log tree commit diff
path: root/locale/programs/locfile.h
diff options
context:
space:
mode:
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.  */