summaryrefslogtreecommitdiff
path: root/line.h
diff options
context:
space:
mode:
authorepoch <epoch@hack.thebackupbox.net>2019-05-19 07:46:00 +0000
committerepoch <epoch@hack.thebackupbox.net>2019-05-19 07:46:00 +0000
commit5ed56236f1ee57e71c91d356c7160aedc6e515f0 (patch)
tree552445eb1692c1b15e77528cfbbf8f22b769e388 /line.h
downloadlibidc-5ed56236f1ee57e71c91d356c7160aedc6e515f0.tar.gz
libidc-5ed56236f1ee57e71c91d356c7160aedc6e515f0.zip
it works but it is NOT pretty
Diffstat (limited to 'line.h')
-rw-r--r--line.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/line.h b/line.h
new file mode 100644
index 0000000..c27848c
--- /dev/null
+++ b/line.h
@@ -0,0 +1,32 @@
+#include <sys/select.h>
+
+char *read_line_hack(FILE *fp,int len);
+int update_shits();
+char *memstr(char *s,char *find,size_t l);
+int select_on_everything();
+
+#define CHUNK 4096
+
+struct shit {
+ int fd;
+ char *backlog;
+ int blsize;
+ int bllen;
+ char buffer[CHUNK];//THIS IS *NOT* NULL TERMINATED.
+
+ char *delim;
+ //other stuffs?
+// union {
+ void (*line_handler)(struct shit *me,char *line);//function pointer to the handler. ???
+// (void *line_handler_fd)(int fd,char *)
+// };//???
+ void *extra_info;//extra info that I don't care to name atm
+};
+
+struct global {
+ int fdmax;
+ int shitlen;
+ struct shit fds[FD_SETSIZE];
+};
+
+int add_fd(int fd,void (*line_handler)(struct shit *,char *));