Line data Source code
1 : /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 : /*
3 : * extlang.c
4 : * Copyright (C) 2011-2012 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 : #ifdef HAVE_CONFIG_H
14 : #include "config.h"
15 : #endif
16 :
17 : #include <stdio.h>
18 : #include <locale.h>
19 : #include "langtag.h"
20 : #include "lt-utils.h"
21 :
22 : int
23 0 : main(int argc,
24 : char **argv)
25 : {
26 : lt_extlang_db_t *extlangdb;
27 :
28 0 : setlocale(LC_ALL, "");
29 :
30 0 : lt_db_set_datadir(TEST_DATADIR);
31 0 : extlangdb = lt_extlang_db_new();
32 :
33 0 : if (lt_strcmp0(argv[1], "list") == 0) {
34 0 : } else if (lt_strcmp0(argv[1], "lookup") == 0) {
35 0 : lt_extlang_t *extlang = lt_extlang_db_lookup(extlangdb, argv[2]);
36 :
37 0 : if (extlang) {
38 0 : printf("desc: %s\n", lt_extlang_get_name(extlang));
39 0 : printf("lang: %s\n", lt_extlang_get_macro_language(extlang));
40 0 : lt_extlang_unref(extlang);
41 : } else {
42 0 : printf("no such extlang: %s\n", argv[2]);
43 : }
44 : }
45 :
46 0 : lt_extlang_db_unref(extlangdb);
47 :
48 0 : return 0;
49 : }
|