$OpenBSD: patch-ctm_ctm_ctm_h,v 1.2 2007/10/31 23:14:46 ajacoutot Exp $
--- ctm/ctm/ctm.h.orig	Wed May  1 01:01:43 1996
+++ ctm/ctm/ctm.h	Wed Oct 31 23:35:36 2007
@@ -10,24 +10,27 @@
  *
  */
 
+#include <ctype.h>
+#include <err.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
-#include <md5.h>
-#include <ctype.h>
 #include <string.h>
-#include <errno.h>
 #include <time.h>
+#include <unistd.h>
+#include <md5.h>
+#include <regex.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/file.h>
 #include <sys/time.h>
 
 #define VERSION "2.0"
-#define MAXSIZE (1024*1024*10)
+#define MAXSIZE (1024*1024*100)
 
 #define SUBSUFF ".ctm"
 #define TMPSUFF ".ctmtmp"
+#define TARCMD  "tar -rf %s -T -"
 
 /* The fields... */
 #define CTM_F_MASK		0xff
@@ -51,12 +54,21 @@
 #define CTM_Q_MD5_Force		0x0800
 
 struct CTM_Syntax {
-    char	*Key;
-    int		*List;
+    char	*Key;		/* CTM key for operation */
+    int		*List;		/* List of operations */
     };
 
 extern struct CTM_Syntax Syntax[];
 
+struct CTM_Filter {
+    struct CTM_Filter	*Next;	/* next filter in the list */
+    int 		Action;	/* enable or disable */
+    regex_t 		CompiledRegex;	/* compiled regex */
+};
+
+#define	CTM_FILTER_DISABLE	0
+#define	CTM_FILTER_ENABLE	1
+
 #define Malloc malloc
 #define Free free
 #define Delete(foo) if (!foo) ; else {Free(foo); foo = 0; }
@@ -74,6 +86,8 @@ EXTERN u_char *FileName;
 EXTERN u_char *TmpDir;
 EXTERN u_char *CatPtr;
 EXTERN u_char *Buffer;
+EXTERN u_char *BackupFile;
+EXTERN u_char *TarCmd;
 
 /*
  * Paranoid -- Just in case they should be after us...
@@ -106,8 +120,12 @@ EXTERN int Verbose;
 EXTERN int Exit;
 EXTERN int Force;
 EXTERN int CheckIt;
+EXTERN int KeepIt;
+EXTERN int ListIt;
 EXTERN int SetTime;
 EXTERN struct timeval Times[2];
+EXTERN struct CTM_Filter	*FilterList;
+EXTERN struct CTM_Filter	*LastFilter;
 
 #define Exit_OK		0
 #define Exit_Garbage	1
@@ -118,6 +136,7 @@ EXTERN struct timeval Times[2];
 #define Exit_Mess	32
 #define Exit_Done	64
 #define Exit_Version	128
+#define Exit_NoMatch	256
 
 void Fatal_(int ln, char *fn, char *kind);
 #define Fatal(foo) Fatal_(__LINE__,__FILE__,foo)
@@ -139,6 +158,7 @@ u_char * Fdata(FILE *fd, int u_chars, MD5_CTX *ctx);
 
 int Pass1(FILE *fd, unsigned applied);
 int Pass2(FILE *fd);
+int PassB(FILE *fd);
 int Pass3(FILE *fd);
 
 int ctm_edit(u_char *script, int length, char *filein, char *fileout);
