]> mj.ucw.cz Git - umpf.git/blobdiff - umpf.c
add nice conditions
[umpf.git] / umpf.c
diff --git a/umpf.c b/umpf.c
index 266fe7aa4c54a61bc07d7fefad033c302de4a35d..f868775a6183f6e3541ca53320be67c724c23327 100644 (file)
--- a/umpf.c
+++ b/umpf.c
@@ -3,40 +3,50 @@
 
 #include "umpf.h"
 
+void
+init(void)
+{
+       list_init(&input_code);
+       var_hash = new_var_hash();
+       const_tab = xmalloc(BUFSIZE);
+       cur_const_n = 1;
+       cur_const_s = BUFSIZE;
+}
+
 int
 main(int argc, char** argv)
 {
        int res;
        
-       //FIXME:
+/*     //FIXME:
        struct passwd* p;
        p = getpwuid(getuid());
        char* default_mbox = cat("/var/mail/", p->pw_name);
        get_default_mailbox(default_mbox);
-
+*/
        if (argc < 2)
                die("Usage: ./umpf conf_file");
 
        save_gids();
        read_conf(argv[1]);
-
+       init();
 //     yydebug=1;
        res = yyparse ();
 
        if (res)
                return res;
 
-//     print_tree(input_tree,0);
+       temp_varcode_start = current_varcode;
+       compile(input_tree);
 
-       var_hash = new_var_hash();
+       print_code();
 
-       current_headers = make_hlist();
-       current_body = get_body();
+//     var_hash = new_var_hash();
+//     current_headers = make_hlist();
+//     current_body = get_body();
 //     print_headers(current_headers);
-
-       save_current_headers(var_hash);
-       interp(input_tree, var_hash);
-       
+//     save_current_headers(var_hash);
+//     interp(input_tree, var_hash);
 //     print_vars(var_hash);
 
        return 0;