/[public]/psiconv/trunk/lib/psiconv/buffer.h
ViewVC logotype

Contents of /psiconv/trunk/lib/psiconv/buffer.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 79 - (show annotations)
Mon Dec 25 22:25:33 2000 UTC (23 years, 3 months ago) by frodo
File MIME type: text/plain
File size: 2000 byte(s)
(Frodo) Added a complete buffer abstraction

1 /*
2 buffer.h - Part of psiconv, a PSION 5 file formats converter
3 Copyright (c) 2000 Frodo Looijaard <frodol@dds.nl>
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., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #ifndef PSICONV_BUFFER_H
21 #define PSICONV_BUFFER_H
22
23 #include <psiconv/general.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28
29 /* Always use psiconv_buffer, never struct psiconv_buffer_s */
30 /* No need to export the actual internal format */
31 typedef struct psiconv_buffer_s *psiconv_buffer;
32
33 extern psiconv_buffer psiconv_buffer_new(psiconv_u32 base_offset);
34 extern void psiconv_buffer_free(psiconv_buffer buf);
35 extern psiconv_u32 psiconv_buffer_base_offset(const psiconv_buffer buf);
36 extern psiconv_u32 psiconv_buffer_length(const psiconv_buffer buf);
37 extern psiconv_u8 *psiconv_buffer_get(const psiconv_buffer buf,
38 psiconv_u32 off);
39 extern int psiconv_buffer_add(psiconv_buffer buf,psiconv_u8 data);
40 extern size_t psiconv_buffer_fread(psiconv_buffer buf,size_t size, FILE *f);
41 extern int psiconv_buffer_fread_all(psiconv_buffer buf, FILE *f);
42 extern int psiconv_buffer_fwrite_all(const psiconv_buffer buf, FILE *f);
43 extern int psiconv_buffer_concat(psiconv_buffer buf,
44 const psiconv_buffer extra);
45
46
47 #ifdef __cplusplus
48 }
49 #endif /* __cplusplus */
50
51 #endif /* def PSICONV_BUFFER_H */

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26