* Sebastian Hammer, Adam Dickmeiss
*
* $Log: bfile.c,v $
- * Revision 1.21 1996-10-29 13:56:13 adam
+ * Revision 1.22 1997-09-09 13:37:52 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.21 1996/10/29 13:56:13 adam
* Include of zebrautl.h instead of alexutil.h.
*
* Revision 1.20 1996/03/26 15:59:04 adam
#include <stdlib.h>
#include <string.h>
#include <assert.h>
+#ifdef WINDOWS
+#include <io.h>
+#else
#include <unistd.h>
+#endif
#include <zebrautl.h>
#include <bfile.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: mfile.c,v $
- * Revision 1.22 1997-09-04 13:56:39 adam
+ * Revision 1.23 1997-09-09 13:37:53 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.22 1997/09/04 13:56:39 adam
* Added O_BINARY to open calls.
*
* Revision 1.21 1996/10/29 13:56:18 adam
#include <sys/types.h>
#include <fcntl.h>
+#ifdef WINDOWS
+#include <io.h>
+#else
#include <unistd.h>
-#include <dirent.h>
+#endif
+#include <direntz.h>
+#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: agrep.c,v $
- * Revision 1.9 1996-10-29 13:57:18 adam
+ * Revision 1.10 1997-09-09 13:37:57 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.9 1996/10/29 13:57:18 adam
* Include of zebrautl.h instead of alexutil.h.
*
* Revision 1.8 1996/01/08 09:09:16 adam
#include <sys/types.h>
#include <sys/stat.h>
-#include <fcntl.h>
+#include <fcntl.h>\r
+#ifdef WINDOWS\r
+#include <io.h>\r
+#else
#include <unistd.h>
-
+#endif
#include <zebrautl.h>
#include <dfa.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dclose.c,v $
- * Revision 1.3 1994-09-01 17:49:36 adam
+ * Revision 1.4 1997-09-09 13:38:01 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.3 1994/09/01 17:49:36 adam
* Removed stupid line. Work on insertion in dictionary. Not finished yet.
*
*/
#include <sys/types.h>
#include <fcntl.h>
-#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dopen.c,v $
- * Revision 1.3 1994-09-01 17:49:37 adam
+ * Revision 1.4 1997-09-09 13:38:01 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.3 1994/09/01 17:49:37 adam
* Removed stupid line. Work on insertion in dictionary. Not finished yet.
*
*/
#include <sys/types.h>
#include <fcntl.h>
+#ifndef WINDOWS
#include <unistd.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: drdwr.c,v $
- * Revision 1.8 1995-01-24 11:25:11 adam
+ * Revision 1.9 1997-09-09 13:38:01 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.8 1995/01/24 11:25:11 adam
* Removed stupid assertion.
*
* Revision 1.7 1994/10/05 10:47:15 adam
#include <sys/types.h>
#include <fcntl.h>
+#ifndef WINDOWS
#include <unistd.h>
+#endif
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
--- /dev/null
+/*
+ * Copyright (c) 1997, Index Data.
+ * See the file LICENSE for details.
+ * Sebastian Hammer, Adam Dickmeiss
+ *
+ * $Log: direntz.h,v $
+ * Revision 1.1 1997-09-09 13:38:03 adam
+ * Partial port to WIN95/NT.
+ *
+ *
+ */
+#ifdef WINDOWS
+#include <windows.h>
+struct dirent {
+ char d_name[MAX_PATH+1];
+};
+
+typedef struct DIR DIR;
+
+DIR *opendir (const char *path);
+struct dirent *readdir (DIR *dd);
+void closedir (DIR *dd);
+#else
+#include <dirent.h>
+#endif
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dir.c,v $
- * Revision 1.16 1996-10-29 14:06:45 adam
+ * Revision 1.17 1997-09-09 13:38:06 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.16 1996/10/29 14:06:45 adam
* Include zebrautl.h instead of alexutil.h.
*
* Revision 1.15 1996/06/04 10:18:58 adam
#include <stdio.h>
#include <string.h>
#include <assert.h>
+#ifndef WINDOWS
#include <unistd.h>
-#include <dirent.h>
+#endif
+#include <direntz.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dirs.c,v $
- * Revision 1.12 1996-11-08 11:10:13 adam
+ * Revision 1.13 1997-09-09 13:38:06 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.12 1996/11/08 11:10:13 adam
* Buffers used during file match got bigger.
* Compressed ISAM support everywhere.
* Bug fixes regarding masking characters in queries.
* Started work on virtual directory structure.
*/
#include <stdio.h>
+#include <string.h>
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: extract.c,v $
- * Revision 1.73 1997-09-04 13:57:20 adam
+ * Revision 1.74 1997-09-09 13:38:06 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.73 1997/09/04 13:57:20 adam
* New file extract/retrieve method tellf (added).
* Added O_BINARY for open calls.
*
*/
#include <stdio.h>
#include <assert.h>
+#ifdef WINDOWS
+#include <io.h>
+#else
#include <unistd.h>
+#endif
#include <fcntl.h>
#include <recctrl.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: kdump.c,v $
- * Revision 1.12 1997-09-05 09:52:32 adam
+ * Revision 1.13 1997-09-09 13:38:07 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.12 1997/09/05 09:52:32 adam
* Extra argument added to function chr_read_maptab (tab path).
*
* Revision 1.11 1996/10/29 14:06:49 adam
*
*/
#include <stdio.h>
+#include <string.h>
#include <assert.h>
+#ifdef WINDOWS
+#include <io.h>
+#else
#include <unistd.h>
+#endif
#include <assert.h>
#include <charmap.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: kinput.c,v $
- * Revision 1.23 1997-09-04 13:57:39 adam
+ * Revision 1.24 1997-09-09 13:38:07 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.23 1997/09/04 13:57:39 adam
* Added O_BINARY for open calls.
*
* Revision 1.22 1997/02/12 20:39:45 adam
*/
#include <fcntl.h>
+#ifdef WINDOWS
+#include <io.h>
+#else
#include <unistd.h>
+#endif
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
p->totalOffset += keyp->buf_size;
}
+#ifndef R_OK
+#define R_OK 4
+#endif
+
void key_input (int nkeys, int cache)
{
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: lockidx.c,v $
- * Revision 1.9 1997-09-04 13:58:04 adam
+ * Revision 1.10 1997-09-09 13:38:07 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.9 1997/09/04 13:58:04 adam
* Added O_BINARY for open calls.
*
* Revision 1.8 1997/02/12 20:39:46 adam
*/
#include <stdio.h>
#include <assert.h>
+#ifdef WINDOWS
+#include <io.h>
+#else
#include <unistd.h>
+#endif
#include <fcntl.h>
#include <string.h>
#include <errno.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: lockutil.c,v $
- * Revision 1.6 1996-10-29 14:08:14 adam
+ * Revision 1.7 1997-09-09 13:38:08 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.6 1996/10/29 14:08:14 adam
* Uses resource lockDir instead of lockPath.
*
* Revision 1.5 1996/03/26 16:01:13 adam
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
+#ifdef WINDOWS
+#include <io.h>
+#else
#include <unistd.h>
+#endif
#include "index.h"
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: main.c,v $
- * Revision 1.47 1997-02-12 20:39:46 adam
+ * Revision 1.48 1997-09-09 13:38:08 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.47 1997/02/12 20:39:46 adam
* Implemented options -f <n> that limits the log to the first <n>
* records.
* Changed some log messages also.
*/
#include <stdio.h>
#include <assert.h>
+#ifdef WINDOWS
+#include <io.h>
+#else
#include <unistd.h>
+#endif
#include <data1.h>
#include "index.h"
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: recstat.c,v $
- * Revision 1.3 1996-06-04 10:19:00 adam
+ * Revision 1.4 1997-09-09 13:38:08 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.3 1996/06/04 10:19:00 adam
* Minor changes - removed include of ctype.h.
*
* Revision 1.2 1996/05/14 14:04:34 adam
#include <assert.h>
#include <string.h>
#include <fcntl.h>
+#ifndef WINDOWS
#include <unistd.h>
-
+#endif
#include "recindxp.h"
void rec_prstat (void)
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: symtab.c,v $
- * Revision 1.3 1996-10-29 14:06:54 adam
+ * Revision 1.4 1997-09-09 13:38:09 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.3 1996/10/29 14:06:54 adam
* Include zebrautl.h instead of alexutil.h.
*
* Revision 1.2 1995/09/28 09:19:44 adam
*/
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <assert.h>
#include "index.h"
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: trav.c,v $
- * Revision 1.29 1997-02-12 20:39:47 adam
+ * Revision 1.30 1997-09-09 13:38:09 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.29 1997/02/12 20:39:47 adam
* Implemented options -f <n> that limits the log to the first <n>
* records.
* Changed some log messages also.
*/
#include <stdio.h>
#include <assert.h>
+#ifdef WINDOWS
+#include <io.h>
+#else
#include <unistd.h>
-#include <dirent.h>
-#include <sys/stat.h>
+#endif
+#include <direntz.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
-#include <strings.h>
+#include <string.h>
#include <assert.h>
#include <isam.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: memory.c,v $
- * Revision 1.14 1996-10-29 13:56:56 adam
+ * Revision 1.15 1997-09-09 13:38:11 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.14 1996/10/29 13:56:56 adam
* Include of zebrautl.h instead of alexutil.h.
*
* Revision 1.13 1996/03/20 13:29:16 quinn
#include <assert.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <zebrautl.h>
#include <isam.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: physical.c,v $
- * Revision 1.13 1996-10-29 13:56:57 adam
+ * Revision 1.14 1997-09-09 13:38:12 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.13 1996/10/29 13:56:57 adam
* Include of zebrautl.h instead of alexutil.h.
*
* Revision 1.12 1996/03/20 16:17:11 quinn
#include <assert.h>
#include <stdio.h>
+#include <string.h>
#include <log.h>
#include <isam.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: recgrs.c,v $
- * Revision 1.7 1997-09-05 15:30:10 adam
+ * Revision 1.8 1997-09-09 13:38:14 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.7 1997/09/05 15:30:10 adam
* Changed prototype for chr_map_input - added const.
* Added support for C++, headers uses extern "C" for public definitions.
*
#include <stdio.h>
#include <assert.h>
#include <sys/types.h>
+#ifndef WINDOWS
#include <unistd.h>
+#endif
#include <log.h>
#include <oid.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rsbool.c,v $
- * Revision 1.10 1996-10-29 13:55:20 adam
+ * Revision 1.11 1997-09-09 13:38:15 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.10 1996/10/29 13:55:20 adam
* Include of zebrautl.h instead of alexutil.h.
*
* Revision 1.9 1995/12/11 09:15:22 adam
*/
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <assert.h>
#include <rsbool.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rsm_or.c,v $
- * Revision 1.2 1996-12-23 15:30:49 adam
+ * Revision 1.3 1997-09-09 13:38:16 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.2 1996/12/23 15:30:49 adam
* Work on truncation.
*
* Revision 1.1 1996/12/20 11:07:21 adam
*
*/
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
-#include <assert.h>
+#include <string.h>
#include <isam.h>
#include <isamc.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rsrel.c,v $
- * Revision 1.14 1996-11-08 11:15:58 adam
+ * Revision 1.15 1997-09-09 13:38:16 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.14 1996/11/08 11:15:58 adam
* Compressed isam fully supported.
*
* Revision 1.13 1996/10/29 13:55:26 adam
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <assert.h>
#include <isam.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rssbool.c,v $
- * Revision 1.4 1996-10-29 13:55:27 adam
+ * Revision 1.5 1997-09-09 13:38:16 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.4 1996/10/29 13:55:27 adam
* Include of zebrautl.h instead of alexutil.h.
*
* Revision 1.3 1996/10/08 13:00:41 adam
*
*/
-#include <stdio.h>
#include <assert.h>
+#include <stdio.h>
+#include <string.h>
#include <rsbool.h>
#include <zebrautl.h>
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rstemp.c,v $
- * Revision 1.19 1997-09-04 13:58:57 adam
+ * Revision 1.20 1997-09-09 13:38:17 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.19 1997/09/04 13:58:57 adam
* Added O_BINARY for open calls.
*
* Revision 1.18 1996/10/29 13:54:52 adam
#include <fcntl.h>
#include <assert.h>
+#ifdef WINDOWS
+#include <io.h>
+#else
#include <unistd.h>
+#endif
+#include <string.h>
#include <sys/types.h>
#include <stdio.h>
--- /dev/null
+
+#ifdef WINDOWS
+#include <assert.h>
+#include <io.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <direntz.h>
+
+struct DIR {
+ HANDLE handle;
+ WIN32_FIND_DATA find_data;
+ struct dirent entry;
+};
+
+DIR *opendir (const char *name)
+{
+ char fullName[MAX_PATH+1];
+ DIR *dd = malloc (sizeof(*dd));
+
+ if (!dd)
+ return NULL;
+ strcpy (fullName, name);
+ strcat (fullName, "\\*.*");
+ dd->handle = FindFirstFile(fullName, &dd->find_data);
+ return dd;
+}
+
+struct dirent *readdir (DIR *dd)
+{
+ if (dd->handle == INVALID_HANDLE_VALUE)
+ return NULL;
+ strcpy (dd->entry.d_name, dd->find_data.cFileName);
+ if (!FindNextFile(dd->handle, &dd->find_data))
+ {
+ FindClose (dd->handle);
+ dd->handle = INVALID_HANDLE_VALUE;
+ }
+ return &dd->entry;
+}
+
+void closedir(DIR *dd)
+{
+ if (dd->handle != INVALID_HANDLE_VALUE)
+ FindClose (dd->handle);
+ if (dd)
+ free (dd);
+}
+
+#endif
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: res.c,v $
- * Revision 1.16 1996-10-29 13:47:49 adam
+ * Revision 1.17 1997-09-09 13:38:19 adam
+ * Partial port to WIN95/NT.
+ *
+ * Revision 1.16 1996/10/29 13:47:49 adam
* Implemented res_get_match. Updated to use zebrautl instead of alexpath.
*
* Revision 1.15 1996/05/22 08:23:43 adam
#include <stdlib.h>
#include <string.h>
#include <assert.h>
+#ifdef WINDOWS
+#include <io.h>
+#else
#include <unistd.h>
+#endif
#include <zebrautl.h>
#include <yaz-util.h>
Res res_open (const char *name)
{
Res r;
+#ifdef WINDOWS
+ if (access (name, 4))
+#else
if (access (name, R_OK))
+#endif
logf (LOG_LOG|LOG_ERRNO, "Cannot access `%s'", name);
r = xmalloc (sizeof(*r));
r->init = 0;