X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fdatabase.c;h=2b40874a94f3e2a365164eec850c8550dd66d689;hb=f747f871c170d911519cb85165309fcfcc516970;hp=30d8a8458cf162cd165584df189e9e9344f93b0c;hpb=5a145dc87e4756afc3e247cded32a9666457f065;p=pazpar2-moved-to-github.git diff --git a/src/database.c b/src/database.c index 30d8a84..2b40874 100644 --- a/src/database.c +++ b/src/database.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2008 Index Data + Copyright (C) 2006-2009 Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -17,11 +17,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif + #include #include -#include -#include -#include #include #include #include @@ -33,9 +34,15 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "zeerex.h" #include +#if HAVE_SYS_SOCKET_H #include +#endif +#if HAVE_NETDB_H #include +#endif +#if HAVE_NETINET_IN_H #include +#endif static struct host *hosts = 0; // The hosts we know about static struct database *databases = 0; // The databases we know about @@ -124,7 +131,7 @@ static struct database *load_database(const char *id) if ((dbname = strchr(hostport, '/'))) *(dbname++) = '\0'; else - dbname = "Default"; + dbname = ""; if (!(host = find_host(hostport))) return 0; db = nmem_malloc(nmem, sizeof(*db)); @@ -283,7 +290,9 @@ int predef_grep_databases(void *context, struct database_criterion *cl, /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ +