From: <da...@us...> - 2002-11-19 10:28:16
|
Update of /cvsroot/cerber/cerb-ng/ucerb In directory sc8-pr-cvs1:/tmp/cvs-serv17890/ucerb Modified Files: Makefile common.mk libcerb.c libcerb.h Log Message: Implemented code generator for: + dcb_op *tcb_op[] (kcerb/cerb_operations.c) + char *tcb_opname[] (kcerb/cerb_operations.c) + struct fn_u2k fn_u2k_map[] (kcerb/cerb_operations.c) + enum ecb_op (kcerb/cerb_operations.h) Generator also looks for operations declarations in kcerb/cerb_actions.c and kcerb/cerb_actions.h. Index: Makefile =================================================================== RCS file: /cvsroot/cerber/cerb-ng/ucerb/Makefile,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Makefile 17 Nov 2002 16:42:09 -0000 1.14 --- Makefile 19 Nov 2002 10:28:11 -0000 1.15 *************** *** 18,26 **** .endif ! CLEANFILES += *.core *.o *.a $(EXEC) $(BISONFILES) ../kcerb/cerb_urules.o ../kcerb/cerb_tree.o SRCS = *.c ! all: $(EXEC) .if !exists($(EXEC)) @echo --- 18,26 ---- .endif ! CLEANFILES += *.core *.o *.a $(EXEC) $(BISONFILES) ../kcerb/cerb_urules.o ../kcerb/cerb_tree.o ../kcerb/cerb_operations.[cho] SRCS = *.c ! all: $(EXEC) .if !exists($(EXEC)) @echo *************** *** 40,52 **** .if defined(LISTER) ! clang2: clang2.o libtree.a libutil.a libcerb.a clangtoks.o liblister.a $(LD) $(LDFLAGS) clang2.o clangtoks.o -o $(.TARGET) $(LIBS) .else ! clang2: clang2.o libtree.a libutil.a libcerb.a clangtoks.o $(LD) $(LDFLAGS) clang2.o clangtoks.o -o $(.TARGET) $(LIBS) .endif ! liblister.a: ../kcerb/cerb_urules.o ../kcerb/cerb_tree.o ! $(AR) crf liblister.a ../kcerb/cerb_urules.o ../kcerb/cerb_tree.o; tags: $(SRCS) --- 40,52 ---- .if defined(LISTER) ! clang2: clang2.o libtree.a libutil.a libcerb.a clangtoks.o liblister.a ../kcerb/cerb_operations.o $(LD) $(LDFLAGS) clang2.o clangtoks.o -o $(.TARGET) $(LIBS) .else ! clang2: clang2.o libtree.a libutil.a libcerb.a clangtoks.o ../kcerb/cerb_operations.o $(LD) $(LDFLAGS) clang2.o clangtoks.o -o $(.TARGET) $(LIBS) .endif ! liblister.a: ../kcerb/cerb_urules.o ../kcerb/cerb_tree.o ../kcerb/cerb_operations.o ! $(AR) crf liblister.a ../kcerb/cerb_urules.o ../kcerb/cerb_tree.o ../kcerb/cerb_operations.o; tags: $(SRCS) *************** *** 56,64 **** $(LD) $(LDFLAGS) -o $(.TARGET) $(.ALLSRC) - clean: - rm -f $(CLEANFILES) - ! .PHONY: cerb_urules.o cerb_tree.o .include "common.mk" --- 56,61 ---- $(LD) $(LDFLAGS) -o $(.TARGET) $(.ALLSRC) ! .PHONY: cerb_urules.o cerb_tree.o cerb_operations.o .include "common.mk" Index: common.mk =================================================================== RCS file: /cvsroot/cerber/cerb-ng/ucerb/common.mk,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** common.mk 15 Nov 2002 03:29:25 -0000 1.5 --- common.mk 19 Nov 2002 10:28:11 -0000 1.6 *************** *** 26,28 **** --- 26,34 ---- $(CB) $(CBFLAGS) -f $(.IMPSRC) -o $(.TARGET) + libcerb.o: cerb_operations.h + $(CC) $(CFLAGS) -c -o $(.TARGET) $(.IMPSRC) + + cerb_operations.h: + @cd ../kcerb/ ; sh make_operations.sh + .PHONY: all clean Index: libcerb.c =================================================================== RCS file: /cvsroot/cerber/cerb-ng/ucerb/libcerb.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** libcerb.c 18 Nov 2002 20:21:50 -0000 1.20 --- libcerb.c 19 Nov 2002 10:28:11 -0000 1.21 *************** *** 2,6 **** #include "cerb_rules.h" #include "cerb_urules.h" ! #include "cerb_action.h" #include "utils.h" --- 2,6 ---- #include "cerb_rules.h" #include "cerb_urules.h" ! #include "cerb_operations.h" #include "utils.h" *************** *** 28,31 **** --- 28,35 ---- #define LOCAL_VAR -1 + + extern struct fn_u2k fn_u2k_map[]; + + static size_t rule_arr_size = INITIAL_RUlE_ARR_SIZE; static u_register_t rule_no = 0; *************** *** 51,59 **** }; - struct fn_u2k { - char *fn; - int k_val; - }; - struct var_u2k { char *var; --- 55,58 ---- *************** *** 178,183 **** } ! #define USERLAND -1 ! struct fn_u2k fn_u2k_map[] = { {"call", ECB_CALL_O}, --- 177,181 ---- } ! #if 0 struct fn_u2k fn_u2k_map[] = { {"call", ECB_CALL_O}, *************** *** 244,247 **** --- 242,246 ---- {NULL, 0} /* sentinel */ }; + #endif Index: libcerb.h =================================================================== RCS file: /cvsroot/cerber/cerb-ng/ucerb/libcerb.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** libcerb.h 17 Nov 2002 17:19:10 -0000 1.8 --- libcerb.h 19 Nov 2002 10:28:12 -0000 1.9 *************** *** 2,6 **** --- 2,15 ---- #define LIBCERB_H_INCLUDED + #include "cerb_urules.h" #include "cerb_rules.h" + #include "clangdefs.h" + + #define USERLAND -1 + + struct fn_u2k { + char *fn; + int k_val; + }; struct scb_urule *make_rules(expr_list *root); |