aboutsummaryrefslogtreecommitdiff
path: root/doc/nerv_io.md
blob: 7066939cd9a373e6a02f0f4f4340d73ae6ce919b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#The Nerv IO Package#
Part of the [Nerv](../README.md) toolkit.

##Description##
There are four classes in to deal with chunk data, which are __nerv.ChunkFile__, __nerv.ChunkFileHandle__, __nerv.ChunkInfo__, __nerv.ChunkData__. Below is the underlying C structs.
```
typedef struct ChunkFileHandle {
    FILE *fp;
} ChunkFileHandle;

typedef struct ChunkInfo {
    off_t offset, length;
} ChunkInfo;

typedef struct ChunkData {
    FILE *fp;
    char *data;
} ChunkData;
```

##Methods##
* __ChunkFileHandle ChunkFile.\_\_init(string mode, string fn)__  
`mode` can be `r` or `w`, for reading or writing a file.