00001 /* 00002 * Copyright (c) 2006-2009 Ed Schouten <ed@80386.nl> 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 1. Redistributions of source code must retain the above copyright 00009 * notice, this list of conditions and the following disclaimer. 00010 * 2. Redistributions in binary form must reproduce the above copyright 00011 * notice, this list of conditions and the following disclaimer in the 00012 * documentation and/or other materials provided with the distribution. 00013 * 00014 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 00015 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00016 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00017 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 00018 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00019 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00020 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00021 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00022 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00023 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00024 * SUCH DAMAGE. 00025 */ 00026 00027 /* Teach glibc a little lesson */ 00028 #ifndef _GNU_SOURCE 00029 #define _GNU_SOURCE 00030 #endif /* !_GNU_SOURCE */ 00031 #undef _FORTIFY_SOURCE 00032 00033 #include <sys/param.h> 00034 #include <sys/stat.h> 00035 #include <sys/types.h> 00036 #include <ctype.h> 00037 #include <errno.h> 00038 #include <fcntl.h> 00039 #ifdef BUILD_NLS 00040 #include <locale.h> 00041 #endif /* BUILD_NLS */ 00042 #include <regex.h> 00043 #include <signal.h> 00044 #include <stdint.h> 00045 #include <stdio.h> 00046 #include <stdlib.h> 00047 #include <string.h> 00048 #include <time.h> 00049 #include <unistd.h> 00050 00051 #ifndef BUILD_DEBUG 00052 #define G_DISABLE_ASSERT 00053 #endif /* !BUILD_DEBUG */ 00054 00055 #include <glib.h> 00056 #ifdef BUILD_NLS 00057 #include <glib/gi18n.h> 00058 #else /* !BUILD_NLS */ 00059 #define _(str) str 00060 #endif /* BUILD_NLS */ 00061 00062 #ifdef G_THREADS_IMPL_POSIX 00063 #include <pthread.h> 00064 #endif /* G_THREADS_IMPL_POSIX */ 00065 #ifdef G_OS_UNIX 00066 #include <pwd.h> 00067 #ifdef BUILD_RES_INIT 00068 #include <netinet/in.h> 00069 #include <resolv.h> 00070 #endif /* BUILD_RES_INIT */ 00071 #endif /* G_OS_UNIX */ 00072 00073 #define CONFHOMEDIR "~" G_DIR_SEPARATOR_S "." APP_NAME G_DIR_SEPARATOR_S
1.6.3