1 /*************************************************************************************************
2 * The win32 compat API of Tokyo Cabinet
3 * Copyright (C) 2006-2008 Mikio Hirabayashi
5 * Tokyo Cabinet is free software; you can redistribute it and/or modify it under the terms of
6 * the GNU Lesser General Public License as published by the Free Software Foundation; either
7 * version 2.1 of the License or any later version. Tokyo Cabinet is distributed in the hope
8 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10 * License for more details.
11 * You should have received a copy of the GNU Lesser General Public License along with Tokyo
12 * Cabinet; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
13 * Boston, MA 02111-1307 USA.
14 *************************************************************************************************/
20 #include <sys/types.h>
33 #define REG_EXTENDED 0
37 int regcomp(regex_t *preg, const char *regex, int cflags);
38 int regexec(const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags);
39 size_t regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size);
40 void regfree(regex_t *preg);
43 /* mmap implementation for tokyodbm */
44 #define PROT_WRITE 0x2 /* Page can be written. */
45 #define PROT_READ 0x1 /* page can be read */
46 #define MAP_SHARED 0x01 /* Share changes. */
47 #define MAP_FAILED ((void *) -1)
50 void *mmap(void *start, size_t length, int prot, int flags,
51 int fd, off_t offset);
52 int munmap(void *start, size_t length);
53 int msync(void *start, size_t length, int flags);
55 ssize_t pread(int fd, void *buf, size_t count, off_t offset);
56 ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
57 int rand_r(int *seedp);
65 int gettimeofday(struct timeval *tv, struct timezone *tz);
69 size_t gl_pathc; /* Count of paths matched so far */
70 char **gl_pathv; /* List of matched pathnames. */
71 size_t gl_offs; /* Slots to reserve in ‘gl_pathv’. */
74 int glob(const char *pattern, int flags,
75 int (*errfunc) (const char *epath, int eerrno),
78 void globfree(glob_t *pglob);
82 #define GLOB_NOMATCH 0
84 char *realpath(const char *path, char *resolved_path);
88 #endif /* HAVE_WIN32 */
89 #endif /* !COMPAT_H */