From f9e116ef514b27680434eb92d737135edd316875 Mon Sep 17 00:00:00 2001 From: cloudygoose Date: Thu, 4 Jun 2015 17:03:41 +0800 Subject: doc change --- doc/nerv_io.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 doc/nerv_io.md (limited to 'doc/nerv_io.md') diff --git a/doc/nerv_io.md b/doc/nerv_io.md new file mode 100644 index 0000000..7066939 --- /dev/null +++ b/doc/nerv_io.md @@ -0,0 +1,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. -- cgit v1.2.3-70-g09d2 From 92cc3cffec87dbebd1e79b51ead2d04b52fbd0d4 Mon Sep 17 00:00:00 2001 From: cloudygoose Date: Thu, 4 Jun 2015 22:28:45 +0800 Subject: ... --- doc/nerv_io.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'doc/nerv_io.md') diff --git a/doc/nerv_io.md b/doc/nerv_io.md index 7066939..d452d5d 100644 --- a/doc/nerv_io.md +++ b/doc/nerv_io.md @@ -19,5 +19,8 @@ typedef struct ChunkData { ``` ##Methods## -* __ChunkFileHandle ChunkFile.\_\_init(string mode, string fn)__ +* __ChunkFile ChunkFile.\_\_init(string mode, string fn)__ `mode` can be `r` or `w`, for reading or writing a file. + +##Developer Notes## +In __Nerv.io__, a returned(by `ChunkFile.__init`) __nerv.ChunkFile__ will have a member `handle`, which is a __nerv.ChunkFileHandle__. \ No newline at end of file -- cgit v1.2.3-70-g09d2