9 #define DEFAULT_CONF ".umpf"
14 list_init(&input_code);
15 var_hash = new_var_hash();
16 const_tab = xmalloc(BUFSIZE);
18 cur_const_s = BUFSIZE;
23 main(int argc, char** argv)
26 char* conffile = NULL;
28 while ((opt = getopt(argc, argv, "c:m:")) != -1) {
31 default_mailbox = optarg;
37 die("Usage: ./umpf [-c conf_file] [-m default_mailbox]");
41 if (!default_mailbox) {
44 p = getpwuid(getuid());
45 default_mailbox = cat("/var/mail/", p->pw_name);
51 /* returning from longjump? save the mail and exit */
59 home = getenv("HOME");
63 conffile = xmalloc(strlen(home) + strlen(DEFAULT_CONF) + 1);
64 sprintf(conffile, "%s/%s", home, DEFAULT_CONF);
72 temp_varcode_start = current_varcode;
73 compile(input_tree, NULL);
76 var_tab = xmalloc((max_varcode + 1) * sizeof(struct vartab));
77 for (i = 0; i <= max_varcode; i++) {
78 var_tab[i].value = empty;
82 current_headers = make_hlist(0);
83 current_body = get_body(0);
84 save_current_headers(var_hash);
85 set_cur_mail_length_var(curr_email_len, var_hash);
87 interp(&input_code, var_hash);