]> mj.ucw.cz Git - umpf.git/blob - umpf.c
compile SET and CAT
[umpf.git] / umpf.c
1 #include <stdio.h>
2 #include <pwd.h>
3
4 #include "umpf.h"
5
6 void
7 init(void)
8 {
9         list_init(&input_code);
10         var_hash = new_var_hash();
11         const_tab = xmalloc(BUFSIZE);
12         cur_const_n = 1;
13         cur_const_s = BUFSIZE;
14 }
15
16 int
17 main(int argc, char** argv)
18 {
19         int res;
20         
21 /*      //FIXME:
22         struct passwd* p;
23         p = getpwuid(getuid());
24         char* default_mbox = cat("/var/mail/", p->pw_name);
25         get_default_mailbox(default_mbox);
26 */
27         if (argc < 2)
28                 die("Usage: ./umpf conf_file");
29
30         save_gids();
31         read_conf(argv[1]);
32         init();
33 //      yydebug=1;
34         res = yyparse ();
35
36         if (res)
37                 return res;
38
39         temp_varcode_start = current_varcode;
40         compile(input_tree);
41
42         print_code();
43
44 //      var_hash = new_var_hash();
45 //      current_headers = make_hlist();
46 //      current_body = get_body();
47 //      print_headers(current_headers);
48 //      save_current_headers(var_hash);
49 //      interp(input_tree, var_hash);
50 //      print_vars(var_hash);
51
52         return 0;
53 }