version 1.3, 2012/03/15 01:52:23
|
version 1.4.2.1, 2012/04/02 09:10:30
|
Line 70 cf_(struct tagBufIO *buf)
|
Line 70 cf_(struct tagBufIO *buf)
|
return 0; |
return 0; |
} |
} |
|
|
|
#ifdef __NetBSD__ |
|
static off_t |
|
sf_lim(struct tagBufIO *buf, off_t pos, int w) |
|
#else |
static fpos_t |
static fpos_t |
sf_lim(struct tagBufIO *buf, fpos_t pos, int w) |
sf_lim(struct tagBufIO *buf, fpos_t pos, int w) |
|
#endif |
{ |
{ |
if (!buf) |
if (!buf) |
goto err; |
goto err; |
Line 134 wf_lim(struct tagBufIO *buf, const char *dat, int siz)
|
Line 139 wf_lim(struct tagBufIO *buf, const char *dat, int siz)
|
return siz; |
return siz; |
} |
} |
|
|
|
#ifdef __NetBSD__ |
|
static off_t |
|
sf_inf(struct tagBufIO *buf, off_t pos, int w) |
|
#else |
static fpos_t |
static fpos_t |
sf_inf(struct tagBufIO *buf, fpos_t pos, int w) |
sf_inf(struct tagBufIO *buf, fpos_t pos, int w) |
|
#endif |
{ |
{ |
void *b; |
void *b; |
|
|
Line 233 wf_inf(struct tagBufIO *buf, const char *dat, int siz)
|
Line 243 wf_inf(struct tagBufIO *buf, const char *dat, int siz)
|
|
|
|
|
/* |
/* |
* io_fmemopen() File buffered stream operations over memory block | * io_fmemopen() - File buffered stream operations over memory block |
* |
* |
* @base = Base address of memory block, if =NULL Infinit length(auto-grow) |
* @base = Base address of memory block, if =NULL Infinit length(auto-grow) |
* @basesize = Size of memory block |
* @basesize = Size of memory block |
Line 273 io_fmemopen(void ** __restrict base, off_t basesize)
|
Line 283 io_fmemopen(void ** __restrict base, off_t basesize)
|
buf->buf_base = *base; |
buf->buf_base = *base; |
buf->buf_size = basesize; |
buf->buf_size = basesize; |
|
|
|
#ifdef __NetBSD__ |
if (buf->buf_mode == BUFIO_MODE_INFINIT) |
if (buf->buf_mode == BUFIO_MODE_INFINIT) |
f = funopen(buf, (int (*)(void *, char *, int)) rf_lim, |
f = funopen(buf, (int (*)(void *, char *, int)) rf_lim, |
(int (*)(void *, char const *, int)) wf_inf, |
(int (*)(void *, char const *, int)) wf_inf, |
|
(off_t (*)(void *, off_t, int)) sf_inf, |
|
(int (*)(void *)) cf_); |
|
else |
|
f = funopen(buf, (int (*)(void *, char *, int)) rf_lim, |
|
(int (*)(void *, char const *, int)) wf_lim, |
|
(off_t (*)(void *, off_t, int)) sf_lim, |
|
(int (*)(void *)) cf_); |
|
#else |
|
if (buf->buf_mode == BUFIO_MODE_INFINIT) |
|
f = funopen(buf, (int (*)(void *, char *, int)) rf_lim, |
|
(int (*)(void *, char const *, int)) wf_inf, |
(fpos_t (*)(void *, fpos_t, int)) sf_inf, |
(fpos_t (*)(void *, fpos_t, int)) sf_inf, |
(int (*)(void *)) cf_); |
(int (*)(void *)) cf_); |
else |
else |
Line 283 io_fmemopen(void ** __restrict base, off_t basesize)
|
Line 305 io_fmemopen(void ** __restrict base, off_t basesize)
|
(int (*)(void *, char const *, int)) wf_lim, |
(int (*)(void *, char const *, int)) wf_lim, |
(fpos_t (*)(void *, fpos_t, int)) sf_lim, |
(fpos_t (*)(void *, fpos_t, int)) sf_lim, |
(int (*)(void *)) cf_); |
(int (*)(void *)) cf_); |
|
#endif |
if (!f) { |
if (!f) { |
LOGERR; |
LOGERR; |
if (buf->buf_mode == BUFIO_MODE_INFINIT) { |
if (buf->buf_mode == BUFIO_MODE_INFINIT) { |
Line 297 io_fmemopen(void ** __restrict base, off_t basesize)
|
Line 320 io_fmemopen(void ** __restrict base, off_t basesize)
|
} |
} |
|
|
/* |
/* |
* io_fmapopen() File buffered stream operations over MMAP block | * io_fmapopen() - File buffered stream operations over MMAP block |
* |
* |
* @csFile = Filename for MMAP, if =NULL private MMAP block |
* @csFile = Filename for MMAP, if =NULL private MMAP block |
* @mode = File open mode |
* @mode = File open mode |
Line 363 io_fmapopen(const char *csFile, int mode, int perm, in
|
Line 386 io_fmapopen(const char *csFile, int mode, int perm, in
|
buf->buf_size = basesize; |
buf->buf_size = basesize; |
buf->buf_unmap = unmap_cf; |
buf->buf_unmap = unmap_cf; |
|
|
|
#ifdef __NetBSD__ |
f = funopen(buf, (int (*)(void *, char *, int)) rf_lim, |
f = funopen(buf, (int (*)(void *, char *, int)) rf_lim, |
(int (*)(void *, char const *, int)) wf_lim, |
(int (*)(void *, char const *, int)) wf_lim, |
|
(off_t (*)(void *, off_t, int)) sf_lim, |
|
(int (*)(void *)) cf_); |
|
#else |
|
f = funopen(buf, (int (*)(void *, char *, int)) rf_lim, |
|
(int (*)(void *, char const *, int)) wf_lim, |
(fpos_t (*)(void *, fpos_t, int)) sf_lim, |
(fpos_t (*)(void *, fpos_t, int)) sf_lim, |
(int (*)(void *)) cf_); |
(int (*)(void *)) cf_); |
|
#endif |
if (!f) { |
if (!f) { |
LOGERR; |
LOGERR; |
free(buf); |
free(buf); |
Line 378 io_fmapopen(const char *csFile, int mode, int perm, in
|
Line 408 io_fmapopen(const char *csFile, int mode, int perm, in
|
} |
} |
|
|
/* |
/* |
* io_dumbFile() Create empry or dumb file with fixed size | * io_dumbFile() - Create empry or dumb file with fixed size |
* |
* |
* @csFile = Filename for create |
* @csFile = Filename for create |
* @mode = File access permissions |
* @mode = File access permissions |
Line 411 err:
|
Line 441 err:
|
} |
} |
|
|
/* |
/* |
* io_fd2buf() Convert open file handle to buffered file I/O | * io_fd2buf() - Convert open file handle to buffered file I/O |
* |
* |
* @fd = File handle |
* @fd = File handle |
* @mode = Permissions for new buffered file I/O |
* @mode = Permissions for new buffered file I/O |