/*
* $Log: admin.c,v $
- * Revision 1.7 2000-04-05 07:39:54 adam
+ * Revision 1.8 2000-04-17 14:21:38 adam
+ * WIN32 update.
+ *
+ * Revision 1.7 2000/04/05 07:39:54 adam
* Added shared library support (libtool).
*
* Revision 1.6 2000/03/20 19:06:25 adam
#include <stdlib.h>
#include <time.h>
#include <assert.h>
+
+#ifdef WIN32
+
+#else
#include <dirent.h>
#include <fnmatch.h>
#include <sys/stat.h>
+#endif
+
#include <yaz/yaz-util.h>
#include <yaz/tcpip.h>
N.B. That in this case, the import may contain instructions to delete records as well as new or updates
to existing records */
+#ifdef WIN32
+int cmd_adm_import(char *arg)
+{
+ printf ("not available on WIN32\n");
+ return 0;
+}
+
+#else
+
int cmd_adm_import(char *arg)
{
char type_str[20], dir_str[1024], pattern_str[1024];
closedir(dir);
return 2;
}
+#endif
int cmd_adm_import2(char* arg)
{
- /* Size of chunks we wish to read from import file */
- size_t chunk_size = 8192;
-
- /* Buffer for reading chunks of data from import file */
- char chunk_buffer[chunk_size];
+ /* Buffer for reading chunks of data from import file */
+ char chunk_buffer[8192];
if ( arg )
{
# Makefile.mak - makefile for MS NMAKE
-# $Id: makefile,v 1.14 2000-03-02 08:48:21 adam Exp $
+# $Id: makefile,v 1.15 2000-04-17 14:21:38 adam Exp $
#
# Programmed by
# HL: Heikki Levanto, Index Data
default: all
-all: dirs proto_h dll client server ztest
+all: dirs proto_h dll client ztest
generate: generated_files
IMPLIB=$(LIBDIR)\Yaz.lib
CLIENT=$(BINDIR)\yaz-client.exe
-SERVER=$(LIBDIR)\server.lib
ZTEST=$(BINDIR)\yaz-ztest.exe
PROTOH=$(INCLDIR)\yaz\proto.h
# shortcut names defined here
dll : $(DLL)
client: $(CLIENT)
-server: $(SERVER)
ztest: $(ZTEST)
proto_h: $(PROTOH)
# TCL
TCL="C:\Program Files\Tcl\bin\tclsh82.exe"
+HAVE_TCL=0
COMMON_TCL_OPTIONS= ..\util\yaz-comp -I$(INCLDIR) -i yaz
# need to be specified, though
YAZ_CLIENT_OBJS= \
- $(OBJDIR)\client.obj
+ $(OBJDIR)\client.obj \
+ $(OBJDIR)\admin.obj
YAZ_SERVER_OBJS= \
"$(OBJDIR)\eventl.obj" \
ZTEST_OBJS= \
"$(OBJDIR)\read-grs.obj" \
"$(OBJDIR)\ztest.obj"
-
YAZ_ASN_OBJS= \
$(OBJDIR)\proto.obj \
$(OBJDIR)\zes-pquery.obj \
$(OBJDIR)\zes-psched.obj \
$(OBJDIR)\zes-pset.obj \
- $(OBJDIR)\zes-update0.obj
+ $(OBJDIR)\zes-update0.obj \
+ $(OBJDIR)\zes-admin.obj
ILL_OBJS= \
$(OBJDIR)\ill-get.obj\
$(OBJDIR)\item-req.obj
COMMON_YAZ_OBJS= \
- $(YAZ_COMSTACK_OBJS) \
- $(YAZ_ODR_OBJS) \
$(YAZ_UTIL_OBJS) \
+ $(YAZ_ODR_OBJS) \
+ $(YAZ_COMSTACK_OBJS) \
$(YAZ_ZUTIL_OBJS) \
- $(YAZ_RET_OBJS)
+ $(YAZ_RET_OBJS) \
+ $(YAZ_SERVER_OBJS)
!if $(NEW_Z3950)
YAZ_OBJS= \
$(COMMON_YAZ_OBJS) \
- $(ILL_OBJS) \
- $(Z3950_OBJS)
+ $(Z3950_OBJS) \
+ $(ILL_OBJS)
!else
YAZ_OBJS= \
$(COMMON_YAZ_OBJS) \
ALL_OBJS= \
$(YAZ_OBJS) \
$(YAZ_CLIENT_OBJS) \
- $(YAZ_SERVER_OBJS) \
$(ZTEST_OBJS)
############### Generated C and H files
###########################################################
+
Z3950_C_DIR=$(Z3950DIR)
ILL_C_DIR=$(ILLDIR)
#!!! Should be moved to OBJ, but that requires too much trickery
ESUPDATE_H_FILES = $(INCLDIR)\yaz\zes-update.h
ESUPDATE_C_FILES = $(Z3950_C_DIR)\zes-update.c
+# Files generated from esadmin.asn
+ESADMIN_H_FILES = $(INCLDIR)\yaz\zes-admin.h
+ESADMIN_C_FILES = $(Z3950_C_DIR)\zes-admin.c
+
# Files created from z3950v3.asn
Z3950V3_H_FILES= \
$(INCLDIR)\yaz\z-accdes1.h \
$(Z3950_C_DIR)\zes-pquery.c \
$(Z3950_C_DIR)\zes-psched.c \
$(Z3950_C_DIR)\zes-pset.c \
- $(Z3950_C_DIR)\zes-update0.c
+ $(Z3950_C_DIR)\zes-update0.c \
+ $(Z3950_C_DIR)\zes-admin.c
ILL_CORE_H_FILES= \
$(INCLDIR)\yaz\ill-core.h
DATETIME_FILES = $(DATETIME_H_FILES) $(DATETIME_C_FILES)
UNIVRES_FILES = $(UNIVRES_H_FILES) $(UNIVRES_C_FILES)
ESUPDATE_FILES = $(ESUPDATE_H_FILES) $(ESUPDATE_C_FILES)
+ESADMIN_FILES = $(ESADMIN_H_FILES) $(ESADMIN_C_FILES)
Z3950V3_FILES= $(Z3950V3_C_FILES) $(Z3950V3_H_FILES)
ILL_CORE_FILES= $(ILL_CORE_C_FILES) $(ILL_CORE_H_FILES)
ITEM_REQ_FILES= $(ITEM_REQ_C_FILES) $(ITEM_REQ_H_FILES)
$(GENERATED_C_FILES) \
$(PROTOH)
+
###########################################################
############### Compiling
###########################################################
############### ASN-generated files
+!if $(HAVE_TCL)
+
$(Z3950V3_FILES): $(Z3950DIR)\z3950v3.asn
@cd $(Z3950DIR)
$(TCL) $(TCLOPT) -d z.tcl z3950v3.asn
$(TCL) $(TCLOPT) -d z.tcl esupdate.asn
@cd $(WINDIR)
+$(ESADMIN_FILES): $(Z3950DIR)\esadmin.asn
+ @cd $(Z3950DIR)
+ $(TCL) $(TCLOPT) -d z.tcl esadmin.asn
+ @cd $(WINDIR)
+
$(ILL_CORE_FILES): $(ILLDIR)\ill9702.asn
@cd $(ILLDIR)
$(TCL) $(TCLOPT) -d ill.tcl ill9702.asn
$(TCL) $(TCLOPT) -d ill.tcl item-req.asn
@cd $(WINDIR)
+!endif
+
###########################################################
############### Linking
###########################################################
/out:$(CLIENT)
<<
-$(ZTEST) : "$(BINDIR)" $(ZTEST_OBJS) $(SERVER) $(DLL)
+$(ZTEST) : "$(BINDIR)" $(ZTEST_OBJS) $(DLL)
@echo Linking the ztest $(ZTEST)
$(LINK) @<<
$(LNKOPT)
$(LINK_LIBS)
shell32.lib
$(IMPLIB)
- $(SERVER)
$(ZTEST_OBJS)
/implib:"$(LIBDIR)/yaz-ztest.lib"
<<
-$(SERVER) : "$(BINDIR)" $(YAZ_SERVER_OBJS)
- @echo Linking the server $(SERVER)
- $(LINK) $(SERVER_LINK_OPTIONS) @<<
- /nologo
- $(IMPLIB)
- $(YAZ_SERVER_OBJS)
- /out:$(SERVER)
-<<
-
# note that this links a lib, so it uses completely different options.
-
-
###########################################################
############### Special operations
###########################################################
clean:
del $(DLL)
del $(CLIENT)
- del $(SERVER)
del $(ZTEST)
del $(TMPDIR)\*.
############### Explicit dependencies
###########################################################
-$(ALL_OBJS): makefile $(PROTOH)
+$(ALL_OBJS): $(PROTOH)
# force recompilation of everything, if makefile changed
###########################################################
#
# $Log: makefile,v $
-# Revision 1.14 2000-03-02 08:48:21 adam
+# Revision 1.15 2000-04-17 14:21:38 adam
+# WIN32 update.
+#
+# Revision 1.14 2000/03/02 08:48:21 adam
# Renamed ASN.1 compiler to yaz-comp (used to be yc.tcl).
#
# Revision 1.13 2000/02/28 11:13:03 adam
YAZ Compilation guidelines for winNT/95.
- $Id: windows.txt,v 1.3 1999-12-02 13:54:56 adam Exp $
+ $Id: windows.txt,v 1.4 2000-04-17 14:21:38 adam Exp $
This distribution of YAZ includes makefiles that works with Visual
C++ version 5 and 6. The makefile is located in sub directory 'win'.
The following components are build by the nmake process:
yaz.dll - This DLL is made of the source in all sub directories except
- for 'server', 'client' and 'ztest'. To export public functions
+ for 'client' and 'ztest'. To export public functions
the header files contain the modifier YAZ_EXPORT which is
defined in yconfig.h. The value of this modifier,
__declspec(dllexport), is probably specific to Visual C++.
-server.lib - The server library, which includes the source from
- 'server'. Unlike the UNIX version, the server library is
- multi-threaded.
-
yaz-client.exe - A Z39.50 client console application. It is linked with
the import library yaz.lib. This application searches for yaz.dll
during runtime.
yaz-ztest.exe - The Z39.50 test server as a console application. It is
- linked with the import library yaz.lib and the regular library
- server.lib. When running yaz-ztest make sure it is able to find
- the record test files dummy-records, dummy-grs, and dummy-words
- in the current directory.
+ linked with the import library yaz.lib. When running yaz-ztest
+ make sure it is able to find the record test files dummy-records,
+ dummy-grs, and dummy-words in the current directory.
As an option ztest may be installed as an NT service
(not Windows 95). Use 'ztest -install <otherargs>' to install