00001 #include <sys/types.h>
00002
00003 #include <ctype.h>
00004 #include <errno.h>
00005 #include <fcntl.h>
00006 #include <pthread.h>
00007 #include <stdio.h>
00008 #include <stdlib.h>
00009 #include <strings.h>
00010 #include <unistd.h>
00011
00012 #include "db.h"
00013
00014 #define E(api, func, name) { \
00015 if ((ret = api(func)) != 0) { \
00016 fprintf(stderr, "%s: %s", name, db_strerror(ret)); \
00017 return (1); \
00018 } \
00019 }
00020
00021 void
00022 dirfree(char **namesp, int cnt)
00023 { return; }
00024 int
00025 dirlist(const char *dir, char ***namesp, int *cntp)
00026 { return (0); }
00027 int
00028 exists(const char *path, int *isdirp)
00029 { return (0); }
00030 int
00031 ioinfo(const char *path,
00032 int fd, u_int32_t *mbytesp, u_int32_t *bytesp, u_int32_t *iosizep)
00033 { return (0); }
00034 int
00035 map(char *path, size_t len, int is_region, int is_rdonly, void **addr)
00036 { return (0); }
00037 int
00038 seek(int fd, off_t offset, int whence)
00039 { return (0); }
00040 int
00041 local_sleep(u_long seconds, u_long microseconds)
00042 { return (0); }
00043 int
00044 unmap(void *addr, size_t len)
00045 { return (0); }
00046
00047 int
00048 main(int argc, char *argv[])
00049 {
00050 int ret;
00051
00052 E(db_env_set_func_close, close, "close");
00053 E(db_env_set_func_dirfree, dirfree, "dirfree");
00054 E(db_env_set_func_dirlist, dirlist, "dirlist");
00055 E(db_env_set_func_exists, exists, "exists");
00056 E(db_env_set_func_free, free, "free");
00057 E(db_env_set_func_fsync, fsync, "fsync");
00058 E(db_env_set_func_ftruncate, ftruncate, "ftruncate");
00059 E(db_env_set_func_ioinfo, ioinfo, "ioinfo");
00060 E(db_env_set_func_malloc, malloc, "malloc");
00061 E(db_env_set_func_map, map, "map");
00062 E(db_env_set_func_open, open, "open");
00063 E(db_env_set_func_pread, pread, "pread");
00064 E(db_env_set_func_pwrite, pwrite, "pwrite");
00065 E(db_env_set_func_read, read, "read");
00066 E(db_env_set_func_realloc, realloc, "realloc");
00067 E(db_env_set_func_rename, rename, "rename");
00068 E(db_env_set_func_seek, seek, "seek");
00069 E(db_env_set_func_sleep, local_sleep, "sleep");
00070 E(db_env_set_func_unlink, unlink, "unlink");
00071 E(db_env_set_func_unmap, unmap, "unmap");
00072 E(db_env_set_func_write, write, "write");
00073 E(db_env_set_func_yield, sched_yield, "yield");
00074
00075 return (0);
00076 }