More EasyTree compatibility.
[gedcom-parse.git] / t / src / pathtest.c
1 /* Test program for the Gedcom library.
2    Copyright (C) 2001, 2002 The Genes Development Team
3    This file is part of the Gedcom parser library.
4    Contributed by Peter Verthez <Peter.Verthez@advalvas.be>, 2001.
5
6    The Gedcom parser library is free software; you can redistribute it
7    and/or modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10
11    The Gedcom parser library is distributed in the hope that it will be
12    useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public
17    License along with the Gedcom parser library; if not, write to the
18    Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19    02111-1307 USA.  */
20
21 /* $Id$ */
22 /* $Name$ */
23
24 #include <stdlib.h>
25 #include <string.h>
26 #include "config.h"
27 #include "gedcom.h"
28
29 int check_gconv_path()
30 {
31 #ifdef USE_GLIBC_ICONV
32   char* path = getenv("GCONV_PATH");
33   if (path == NULL || strstr(path, PKGDATADIR) == NULL)
34     return 1;
35 #endif
36   return 0;
37 }
38
39 int main(int argc, char* argv[])
40 {
41   char* path;
42   /* This checks whether the constructor in encoding.c is doing its work
43      properly */
44   gedcom_init();
45   exit(check_gconv_path());
46 }