+#include <setjmp.h>
#include "lists.h"
+/* definitions of internal variables */
+#define INT_VAR_MAIL_LEN "MAIL_LEN"
+#define INT_VAR_LAST_EXIT "LAST_EXIT_CODE"
+#define INT_VAR_PIPE_RES "LAST_OUTPUT"
+
+/* umpf.c */
+jmp_buf env;
+
/* cond.h */
int yylex (void);
void yyerror (char const *);
K_FILTER
};
+enum var_type {
+ VAR_HEADER,
+ VAR_INTERN,
+ VAR_USER
+};
+
struct tree {
enum {
ST_IF,
struct node car;
char* name;
int varcode;
- int modified;
+ enum var_type type;
+};
+
+struct vartab {
+ char* value;
+ int modif;
};
struct list input_code;
int current_varcode;
int max_varcode;
int temp_varcode_start;
-char** var_tab;
+struct vartab* var_tab;
char** const_tab;
int cur_const_n;
int cur_const_s;
void init(void);
void compile(struct tree* t, struct list* where);
-int find_var(char* name, struct list* hash);
-struct variable* get_var_struct(char* name, struct list* hash);
+int find_var(char* name, enum var_type type, struct list* hash);
+struct variable* get_var_struct(char* name, enum var_type type, struct list* hash);
int store_const(char* c);
struct list* new_var_hash(void);
int get_bucket_number(char* name);
void interp(struct list* ins, struct list* hash);
void free_string(char* c);
void __attribute__ ((noreturn)) bye(int code, char* msg, ...);
+void set_cur_mail_length_var(int len, struct list* hash);
/* ham.c */
char* default_mailbox;
int chars_written;
int curr_email_len;
+char* fromline;
struct list* current_headers;
struct email* current_body;
struct list* make_hlist(int fd);
+void new_header(char* buf, struct list* h);
void print_headers(struct list* l);
struct email* get_body(int fd);
int deliver_local_email(char* folder, struct email* email);