source: branches/1.7/src/core/RpBufferCInterface.h @ 6716

Last change on this file since 6716 was 5850, checked in by gah, 9 years ago

merge accumulative changes from 1.3 branch into uq branch

  • Property svn:eol-style set to native
File size: 2.1 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 *  INTERFACE: C Rappture Buffer Header
4 *
5 * ======================================================================
6 *  AUTHOR:  Derrick Kearney, Purdue University
7 *  Copyright (c) 2004-2012  HUBzero Foundation, LLC
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#ifndef _RAPPTURE_BUFFER_C_H
15#define _RAPPTURE_BUFFER_C_H
16
17#include "RpOutcomeCInterface.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif // ifdef __cplusplus
22
23typedef struct {
24    void* _buf;
25    /*
26    const char* (*bytes)();
27    unsigned int (*size)();
28    // void (*clear)();
29    int (*append)(const char*, int);
30    int (*read)(const char*, int);
31    int (*seek)(int, int);
32    int (*tell)();
33    // void (*rewind);
34    bool (*load)(Outcome &result, const char*);
35    bool (*dump)(Outcome &result, const char*);
36    bool (*encode)(Outcome &result, bool, bool);
37    bool (*decode)(Outcome &result, bool, bool);
38    */
39} RapptureBuffer;
40
41int RapptureBufferInit(RapptureBuffer* buf);
42int RapptureBufferNew(RapptureBuffer* buf);
43int RapptureBufferFree(RapptureBuffer* buf);
44const char* RapptureBufferBytes(RapptureBuffer* buf);
45unsigned int RapptureBufferSize(RapptureBuffer* buf);
46int RapptureBufferAppend(RapptureBuffer* buf, const char* bytes, int size);
47int RapptureBufferRead(RapptureBuffer* buf, const char* bytes, int size);
48int RapptureBufferSeek(RapptureBuffer* buf, int offset, int whence);
49int RapptureBufferTell(RapptureBuffer* buf);
50RapptureOutcome RapptureBufferLoad(RapptureBuffer* buf, const char* filename);
51RapptureOutcome RapptureBufferDump(RapptureBuffer* buf, const char* filename);
52RapptureOutcome RapptureBufferEncode(RapptureBuffer* buf, int compress,
53                                     int base64);
54RapptureOutcome RapptureBufferDecode(RapptureBuffer* buf,
55                                     int decompress, int base64);
56
57#ifdef __cplusplus
58}
59#endif // ifdef __cplusplus
60
61#endif // ifndef _RAPPTURE_BUFFER_C_H
Note: See TracBrowser for help on using the repository browser.