3 * Guido Draheim <guidod@gmx.de>
4 * Mike Nordell <tamlin@algonet.se>
6 * Copyright (c) 2002,2003 Guido Draheim
8 * use under the restrictions of the
9 * Lesser GNU General Public License
10 * or alternatively the restrictions
11 * of the Mozilla Public License 1.1
15 #include <zzip/plugin.h>
25 #include <zzip/file.h>
26 #include <zzip/format.h>
33 if (fstat(fd, &st) < 0)
36 # if defined DEBUG && ! defined _WIN32
37 if (! st.st_size && st.st_blocks > 1) /* seen on some darwin 10.1 machines */
38 fprintf(stderr, "broken fstat(2) ?? st_size=%ld st_blocks=%ld\n",
39 (long) st.st_size, (long) st.st_blocks);
45 static const struct zzip_plugin_io default_io =
57 * This function returns a zzip_plugin_io_t handle to static defaults
58 * wrapping the posix io file functions for actual file access.
63 return (zzip_plugin_io_t) &default_io;
67 * This function initializes the users handler struct to default values
68 * being the posix io functions in default configured environments.
70 int zzip_init_io(zzip_plugin_io_handlers_t io, int flags)
75 memcpy(io, &default_io, sizeof(default_io));
82 * c-file-style: "stroustrup"