Debian Codegraph @

prboom2/src/memio.h

raw
1 // Emacs style mode select -*- C -*-
2 //-----------------------------------------------------------------------------
3 //
4 // Copyright(C) 1993-1996 Id Software, Inc.
5 // Copyright(C) 2005 Simon Howard
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 // 02111-1307, USA.
21 //
22
23 // e6y
24 // All tabs are replaced with spaces.
25 // Fixed eol style of files.
26
27 #ifndef MEMIO_H
28 #define MEMIO_H
29
30 typedef struct _MEMFILE MEMFILE;
31
32 typedef enum
33 {
34 MEM_SEEK_SET,
35 MEM_SEEK_CUR,
36 MEM_SEEK_END,
37 } mem_rel_t;
38
39 MEMFILE *mem_fopen_read(const void *buf, size_t buflen);
40 size_t mem_fread(void *buf, size_t size, size_t nmemb, MEMFILE *stream);
41 MEMFILE *mem_fopen_write(void);
42 size_t mem_fwrite(const void *ptr, size_t size, size_t nmemb, MEMFILE *stream);
43 void mem_get_buf(MEMFILE *stream, void **buf, size_t *buflen);
44 void mem_fclose(MEMFILE *stream);
45 long mem_ftell(MEMFILE *stream);
46 int mem_fseek(MEMFILE *stream, signed long offset, mem_rel_t whence);
47
48 #endif /* #ifndef MEMIO_H */