X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=client%2Fadmin.c;h=e20825c1d61bfb3970495bc8e4b83ffa10d715da;hp=4e6834811690f1bc846488c73e70b5e3b99347f1;hb=fd4adcc80d442f84c6a1894e890b1b6ccd02615e;hpb=7acd51b7cdffca5ad92a777d2c6e8e9bae1f9fd3 diff --git a/client/admin.c b/client/admin.c index 4e68348..e20825c 100644 --- a/client/admin.c +++ b/client/admin.c @@ -1,37 +1,23 @@ /* - * $Log: admin.c,v $ - * 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 - * Added Segment request for fronend server. Work on admin for client. - * - * Revision 1.5 2000/03/17 12:47:02 adam - * Minor changes to admin client. - * - * Revision 1.4 2000/03/16 13:55:49 ian - * Added commands for sending shutdown and startup admin requests via the admin ES. - * - * Revision 1.3 2000/03/14 15:23:17 ian - * Removed unwanted ifdef and include of zes-admin.h - * - * Revision 1.2 2000/03/14 14:06:04 ian - * Minor change to order of debugging output for send_apdu, - * fixed encoding of admin request. - * - * Revision 1.1 2000/03/14 09:27:07 ian - * Added code to enable sending of admin extended service requests - * + * Copyright (c) 1995-2001, Index Data + * See the file LICENSE for details. * + * $Id: admin.c,v 1.11 2001-11-13 23:00:42 adam Exp $ */ #include #include #include #include + +#ifdef WIN32 + +#else #include #include #include +#endif + #include #include @@ -45,7 +31,6 @@ #include -#ifdef ASN_COMPILED /* Helper functions to get to various statics in the client */ ODR getODROutputStream(); @@ -192,6 +177,15 @@ int cmd_adm_drop(char* arg) 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]; @@ -201,6 +195,7 @@ int cmd_adm_import(char *arg) struct dirent *ent; int chunk = 10; Z_APDU *apdu = 0; + Z_Segment *segment = 0; ODR out = getODROutputStream(); if (arg && sscanf (arg, "%19s %1023s %1023s", type_str, @@ -231,9 +226,8 @@ int cmd_adm_import(char *arg) if (S_ISREG(status.st_mode) && (inf = fopen(fname, "r"))) { - Z_Segment *segment; Z_NamePlusRecord *rec; - Odr_oct *oct = odr_malloc (out, sizeof(*oct)); + Odr_oct *oct = (Odr_oct *) odr_malloc (out, sizeof(*oct)); if (!apdu) { @@ -252,7 +246,7 @@ int cmd_adm_import(char *arg) rec->u.intermediateFragment->u.notExternallyTagged = oct; oct->len = oct->size = status.st_size; - oct->buf = odr_malloc (out, oct->size); + oct->buf = (unsigned char *) odr_malloc (out, oct->size); fread (oct->buf, 1, oct->size, inf); fclose (inf); @@ -273,14 +267,12 @@ int cmd_adm_import(char *arg) 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 ) { @@ -368,4 +360,3 @@ int cmd_adm_startup(char* arg) sendAdminES(Z_ESAdminOriginPartToKeep_start, NULL); return 2; } -#endif