Create a C-based API in addition to the C++-based API in <ucd/ucd.h>.

This commit is contained in:
Reece H. Dunn
2016-05-30 22:29:04 +01:00
parent bddb25bdc7
commit 454038dbfa
9 changed files with 754 additions and 220 deletions
+16 -1
View File
@@ -1,6 +1,6 @@
/* Enumeration types to string.
*
* Copyright (C) 2012-2014 Reece H. Dunn
* Copyright (C) 2012-2016 Reece H. Dunn
*
* This file is part of ucd-tools.
*
@@ -20,6 +20,11 @@
#include "ucd/ucd.h"
const char *ucd_get_category_group_string(ucd_category_group c)
{
return ucd::get_category_group_string((ucd::category_group)c);
}
const char *ucd::get_category_group_string(category_group c)
{
switch (c)
@@ -36,6 +41,11 @@ const char *ucd::get_category_group_string(category_group c)
}
}
const char *ucd_get_category_string(ucd_category c)
{
return ucd::get_category_string((ucd::category)c);
}
const char *ucd::get_category_string(category c)
{
switch (c)
@@ -75,6 +85,11 @@ const char *ucd::get_category_string(category c)
}
}
const char *ucd_get_script_string(ucd_script s)
{
return ucd::get_script_string((ucd::script)s);
}
const char *ucd::get_script_string(script s)
{
static const char *scripts[] =