include them in the various implementation C files.
Added more headers in AC_CHECK_HEADERS.
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: admin.c,v 1.18 2005-01-15 19:47:08 adam Exp $
+ * $Id: admin.c,v 1.19 2005-01-16 21:51:49 adam Exp $
*/
#include <stdio.h>
#include <time.h>
#include <assert.h>
-#if HAVE_FNMATCH_H
+#if HAVE_DIRENT_H
#include <dirent.h>
+#endif
+#if HAVE_FNMATCH_H
#include <fnmatch.h>
+#endif
+#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: bertorture.c,v 1.2 2005-01-15 19:47:08 adam Exp $
+ * $Id: bertorture.c,v 1.3 2005-01-16 21:51:49 adam Exp $
*/
#include <signal.h>
+#if HAVE_SYS_TYPES_H
#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif
#include <fcntl.h>
+#if HAVE_UNISTD_H
#include <unistd.h>
+#endif
+
#include <stdlib.h>
#include <stdio.h>
dnl YAZ Toolkit, Index Data 1994-2005
dnl See the file LICENSE for details.
-dnl $Id: configure.in,v 1.167 2005-01-11 12:13:18 adam Exp $
+dnl $Id: configure.in,v 1.168 2005-01-16 21:51:49 adam Exp $
AC_INIT(include/yaz/yaz-version.h)
AM_INIT_AUTOMAKE(yaz, 2.0.32)
AM_MAINTAINER_MODE
dnl
dnl
dnl ------ Headers
-AC_CHECK_HEADERS(fnmatch.h wchar.h locale.h langinfo.h)
+AC_CHECK_HEADERS(dirent.h fnmatch.h wchar.h locale.h langinfo.h pwd.h sys/poll.h sys/select.h sys/socket.h sys/stat.h sys/time.h sys/types.h sys/un.h sys/wait.h unistd.h)
AC_HEADER_STDC
if test "$ac_cv_header_stdc" = "no"; then
AC_MSG_WARN(Your system doesn't seem to support ANSI C)
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
- * $Id: comstack.h,v 1.18 2005-01-15 19:47:09 adam Exp $
+ * $Id: comstack.h,v 1.19 2005-01-16 21:51:49 adam Exp $
*/
/**
#define COMSTACK_H
#include <yaz/yconfig.h>
-
-#ifndef _VMS_
-
-# ifdef WIN32
-
-# include <winsock.h>
-
-# else /* #ifdef WIN32 */
-# include <sys/types.h>
-# include <sys/time.h>
-# include <sys/wait.h>
-
-# include <netinet/in.h>
-# include <sys/socket.h>
-# include <netdb.h>
-# include <arpa/inet.h>
-
-# ifdef _AIX
-# include <sys/select.h>
-# endif
-
-# ifndef O_BINARY
-# define O_BINARY 0
-# endif
-
-# endif
-#endif /* ifndef _VMS_ */
-
#include <yaz/oid.h>
#include <yaz/xmalloc.h>
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
- * $Id: xmalloc.h,v 1.5 2005-01-15 19:47:10 adam Exp $
+ * $Id: xmalloc.h,v 1.6 2005-01-16 21:51:49 adam Exp $
*/
/**
* \file xmalloc.h
#ifndef XMALLOC_H
#define XMALLOC_H
-#include <sys/types.h>
-#include <stdlib.h>
+#include <stddef.h>
#include <yaz/yconfig.h>
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: ber_int.c,v 1.3 2005-01-15 19:47:11 adam Exp $
+ * $Id: ber_int.c,v 1.4 2005-01-16 21:51:50 adam Exp $
*/
/**
#include <string.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
#ifdef WIN32
#include <winsock.h>
#else
-#include <sys/types.h>
#include <netinet/in.h>
#endif
switch (o->direction)
{
- case ODR_DECODE:
- if ((res = ber_decinteger(o->bp, val, odr_max(o))) <= 0)
- {
- odr_seterror(o, OPROTO, 50);
- return 0;
- }
- o->bp += res;
- return 1;
- case ODR_ENCODE:
- if ((res = ber_encinteger(o, *val)) < 0)
- return 0;
- return 1;
- case ODR_PRINT: return 1;
- default: odr_seterror(o, OOTHER, 51); return 0;
+ case ODR_DECODE:
+ if ((res = ber_decinteger(o->bp, val, odr_max(o))) <= 0)
+ {
+ odr_seterror(o, OPROTO, 50);
+ return 0;
+ }
+ o->bp += res;
+ return 1;
+ case ODR_ENCODE:
+ if ((res = ber_encinteger(o, *val)) < 0)
+ return 0;
+ return 1;
+ case ODR_PRINT:
+ return 1;
+ default:
+ odr_seterror(o, OOTHER, 51); return 0;
}
}
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: seshigh.c,v 1.44 2005-01-15 19:47:14 adam Exp $
+ * $Id: seshigh.c,v 1.45 2005-01-16 21:51:50 adam Exp $
*/
/**
* \file seshigh.c
#include <stdlib.h>
#include <stdio.h>
+#include <assert.h>
+#include <ctype.h>
+
+#if HAVE_SYS_TYPES_H
#include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
#ifdef WIN32
#include <io.h>
#define S_ISREG(x) (x & _S_IFREG)
#include <process.h>
-#include <sys/stat.h>
-#else
-#include <sys/stat.h>
+#endif
+
+#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <assert.h>
-#include <ctype.h>
#include <yaz/yconfig.h>
#include <yaz/xmalloc.h>
assoc->init->implementation_name,
odr_prepend(assoc->encode, "GFS", resp->implementationName));
- version = odr_strdup(assoc->encode, "$Revision: 1.44 $");
+ version = odr_strdup(assoc->encode, "$Revision: 1.45 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
resp->implementationVersion = odr_prepend(assoc->encode,
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: session.h,v 1.3 2005-01-15 19:47:14 adam Exp $
+ * $Id: session.h,v 1.4 2005-01-16 21:51:50 adam Exp $
*/
/**
* \file session.h
#ifndef SESSION_H
#define SESSION_H
-#include <sys/types.h>
#include <yaz/comstack.h>
#include <yaz/odr.h>
#include <yaz/oid.h>
* NT threaded server code by
* Chas Woodfield, Fretwell Downing Informatics.
*
- * $Id: statserv.c,v 1.18 2005-01-15 19:47:14 adam Exp $
+ * $Id: statserv.c,v 1.19 2005-01-16 21:51:50 adam Exp $
*/
/**
#include <winsock.h>
#include <direct.h>
#include "service.h"
-#else
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#if HAVE_UNISTD_H
#include <unistd.h>
+#endif
+#if HAVE_PWD_H
#include <pwd.h>
#endif
static int max_sessions = 0;
-static int logbits_set=0;
-static int log_session=0;
-static int log_server=0;
+static int logbits_set = 0;
+static int log_session = 0;
+static int log_server = 0;
/** get_logbits sets global loglevel bits */
static void get_logbits(int force)
{ /* needs to be called after parsing cmd-line args that can set loglevels!*/
if (force || !logbits_set)
{
- logbits_set=1;
- log_session=yaz_log_module_level("session");
- log_server=yaz_log_module_level("server");
+ logbits_set = 1;
+ log_session = yaz_log_module_level("session");
+ log_server = yaz_log_module_level("server");
}
}
#endif
#ifdef WIN32
- sep='\\';
+ sep = '\\';
#else
- sep='/';
+ sep = '/';
#endif
if ((me = strrchr (argv[0], sep)))
me++; /* get the basename */
else
me = argv[0];
- programname=argv[0];
+ programname = argv[0];
if (control_block.options_func(argc, argv))
return(1);
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: tcpdchk.c,v 1.5 2005-01-15 19:47:14 adam Exp $
+ * $Id: tcpdchk.c,v 1.6 2005-01-16 21:51:50 adam Exp $
*/
/**
* \file tcpdchk.c
#include <stdio.h>
#include <string.h>
+#ifdef WIN32
+#include <winsock.h>
+#else
+#include <netdb.h>
+#include <arpa/inet.h>
+#endif
+
#include <yaz/yconfig.h>
#include <yaz/comstack.h>
#include <yaz/statserv.h>
#include <syslog.h>
#include <tcpd.h>
-
int allow_severity = LOG_INFO; /* not YLOG !! */
int deny_severity = LOG_WARNING;
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: tcpip.c,v 1.13 2005-01-15 19:47:14 adam Exp $
+ * $Id: tcpip.c,v 1.14 2005-01-16 21:51:50 adam Exp $
*/
/**
* \file tcpip.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#ifdef WIN32
+#include <winsock.h>
#else
-#include <unistd.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <arpa/inet.h>
+#include <netinet/tcp.h>
+#endif
+
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_SYS_WAIT_H
+#include <sys/wait.h>
#endif
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
#if HAVE_OPENSSL_SSL_H
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <yaz/tcpip.h>
#include <yaz/nmem.h>
-#ifdef WIN32
-#else
-#include <netinet/tcp.h>
-#endif
-
static int tcpip_close(COMSTACK h);
static int tcpip_put(COMSTACK h, char *buf, int size);
static int tcpip_get(COMSTACK h, char **buf, int *bufsize);
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: unix.c,v 1.8 2005-01-15 19:47:14 adam Exp $
+ * $Id: unix.c,v 1.9 2005-01-16 21:51:50 adam Exp $
* UNIX socket COMSTACK. By Morten Bøgeskov.
*/
/**
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <unistd.h>
#include <errno.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#include <fcntl.h>
#include <signal.h>
#include <grp.h>
+#if HAVE_PWD_H
#include <pwd.h>
+#endif
+#if HAVE_SYS_TYPES_H
#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
+#endif
+#if HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif
+#if HAVE_SYS_UN_H
#include <sys/un.h>
+#endif
-#include <yaz/comstack.h>
#include <yaz/unix.h>
#include <yaz/nmem.h>
p->blocking = blocking;
return 1;
}
-#endif
+#endif /* WIN32 */