aboutsummaryrefslogtreecommitdiff
path: root/doc/nerv_io.md
diff options
context:
space:
mode:
authorTed Yin <[email protected]>2015-06-05 11:03:14 +0800
committerTed Yin <[email protected]>2015-06-05 11:03:14 +0800
commit3bdb17da736a8fa15786c6d42aa19233c07e3f8a (patch)
tree27a0586e148ce53c2828effa2d9977e1619ad3dd /doc/nerv_io.md
parentdf737041e4a9f3f55978cc74db9a9cea27fa9fa0 (diff)
parent92cc3cffec87dbebd1e79b51ead2d04b52fbd0d4 (diff)
Merge pull request #17 from cloudygoose/master
change doc
Diffstat (limited to 'doc/nerv_io.md')
-rw-r--r--doc/nerv_io.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/nerv_io.md b/doc/nerv_io.md
new file mode 100644
index 0000000..d452d5d
--- /dev/null
+++ b/doc/nerv_io.md
@@ -0,0 +1,26 @@
+#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##
+* __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