dnl Zebra, Index Data ApS, 1995-2007
-dnl $Id: configure.ac,v 1.59 2007-05-16 10:50:03 adam Exp $
+dnl $Id: configure.ac,v 1.60 2007-08-27 17:22:22 adam Exp $
dnl
AC_PREREQ(2.59)
AC_INIT([idzebra],[2.0.15],[zebra-help@indexdata.dk])
AC_PROG_CC
AC_PROG_CPP
AM_PROG_LIBTOOL
+AC_DEFINE_UNQUOTED(HOST_TRIPLET,"${host}")
dnl
dnl ------ headers
AC_CHECK_HEADERS([sys/resource.h sys/time.h sys/wait.h sys/utsname.h unistd.h])
-/* $Id: version.h,v 1.22 2007-05-16 10:50:03 adam Exp $
+/* $Id: version.h,v 1.23 2007-08-27 17:22:22 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
*/
-#ifndef ZEBRAVER
+#ifndef IDZEBRA_VERSION_H
+#define IDZEBRA_VERSION_H
+
+#include <yaz/yconfig.h>
+
+YAZ_BEGIN_CDECL
+
#define ZEBRAVER "2.0.15"
-#define ZEBRADATE "$Date: 2007-05-16 10:50:03 $"
+#define ZEBRADATE "$Date: 2007-08-27 17:22:22 $"
+
+/** \brief Returns Zebra version and system info.
+ \param version_str buffer for version (at least 16 bytes)
+ \param sys_str buffer for system info (at least 80 bytes)
+ \returns version as integer
+*/
+YAZ_EXPORT
+void zebra_get_version(char *version_str, char *sys_str);
+
+YAZ_END_CDECL
#endif
/*
-/* $Id: zebraapi.c,v 1.257 2007-08-21 11:06:47 adam Exp $
+/* $Id: zebraapi.c,v 1.258 2007-08-27 17:22:22 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
ZebraService zebra_start_res(const char *configName, Res def_res, Res over_res)
{
Res res;
+ char version_str[16];
+ char system_str[80];
zebra_flock_init();
log_level_initialized = 1;
}
- yaz_log(YLOG_LOG, "zebra_start %s %s", ZEBRAVER,
+ zebra_get_version(version_str, system_str);
+
+ yaz_log(YLOG_LOG, "zebra_start %s %s", version_str,
configName ? configName : "");
if ((res = res_open(def_res, over_res)))
-/* $Id: zebraidx.c,v 1.5 2007-04-17 20:27:14 adam Exp $
+/* $Id: zebraidx.c,v 1.6 2007-08-27 17:22:22 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
#include <yaz/log.h>
#include <yaz/options.h>
+#include <idzebra/version.h>
#include <idzebra/api.h>
char *prog;
}
else if (ret == 'V')
{
- printf("Zebra %s %s\n", ZEBRAVER, ZEBRADATE);
- printf(" (C) 1994-2007, Index Data ApS\n");
-#ifdef WIN32
-#ifdef _DEBUG
- printf(" WIN32 Debug\n");
-#else
- printf(" WIN32 Release\n");
-#endif
-#endif
-#if HAVE_BZLIB_H
- printf("Using: libbzip2, (C) 1996-1999 Julian R Seward. All rights reserved.\n");
-#endif
+ char version_str[20];
+ char sys_str[80];
+ zebra_get_version(version_str, sys_str);
+
+ printf("Zebra %s\n", version_str);
+ printf("(C) 1994-2007, Index Data ApS\n");
+ printf("Zebra is free software, covered by the GNU General Public License, and you are\n");
+ printf("welcome to change it and/or distribute copies of it under certain conditions.\n");
+ printf("Configured as: %s\n", sys_str);
+ if (strcmp(version_str, ZEBRAVER))
+ printf("zebraidx compiled version %s\n", ZEBRAVER);
}
else if (ret == 'v')
yaz_log_init_level (yaz_log_mask_str(arg));
-/* $Id: zebrasrv.c,v 1.18 2007-08-22 08:13:00 adam Exp $
+/* $Id: zebrasrv.c,v 1.19 2007-08-27 17:22:22 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
struct statserv_options_block *sob;
char *user = NULL;
char *passwd = NULL;
+ char version_str[16];
r->errcode = 0;
r->errstring = 0;
q->bend_fetch = bend_fetch;
q->bend_scan = bend_scan;
+ zebra_get_version(version_str, 0);
+
q->implementation_name = "Zebra Information Server";
- q->implementation_version = "Zebra " ZEBRAVER;
+ q->implementation_version = odr_strdup(q->stream, version_str);
yaz_log (YLOG_DEBUG, "bend_init");
-## $Id: Makefile.am,v 1.32 2007-05-16 10:57:06 adam Exp $
+## $Id: Makefile.am,v 1.33 2007-08-27 17:22:22 adam Exp $
noinst_LTLIBRARIES = libidzebra-util.la
AM_CPPFLAGS = -I$(srcdir)/../include $(YAZINC) -DDEFAULT_PROFILE_PATH=\"$(pkgdatadir)/tab\"
LDADD = libidzebra-util.la $(YAZLALIB)
-libidzebra_util_la_SOURCES = zint.c res.c charmap.c zebramap.c passwddb.c \
- zebra-lock.c dirent.c xpath.c atoi_zn.c snippet.c flock.c attrfind.c \
- exit.c it_key.c su_codec.c
+libidzebra_util_la_SOURCES = version.c zint.c res.c charmap.c zebramap.c \
+ passwddb.c zebra-lock.c dirent.c xpath.c atoi_zn.c snippet.c flock.c \
+ attrfind.c exit.c it_key.c su_codec.c
tstpass_SOURCES = tstpass.c
--- /dev/null
+/* $Id: version.c,v 1.1 2007-08-27 17:22:22 adam Exp $
+ Copyright (C) 1995-2007
+ Index Data ApS
+
+This file is part of the Zebra server.
+
+Zebra 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
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+
+/**
+ * \file version.c
+ * \brief Implements Zebra version utilities.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+#include <idzebra/version.h>
+
+void zebra_get_version(char *version_str, char *sys_str)
+{
+ if (version_str)
+ strcpy(version_str, ZEBRAVER);
+ if (sys_str)
+ {
+ strcpy(sys_str, "unknown");
+
+#ifdef WIN32
+ strcpy(sys_str, "win32");
+#endif
+
+#ifdef HOST_TRIPLET
+ strcpy(sys_str, HOST_TRIPLET);
+#endif
+ }
+}
+
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+