summaryrefslogtreecommitdiff
path: root/categories.h
diff options
context:
space:
mode:
authorKonstantin <ria.freelander@gmail.com>2016-05-04 13:24:34 +0300
committerKonstantin <ria.freelander@gmail.com>2016-05-04 13:24:34 +0300
commita24e4fa0b990214b369b59704193eb64be27483c (patch)
treedc9fc5b6f6a3de9903cd968c5f6d4d9e7178032b /categories.h
downloadmusl-locales-a24e4fa0b990214b369b59704193eb64be27483c.tar.gz
musl-locales-a24e4fa0b990214b369b59704193eb64be27483c.tar.bz2
musl-locales-a24e4fa0b990214b369b59704193eb64be27483c.tar.xz
musl-locales-a24e4fa0b990214b369b59704193eb64be27483c.zip
First working version.
Diffstat (limited to 'categories.h')
-rw-r--r--categories.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/categories.h b/categories.h
new file mode 100644
index 0000000..9a5bec0
--- /dev/null
+++ b/categories.h
@@ -0,0 +1,32 @@
+#ifndef CATEGORIES_H
+#define CATEGORIES_H
+
+#include <locale.h>
+#include <langinfo.h>
+
+#define CAT_TYPE_STRING 0
+#define CAT_TYPE_STRINGARRAY 1
+#define CAT_TYPE_STRINGLIST 2
+#define CAT_TYPE_BYTE 3
+#define CAT_TYPE_BYTEARRAY 4
+#define CAT_TYPE_WORD 4
+#define CAT_TYPE_WORDARRAY 5
+#define CAT_TYPE_END 6
+
+#define LC_INVAL -1
+
+typedef int cat_type;
+
+struct cat_item
+{
+ nl_item id;
+ const char* name;
+ cat_type type;
+ int min;
+ int max;
+};
+const struct cat_item get_cat_item_for_name(const char* name);
+const struct cat_item* get_cat_for_locale_cat(int locale_cat);
+int get_cat_num_for_name(const char *cat_name);
+const char* get_name_for_cat(int cat_no);
+#endif // CATEGORIES_H