summaryrefslogtreecommitdiffstats
path: root/file_use.h
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2014-12-09 10:31:37 +0900
committerFreeArtMan <dos21h@gmail.com>2014-12-09 10:31:37 +0900
commita57c6bed8f6ab7d0f4355190c0cff7cd913da6a0 (patch)
treec8b85b9de364cb63678d05625bdff6a2cf12ecda /file_use.h
parentdc4bbe5366d6c733f9f77b7c9fee0cbba3e0d92b (diff)
downloadmicrobbs-a57c6bed8f6ab7d0f4355190c0cff7cd913da6a0.tar.gz
microbbs-a57c6bed8f6ab7d0f4355190c0cff7cd913da6a0.zip
New planned functionality. Menuconfig support. Simple captcha.
Diffstat (limited to 'file_use.h')
-rw-r--r--file_use.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/file_use.h b/file_use.h
new file mode 100644
index 0000000..fe7cc08
--- /dev/null
+++ b/file_use.h
@@ -0,0 +1,40 @@
+#ifndef __LIBUTILS_FILE_USE_H
+#define __LIBUTILS_FILE_USE_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "debug.h"
+
+#define F_FILE_NONE 0
+#define F_FILE_READ 1
+#define F_FILE_WRITE 2
+#define F_FILE_RW 3
+
+#define F_SEEK_CUR SEEK_CUR
+#define F_SEEK_END SEEK_END
+#define F_SEEK_SET SEEK_SET
+
+//simple file using things
+typedef struct f_file
+{
+ FILE *fid;
+ int flags;
+ long size;
+ int seek;
+} f_file;
+
+void f_file_null( f_file* );
+int f_file_seek( f_file*, long, int );
+size_t f_file_read( f_file*, size_t, void* );
+//f_file_read_bl();
+int f_file_size( f_file* );
+size_t f_file_write( f_file*, size_t, void* );
+//f_file_write_bl();
+f_file* f_file_open( const char*, int );
+int f_file_close( f_file* );
+//f_file_flush();
+//f_file_mmap();
+
+#endif