]> mj.ucw.cz Git - umpf.git/blobdiff - umpf.h
attempt to cope with big emails
[umpf.git] / umpf.h
diff --git a/umpf.h b/umpf.h
index 946279ebc8d0a84699ff8c20e84a8a915bfb6176..2fd1a04aef2a0e43310e50e199f709500450c4cc 100644 (file)
--- a/umpf.h
+++ b/umpf.h
@@ -87,44 +87,11 @@ void read_conf(char* filename);
 int line;
 FILE* conf;
 
-/* int.c */
-struct hlist {
-       struct node car;
-       char* name;
-       char* value;
-};
-
-struct email {
-       struct list* headers;
-       char* body;
-       int body_len;
-};
-
-struct action {
-       char* l;
-       char* r;
-       char* s;
-       struct email e;
-};
-
-/* ham.c */
-char* default_mailbox;
-
-struct list* current_headers;
-struct email* current_body;
-struct list* make_hlist(void);
-void print_headers(struct list* l);
-void do_action(struct action* a);
-struct email* get_body(void);
-
-/* lock.c */
-void save_gids(void);
-void close_mailbox(int fd, char* path, int is_default_mailbox);
-int open_mailbox(char* path, int is_default_mailbox);
-char* cat(char* l, char* r);
-
 /* code.c */
 #define BUFSIZE 4096 
+#define HASHSIZE 103
+#define MAGIC 19
+
 struct code {
        struct node car;
        enum {
@@ -154,7 +121,6 @@ struct code {
                OPC_DIV,
                OPC_PIPE,
                OPC_MAIL,
-               OPC_STORE,
                OPC_DISCARD
        } opcode;
 
@@ -195,12 +161,14 @@ struct code {
 struct variable {
        struct node car;
        char* name;
-       int varcode;    
+       int varcode;
+       int modified;
 };
 
 struct list input_code;
 struct list* var_hash;
 int current_varcode;
+int max_varcode;
 int temp_varcode_start;
 char** var_tab; 
 char** const_tab;
@@ -212,4 +180,43 @@ void compile(struct tree* t, struct list* where);
 int find_var(char* name, struct list* hash);
 int store_const(char* c);
 struct list* new_var_hash(void);
+int get_bucket_number(char* name);
 void print_code(void);
+
+/* int.c */
+struct hlist {
+       struct node car;
+       char* name;
+       char* value;
+       int have_var;
+};
+
+struct email {
+       struct list* headers;
+       char* body;
+       char* tmpfile;
+       int fd;
+       int body_len;
+};
+
+void save_current_headers(struct list* hash);
+void print_vars(struct list* hash);
+void interp(struct list* ins, struct list* hash);
+
+/* ham.c */
+char* default_mailbox;
+
+struct list* current_headers;
+struct email* current_body;
+struct list* make_hlist(void);
+void print_headers(struct list* l);
+struct email* get_body(void);
+int deliver_local_email(char* folder, struct email* email);
+
+/* lock.c */
+void save_gids(void);
+void close_mailbox(int fd, char* path, int is_default_mailbox);
+int open_mailbox(char* path, int is_default_mailbox);
+char* cat(char* l, char* r);
+
+