BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJLIB Reference

file_io.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
3 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __PJ_FILE_IO_H__
20#define __PJ_FILE_IO_H__
21
26#include <pj/types.h>
27
29
59{
60 PJ_O_RDONLY = 0x1101,
61 PJ_O_WRONLY = 0x1102,
62 PJ_O_RDWR = 0x1103,
64 PJ_O_APPEND = 0x1108
65};
66
71{
72 PJ_SEEK_SET = 0x1201,
73 PJ_SEEK_CUR = 0x1202,
74 PJ_SEEK_END = 0x1203
75};
76
94 const char *pathname,
95 unsigned flags,
96 pj_oshandle_t *fd);
97
106
119 const void *data,
120 pj_ssize_t *size);
121
138 void *data,
139 pj_ssize_t *size);
140
151 pj_off_t offset,
152 enum pj_file_seek_type whence);
153
164 pj_off_t *pos);
165
174
175
180
181#endif /* __PJ_FILE_IO_H__ */
182
long pj_ssize_t
Definition: types.h:64
void * pj_oshandle_t
Definition: types.h:257
int pj_status_t
Definition: types.h:68
pj_ssize_t pj_off_t
Definition: types.h:108
pj_status_t pj_file_open(pj_pool_t *pool, const char *pathname, unsigned flags, pj_oshandle_t *fd)
pj_file_seek_type
Definition: file_io.h:71
pj_status_t pj_file_read(pj_oshandle_t fd, void *data, pj_ssize_t *size)
pj_status_t pj_file_write(pj_oshandle_t fd, const void *data, pj_ssize_t *size)
pj_status_t pj_file_close(pj_oshandle_t fd)
pj_file_access
Definition: file_io.h:59
pj_status_t pj_file_flush(pj_oshandle_t fd)
pj_status_t pj_file_setpos(pj_oshandle_t fd, pj_off_t offset, enum pj_file_seek_type whence)
pj_status_t pj_file_getpos(pj_oshandle_t fd, pj_off_t *pos)
@ PJ_SEEK_SET
Definition: file_io.h:72
@ PJ_SEEK_CUR
Definition: file_io.h:73
@ PJ_SEEK_END
Definition: file_io.h:74
@ PJ_O_APPEND
Definition: file_io.h:64
@ PJ_O_WRONLY
Definition: file_io.h:61
@ PJ_O_RDONLY
Definition: file_io.h:60
@ PJ_O_RDWR
Definition: file_io.h:62
#define PJ_BEGIN_DECL
Definition: config.h:1284
#define PJ_END_DECL
Definition: config.h:1285
Definition: pool.h:310
Declaration of basic types and utility.

 


PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.