~ubuntu-branches/ubuntu/lucid/thuban/lucid

« back to all changes in this revision

Viewing changes to libraries/thuban/cpl_mfile.h

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2007-04-07 21:03:28 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070407210328-9a20n4dmbim3c3yc
Tags: 1.2.0-1
* New upstream release.
* Patchset updated.
* Policy bumped to 3.7.2 (no changes).
* Updated for current Python Policy by using python-support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef MFILE_H_INCLUDED
2
 
#define MFILE_H_INCLUDED
3
 
 
4
 
#include "cpl_vsi.h"
5
 
 
6
 
typedef struct
7
 
{
8
 
    void *data;
9
 
    vsi_l_offset len;
10
 
} MFILEReceiver;
11
 
 
12
 
 
13
 
#define CHUNK_SIZE 4096         /* must be a power of 2 */
14
 
struct s_chunk
15
 
{
16
 
    char data[CHUNK_SIZE];       /* actual data                             */
17
 
    struct s_chunk *next;        /* pointer to the next chunk               */
18
 
    vsi_l_offset offset;         /* offset from the beginning of the file   */
19
 
};
20
 
 
21
 
typedef struct 
22
 
{
23
 
    char sig[ 3 ];
24
 
    struct s_chunk * head;
25
 
    struct s_chunk * cur;
26
 
    vsi_l_offset t_offset;    /* total offset from the start of the "array" */
27
 
    vsi_l_offset length;      /* length of the "array"                      */
28
 
    char eof;
29
 
    int ungetc;               /* place to hold the ungetc character         */
30
 
    MFILEReceiver *receiver;
31
 
} MFILE;
32
 
 
33
 
MFILE * MFILEOpen( const char * pszFilename );
34
 
vsi_l_offset MFILETell( MFILE * xfp );
35
 
void MFILERewind( MFILE * xfp );
36
 
void MFILEFlush( MFILE * xfp );
37
 
int MFILEEof( MFILE * xfp );
38
 
char *MFILEGets( char *pszBuffer, int nBufferSize, MFILE * mfp );
39
 
int MFILEGetc( MFILE * mfp );
40
 
int MFILEUngetc( int c, MFILE * mfp );
41
 
size_t MFILERead( void * pBuffer, size_t nSize, size_t nCount, MFILE * xfp );
42
 
size_t MFILEWrite( void * pBuffer, size_t nSize, size_t nCount, MFILE * xfp );
43
 
int MFILESeek( MFILE * xfp, vsi_l_offset nOffset, int nWhence );
44
 
int MFILEClose( MFILE * xfp );
45
 
 
46
 
#endif  /* MFILE_H_INCLUDED */