source: trunk/src/core/RpBufferCInterface.h @ 1018

Last change on this file since 1018 was 1018, checked in by gah, 16 years ago

Massive changes: New directory/file layout

File size: 2.2 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 *  INTERFACE: C Rappture Buffer Header
4 *
5 * ======================================================================
6 *  AUTHOR:  Derrick Kearney, Purdue University
7 *  Copyright (c) 2004-2007  Purdue Research Foundation
8 *
9 *  See the file "license.terms" for information on usage and
10 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
11 * ======================================================================
12 */
13
14
15#ifndef _RAPPTURE_BUFFER_C_H
16#define _RAPPTURE_BUFFER_C_H
17
18#include "RpOutcomeCInterface.h"
19
20#ifdef __cplusplus
21extern "C" {
22#endif // ifdef __cplusplus
23
24typedef struct {
25    void* _buf;
26    /*
27    const char* (*bytes)();
28    unsigned int (*size)();
29    // void (*clear)();
30    int (*append)(const char*, int);
31    int (*read)(const char*, int);
32    int (*seek)(int, int);
33    int (*tell)();
34    // void (*rewind);
35    Outcome (*load)(const char*);
36    Outcome (*dump)(const char*);
37    Outcome (*encode)(unsigned int, unsigned int);
38    Outcome (*decode)(unsigned int, unsigned int);
39    */
40}RapptureBuffer;
41
42int RapptureBufferInit(RapptureBuffer* buf);
43int RapptureBufferNew(RapptureBuffer* buf);
44int RapptureBufferFree(RapptureBuffer* buf);
45const char* RapptureBufferBytes(RapptureBuffer* buf);
46unsigned int RapptureBufferSize(RapptureBuffer* buf);
47int RapptureBufferAppend(RapptureBuffer* buf, const char* bytes, int size);
48int RapptureBufferRead(RapptureBuffer* buf, const char* bytes, int size);
49int RapptureBufferSeek(RapptureBuffer* buf, int offset, int whence);
50int RapptureBufferTell(RapptureBuffer* buf);
51RapptureOutcome RapptureBufferLoad(RapptureBuffer* buf, const char* filename);
52RapptureOutcome RapptureBufferDump(RapptureBuffer* buf, const char* filename);
53RapptureOutcome RapptureBufferEncode(   RapptureBuffer* buf,
54                                        unsigned int compress,
55                                        unsigned int base64 );
56RapptureOutcome RapptureBufferDecode(   RapptureBuffer* buf,
57                                        unsigned int decompress,
58                                        unsigned int base64 );
59
60#ifdef __cplusplus
61}
62#endif // ifdef __cplusplus
63
64#endif // ifndef _RAPPTURE_BUFFER_C_H
Note: See TracBrowser for help on using the repository browser.