1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ 2 /* 3 * lt-database.h 4 * Copyright (C) 2011-2015 Akira TAGOH 5 * 6 * Authors: 7 * Akira TAGOH <akira@tagoh.org> 8 * 9 * You may distribute under the terms of either the GNU 10 * Lesser General Public License or the Mozilla Public 11 * License, as specified in the README file. 12 */ 13 #if !defined (__LANGTAG_H__INSIDE) && !defined (__LANGTAG_COMPILATION) 14 #error "Only <liblangtag/langtag.h> can be included directly." 15 #endif 16 17 #ifndef __LT_DATABASE_H__ 18 #define __LT_DATABASE_H__ 19 20 #include <liblangtag/lt-macros.h> 21 #include <liblangtag/lt-extlang-db.h> 22 #include <liblangtag/lt-grandfathered-db.h> 23 #include <liblangtag/lt-lang-db.h> 24 #include <liblangtag/lt-redundant-db.h> 25 #include <liblangtag/lt-region-db.h> 26 #include <liblangtag/lt-script-db.h> 27 #include <liblangtag/lt-variant-db.h> 28 #include <liblangtag/lt-relation-db.h> 29 30 LT_BEGIN_DECLS 31 32 typedef struct _lt_db_val_t lt_db_val_t; 33 34 /** 35 * lt_db_val_t: 36 * @lang: The placeholder to store the object of #lt_lang_db_t. 37 * @extlang: The placeholder to store the object of #lt_extlang_db_t. 38 * @script: The placeholder to sthre the object of #lt_script_db_t. 39 * @region: The placeholder to store the object of #lt_region_db_t. 40 * @variant: The placeholder to store the object of #lt_variant_db_t. 41 * @grandfathered: The placeholder to store the object of #lt_grandfathered_db_t. 42 * @redundant: The placeholder to store the object of #lt_redundant_db_t. 43 * @relation: The placeholder to store the object of #lt_relation_db_t. 44 * 45 * The database set of structure to peek instances of them. this is useful 46 * for the debugging purpose only. 47 */ 48 struct _lt_db_val_t { 49 lt_lang_db_t *lang; 50 lt_extlang_db_t *extlang; 51 lt_script_db_t *script; 52 lt_region_db_t *region; 53 lt_variant_db_t *variant; 54 lt_grandfathered_db_t *grandfathered; 55 lt_redundant_db_t *redundant; 56 lt_relation_db_t *relation; 57 }; 58 59 void lt_db_set_datadir (const char *path); 60 const char *lt_db_get_datadir (void); 61 void lt_db_set_val (lt_db_val_t *val); 62 void lt_db_initialize (void); 63 void lt_db_finalize (void); 64 lt_lang_db_t *lt_db_get_lang (void); 65 lt_extlang_db_t *lt_db_get_extlang (void); 66 lt_script_db_t *lt_db_get_script (void); 67 lt_region_db_t *lt_db_get_region (void); 68 lt_variant_db_t *lt_db_get_variant (void); 69 lt_grandfathered_db_t *lt_db_get_grandfathered(void); 70 lt_redundant_db_t *lt_db_get_redundant (void); 71 lt_relation_db_t *lt_db_get_relation (void); 72 73 LT_END_DECLS 74 75 #endif /* __LT_DATABASE_H__ */ 76