[dovecot-cvs] dovecot-sieve/src/libsieve Makefile.am, 1.2, 1.3 bc_eval.c, 1.1.1.1, 1.2 bytecode.h, 1.1.1.1, 1.2 sieved.c, 1.1.1.1, 1.2

cras at dovecot.org cras at dovecot.org
Sat Jul 1 21:50:43 EEST 2006


Update of /var/lib/cvs/dovecot-sieve/src/libsieve
In directory talvi:/tmp/cvs-serv15421

Modified Files:
	Makefile.am bc_eval.c bytecode.h sieved.c 
Log Message:
Build sieve decompiler (sieved) also.



Index: Makefile.am
===================================================================
RCS file: /var/lib/cvs/dovecot-sieve/src/libsieve/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Makefile.am	17 Jun 2006 17:22:05 -0000	1.2
+++ Makefile.am	1 Jul 2006 18:50:40 -0000	1.3
@@ -1,6 +1,6 @@
 pkglibexecdir = $(libexecdir)/dovecot
 
-pkglibexec_PROGRAMS = sievec
+pkglibexec_PROGRAMS = sievec sieved
 
 noinst_LTLIBRARIES = libsieve.la
 
@@ -22,10 +22,18 @@
 	../map.c \
 	../imparse.c
 
+sieved_SOURCES = \
+	sieved.c \
+	../map.c
+
 sievec_LDADD = \
 	libsieve.la \
 	$(dovecotdir)/src/lib/liblib.a
 
+sieved_LDADD = \
+	libsieve.la \
+	$(dovecotdir)/src/lib/liblib.a
+
 libsieve_la_SOURCES = \
 	addr.y \
 	sieve.y \

Index: bc_eval.c
===================================================================
RCS file: /var/lib/cvs/dovecot-sieve/src/libsieve/bc_eval.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- bc_eval.c	11 Jun 2006 11:03:53 -0000	1.1.1.1
+++ bc_eval.c	1 Jul 2006 18:50:40 -0000	1.2
@@ -51,7 +51,7 @@
 /* Given a bytecode_input_t at the beginning of a string (the len block),
  * return the string, the length, and the bytecode index of the NEXT
  * item */
-static int unwrap_string(bytecode_input_t *bc, int pos, const char **str, int *len)
+int unwrap_string(bytecode_input_t *bc, int pos, const char **str, int *len)
 {
     int local_len = ntohl(bc[pos].value);
 

Index: bytecode.h
===================================================================
RCS file: /var/lib/cvs/dovecot-sieve/src/libsieve/bytecode.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- bytecode.h	11 Jun 2006 11:03:53 -0000	1.1.1.1
+++ bytecode.h	1 Jul 2006 18:50:40 -0000	1.2
@@ -188,4 +188,6 @@
   
 };
 
+int unwrap_string(bytecode_input_t *bc, int pos, const char **str, int *len);
+
 #endif

Index: sieved.c
===================================================================
RCS file: /var/lib/cvs/dovecot-sieve/src/libsieve/sieved.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- sieved.c	11 Jun 2006 11:03:54 -0000	1.1.1.1
+++ sieved.c	1 Jul 2006 18:50:40 -0000	1.2
@@ -42,21 +42,10 @@
 
 #include "map.h"
 
-void dump2(bytecode_input_t *d, int len);
-int dump2_test(bytecode_input_t * d, int i);
- 
-/* from bc_eval.c */
-int unwrap_string(bytecode_input_t *bc, int pos, const char **str, int *len);
-
-/*this is called by xmalloc*/
-void fatal(const char *s, int code)
-{  
-    printf("Fatal error: %s (%d)\r\n", s, code);
-                           
-    exit(1);
-}
+static void dump2(bytecode_input_t *d, int len);
+static int dump2_test(bytecode_input_t * d, int i);
 
-int load(int fd, bytecode_input_t ** d)
+static int load(int fd, bytecode_input_t ** d)
 {  
     const char * data=NULL;
     struct stat sbuf;
@@ -98,6 +87,7 @@
 	exit(1);
     }
     
+    lib_init();
     len=load(script_fd,&bc);
     close(script_fd);
     
@@ -109,7 +99,7 @@
     }
 }
 
-int write_list(int list_len, int i, bytecode_input_t * d)
+static int write_list(int list_len, int i, bytecode_input_t * d)
 {
     int x;
     i++;
@@ -125,7 +115,7 @@
     return i;
 }
 
-int printComparison(bytecode_input_t *d ,int i)
+static int printComparison(bytecode_input_t *d ,int i)
 {
     printf("Comparison: ");
     switch(ntohl(d[i].value))
@@ -179,7 +169,7 @@
 }
 
 
-int dump2_test(bytecode_input_t * d, int i)
+static int dump2_test(bytecode_input_t * d, int i)
 {
     int l,x;
     switch(ntohl(d[i].value)) {
@@ -294,7 +284,7 @@
     return i;
 }
 
-void dump2(bytecode_input_t *d, int bc_len) 
+static void dump2(bytecode_input_t *d, int bc_len)
 {
     int i;
     const char *data;



More information about the dovecot-cvs mailing list