Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dfa/agrep.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#endif

#include <idzebra/util.h>
#include <idzebra/version.h>
#include <dfa.h>
#include "imalloc.h"

Expand All @@ -62,14 +63,16 @@ static int show_lines = 0;

int agrep_options (int argc, char **argv)
{
char version_str[16];
zebra_get_version(version_str, NULL);
while (--argc > 0)
if (**++argv == '-')
while (*++*argv)
{
switch (**argv)
{
case 'V':
fprintf (stderr, "%s: %s %s\n", prog, __DATE__, __TIME__);
fprintf (stderr, "%s: %s\n", prog, version_str);
continue;
case 'v':
dfa_verbose = 1;
Expand Down
5 changes: 4 additions & 1 deletion dfa/lexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <stdarg.h>

#include <idzebra/util.h>
#include <idzebra/version.h>
#include <dfa.h>
#include "imalloc.h"
#include "lexer.h"
Expand All @@ -50,14 +51,16 @@ int ccluse = 0;

static int lexer_options (int argc, char **argv)
{
char version_str[16];
zebra_get_version(version_str, NULL);
while (--argc > 0)
if (**++argv == '-')
while (*++*argv)
{
switch (**argv)
{
case 'V':
fprintf (stderr, "%s: %s %s\n", prog, __DATE__, __TIME__);
fprintf (stderr, "%s: %s\n", prog, version_str);
continue;
case 's':
dfa_verbose = 1;
Expand Down
5 changes: 4 additions & 1 deletion isamb/benchindex1.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <it_key.h>
#include <idzebra/isamb.h>
#include <idzebra/dict.h>
#include <idzebra/version.h>
#include <assert.h>

struct index_block {
Expand Down Expand Up @@ -520,7 +521,9 @@ int main(int argc, char **argv)
const char *dict_info;
const char *type = "iso2709";
int int_count_enable = 1;
char version_str[16];

zebra_get_version(version_str, NULL);
while ((ret = options("im:t:c:N", argv, argc, &arg)) != -2)
{
switch(ret)
Expand Down Expand Up @@ -571,7 +574,7 @@ int main(int argc, char **argv)
exit(1);
}
}
printf("# benchindex1 %s %s\n", __DATE__, __TIME__);
printf("# benchindex1 %s\n", version_str);
printf("# isam_cache_size = %d\n", isam_cache_size);
printf("# dict_cache_size = %d\n", dict_cache_size);
printf("# int_count_enable = %d\n", int_count_enable);
Expand Down
5 changes: 2 additions & 3 deletions util/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#endif

#include <yaz/snprintf.h>
#include <string.h>
#include <idzebra/version.h>

void zebra_get_version(char *version_str, char *sha1_str)
{
if (version_str)
strcpy(version_str, ZEBRAVER);
yaz_snprintf(version_str, 16, "%s", ZEBRAVER);
if (sha1_str)
strcpy(sha1_str, ZEBRA_VERSION_SHA1);
yaz_snprintf(sha1_str, 65, "%s", ZEBRA_VERSION_SHA1);
}

/*
Expand Down