Use typedefs for the filter structures.
authorWayne Davison <wayned@samba.org>
Sat, 23 May 2009 15:50:42 +0000 (08:50 -0700)
committerWayne Davison <wayned@samba.org>
Sat, 23 May 2009 16:07:43 +0000 (09:07 -0700)
12 files changed:
batch.c
clientserver.c
compat.c
exclude.c
flist.c
generator.c
main.c
options.c
receiver.c
rsync.h
t_stub.c
util.c

diff --git a/batch.c b/batch.c
index 369d82f..99b84ea 100644 (file)
--- a/batch.c
+++ b/batch.c
@@ -43,7 +43,7 @@ extern char *batch_name;
 extern char *iconv_opt;
 #endif
 
 extern char *iconv_opt;
 #endif
 
-extern struct filter_list_struct filter_list;
+extern filter_rule_list filter_list;
 
 int batch_stream_flags;
 
 
 int batch_stream_flags;
 
@@ -191,7 +191,7 @@ static int write_arg(int fd, char *arg)
 
 static void write_filter_rules(int fd)
 {
 
 static void write_filter_rules(int fd)
 {
-       struct filter_struct *ent;
+       filter_rule *ent;
 
        write_sbuf(fd, " <<'#E#'\n");
        for (ent = filter_list.head; ent; ent = ent->next) {
 
        write_sbuf(fd, " <<'#E#'\n");
        for (ent = filter_list.head; ent; ent = ent->next) {
index 11d257e..b16e0fc 100644 (file)
@@ -55,7 +55,7 @@ extern char *logfile_format;
 extern char *files_from;
 extern char *tmpdir;
 extern struct chmod_mode_struct *chmod_modes;
 extern char *files_from;
 extern char *tmpdir;
 extern struct chmod_mode_struct *chmod_modes;
-extern struct filter_list_struct daemon_filter_list;
+extern filter_rule_list daemon_filter_list;
 extern char curr_dir[MAXPATHLEN];
 #ifdef ICONV_OPTION
 extern char *iconv_opt;
 extern char curr_dir[MAXPATHLEN];
 #ifdef ICONV_OPTION
 extern char *iconv_opt;
index 787e289..f1a1e70 100644 (file)
--- a/compat.c
+++ b/compat.c
@@ -52,7 +52,7 @@ extern char *partial_dir;
 extern char *dest_option;
 extern char *files_from;
 extern char *filesfrom_host;
 extern char *dest_option;
 extern char *files_from;
 extern char *filesfrom_host;
-extern struct filter_list_struct filter_list;
+extern filter_rule_list filter_list;
 extern int need_unsorted_flist;
 #ifdef ICONV_OPTION
 extern iconv_t ic_send, ic_recv;
 extern int need_unsorted_flist;
 #ifdef ICONV_OPTION
 extern iconv_t ic_send, ic_recv;
index af2640c..08fa110 100644 (file)
--- a/exclude.c
+++ b/exclude.c
@@ -40,9 +40,9 @@ extern char curr_dir[MAXPATHLEN];
 extern unsigned int curr_dir_len;
 extern unsigned int module_dirlen;
 
 extern unsigned int curr_dir_len;
 extern unsigned int module_dirlen;
 
-struct filter_list_struct filter_list = { .debug_type = "" };
-struct filter_list_struct cvs_filter_list = { .debug_type = " [global CVS]" };
-struct filter_list_struct daemon_filter_list = { .debug_type = " [daemon]" };
+filter_rule_list filter_list = { .debug_type = "" };
+filter_rule_list cvs_filter_list = { .debug_type = " [global CVS]" };
+filter_rule_list daemon_filter_list = { .debug_type = " [daemon]" };
 
 /* Need room enough for ":MODS " prefix plus some room to grow. */
 #define MAX_RULE_PREFIX (16)
 
 /* Need room enough for ":MODS " prefix plus some room to grow. */
 #define MAX_RULE_PREFIX (16)
@@ -67,7 +67,7 @@ static BOOL parent_dirscan = False;
 /* This array contains a list of all the currently active per-dir merge
  * files.  This makes it easier to save the appropriate values when we
  * "push" down into each subdirectory. */
 /* This array contains a list of all the currently active per-dir merge
  * files.  This makes it easier to save the appropriate values when we
  * "push" down into each subdirectory. */
-static struct filter_struct **mergelist_parents;
+static filter_rule **mergelist_parents;
 static int mergelist_cnt = 0;
 static int mergelist_size = 0;
 
 static int mergelist_cnt = 0;
 static int mergelist_size = 0;
 
@@ -102,7 +102,7 @@ static int mergelist_size = 0;
  * values (so we can pop back to them later) and set the tail to NULL.
  */
 
  * values (so we can pop back to them later) and set the tail to NULL.
  */
 
-static void teardown_mergelist(struct filter_struct *ex)
+static void teardown_mergelist(filter_rule *ex)
 {
        if (DEBUG_GTE(FILTER, 2)) {
                rprintf(FINFO, "[%s] deactivating mergelist #%d%s\n",
 {
        if (DEBUG_GTE(FILTER, 2)) {
                rprintf(FINFO, "[%s] deactivating mergelist #%d%s\n",
@@ -122,7 +122,7 @@ static void teardown_mergelist(struct filter_struct *ex)
        mergelist_cnt--;
 }
 
        mergelist_cnt--;
 }
 
-static void free_filter(struct filter_struct *ex)
+static void free_filter(filter_rule *ex)
 {
        if (ex->rflags & FILTRULE_PERDIR_MERGE)
                teardown_mergelist(ex);
 {
        if (ex->rflags & FILTRULE_PERDIR_MERGE)
                teardown_mergelist(ex);
@@ -130,21 +130,21 @@ static void free_filter(struct filter_struct *ex)
        free(ex);
 }
 
        free(ex);
 }
 
-static void free_filters(struct filter_struct *head)
+static void free_filters(filter_rule *head)
 {
 {
-       struct filter_struct *rev_head = NULL;
+       filter_rule *rev_head = NULL;
 
        /* Reverse the list so we deactivate mergelists in the proper LIFO
         * order. */
        while (head) {
 
        /* Reverse the list so we deactivate mergelists in the proper LIFO
         * order. */
        while (head) {
-               struct filter_struct *next = head->next;
+               filter_rule *next = head->next;
                head->next = rev_head;
                rev_head = head;
                head = next;
        }
 
        while (rev_head) {
                head->next = rev_head;
                rev_head = head;
                head = next;
        }
 
        while (rev_head) {
-               struct filter_struct *prev = rev_head->next;
+               filter_rule *prev = rev_head->next;
                free_filter(rev_head);
                rev_head = prev;
        }
                free_filter(rev_head);
                rev_head = prev;
        }
@@ -152,10 +152,10 @@ static void free_filters(struct filter_struct *head)
 
 /* Build a filter structure given a filter pattern.  The value in "pat"
  * is not null-terminated. */
 
 /* Build a filter structure given a filter pattern.  The value in "pat"
  * is not null-terminated. */
-static void add_rule(struct filter_list_struct *listp, const char *pat,
+static void add_rule(filter_rule_list *listp, const char *pat,
                     unsigned int pat_len, uint32 rflags, int xflags)
 {
                     unsigned int pat_len, uint32 rflags, int xflags)
 {
-       struct filter_struct *ret;
+       filter_rule *ret;
        const char *cp;
        unsigned int pre_len, suf_len, slash_cnt = 0;
 
        const char *cp;
        unsigned int pre_len, suf_len, slash_cnt = 0;
 
@@ -180,7 +180,7 @@ static void add_rule(struct filter_list_struct *listp, const char *pat,
                }
        }
 
                }
        }
 
-       if (!(ret = new0(struct filter_struct)))
+       if (!(ret = new0(filter_rule)))
                out_of_memory("add_rule");
 
        if (pat_len > 1 && pat[pat_len-1] == '/') {
                out_of_memory("add_rule");
 
        if (pat_len > 1 && pat[pat_len-1] == '/') {
@@ -246,7 +246,7 @@ static void add_rule(struct filter_list_struct *listp, const char *pat,
        }
 
        if (rflags & FILTRULE_PERDIR_MERGE) {
        }
 
        if (rflags & FILTRULE_PERDIR_MERGE) {
-               struct filter_list_struct *lp;
+               filter_rule_list *lp;
                unsigned int len;
                int i;
 
                unsigned int len;
                int i;
 
@@ -258,7 +258,7 @@ static void add_rule(struct filter_list_struct *listp, const char *pat,
                /* If the local merge file was already mentioned, don't
                 * add it again. */
                for (i = 0; i < mergelist_cnt; i++) {
                /* If the local merge file was already mentioned, don't
                 * add it again. */
                for (i = 0; i < mergelist_cnt; i++) {
-                       struct filter_struct *ex = mergelist_parents[i];
+                       filter_rule *ex = mergelist_parents[i];
                        const char *s = strrchr(ex->pattern, '/');
                        if (s)
                                s++;
                        const char *s = strrchr(ex->pattern, '/');
                        if (s)
                                s++;
@@ -272,7 +272,7 @@ static void add_rule(struct filter_list_struct *listp, const char *pat,
                        }
                }
 
                        }
                }
 
-               if (!(lp = new_array(struct filter_list_struct, 1)))
+               if (!(lp = new_array(filter_rule_list, 1)))
                        out_of_memory("add_rule");
                lp->head = lp->tail = lp->parent_dirscan_head = NULL;
                if (asprintf(&lp->debug_type, " [per-dir %s]", cp) < 0)
                        out_of_memory("add_rule");
                lp->head = lp->tail = lp->parent_dirscan_head = NULL;
                if (asprintf(&lp->debug_type, " [per-dir %s]", cp) < 0)
@@ -282,7 +282,7 @@ static void add_rule(struct filter_list_struct *listp, const char *pat,
                if (mergelist_cnt == mergelist_size) {
                        mergelist_size += 5;
                        mergelist_parents = realloc_array(mergelist_parents,
                if (mergelist_cnt == mergelist_size) {
                        mergelist_size += 5;
                        mergelist_parents = realloc_array(mergelist_parents,
-                                               struct filter_struct *,
+                                               filter_rule *,
                                                mergelist_size);
                        if (!mergelist_parents)
                                out_of_memory("add_rule");
                                                mergelist_size);
                        if (!mergelist_parents)
                                out_of_memory("add_rule");
@@ -307,7 +307,7 @@ static void add_rule(struct filter_list_struct *listp, const char *pat,
        }
 }
 
        }
 }
 
-static void clear_filter_list(struct filter_list_struct *listp)
+static void clear_filter_list(filter_rule_list *listp)
 {
        if (listp->tail) {
                /* Truncate any inherited items from the local list. */
 {
        if (listp->tail) {
                /* Truncate any inherited items from the local list. */
@@ -413,8 +413,8 @@ void set_filter_dir(const char *dir, unsigned int dirlen)
  * parent directory of the first transfer dir.  If it does, we scan all the
  * dirs from that point through the parent dir of the transfer dir looking
  * for the per-dir merge-file in each one. */
  * parent directory of the first transfer dir.  If it does, we scan all the
  * dirs from that point through the parent dir of the transfer dir looking
  * for the per-dir merge-file in each one. */
-static BOOL setup_merge_file(int mergelist_num, struct filter_struct *ex,
-                            struct filter_list_struct *lp)
+static BOOL setup_merge_file(int mergelist_num, filter_rule *ex,
+                            filter_rule_list *lp)
 {
        char buf[MAXPATHLEN];
        char *x, *y, *pat = ex->pattern;
 {
        char buf[MAXPATHLEN];
        char *x, *y, *pat = ex->pattern;
@@ -480,7 +480,7 @@ static BOOL setup_merge_file(int mergelist_num, struct filter_struct *ex,
 
 struct local_filter_state {
        int mergelist_cnt;
 
 struct local_filter_state {
        int mergelist_cnt;
-       struct filter_list_struct mergelists[1];
+       filter_rule_list mergelists[1];
 };
 
 /* Each time rsync changes to a new directory it call this function to
 };
 
 /* Each time rsync changes to a new directory it call this function to
@@ -505,21 +505,21 @@ void *push_local_filters(const char *dir, unsigned int dirlen)
 
        push = (struct local_filter_state *)new_array(char,
                          sizeof (struct local_filter_state)
 
        push = (struct local_filter_state *)new_array(char,
                          sizeof (struct local_filter_state)
-                       + (mergelist_cnt-1) * sizeof (struct filter_list_struct));
+                       + (mergelist_cnt-1) * sizeof (filter_rule_list));
        if (!push)
                out_of_memory("push_local_filters");
 
        push->mergelist_cnt = mergelist_cnt;
        for (i = 0; i < mergelist_cnt; i++) {
                memcpy(&push->mergelists[i], mergelist_parents[i]->u.mergelist,
        if (!push)
                out_of_memory("push_local_filters");
 
        push->mergelist_cnt = mergelist_cnt;
        for (i = 0; i < mergelist_cnt; i++) {
                memcpy(&push->mergelists[i], mergelist_parents[i]->u.mergelist,
-                      sizeof (struct filter_list_struct));
+                      sizeof (filter_rule_list));
        }
 
        /* Note: parse_filter_file() might increase mergelist_cnt, so keep
         * this loop separate from the above loop. */
        for (i = 0; i < mergelist_cnt; i++) {
        }
 
        /* Note: parse_filter_file() might increase mergelist_cnt, so keep
         * this loop separate from the above loop. */
        for (i = 0; i < mergelist_cnt; i++) {
-               struct filter_struct *ex = mergelist_parents[i];
-               struct filter_list_struct *lp = ex->u.mergelist;
+               filter_rule *ex = mergelist_parents[i];
+               filter_rule_list *lp = ex->u.mergelist;
 
                if (DEBUG_GTE(FILTER, 2)) {
                        rprintf(FINFO, "[%s] pushing mergelist #%d%s\n",
 
                if (DEBUG_GTE(FILTER, 2)) {
                        rprintf(FINFO, "[%s] pushing mergelist #%d%s\n",
@@ -562,8 +562,8 @@ void pop_local_filters(void *mem)
                rprintf(FINFO, "[%s] popping local filters\n", who_am_i());
 
        for (i = mergelist_cnt; i-- > 0; ) {
                rprintf(FINFO, "[%s] popping local filters\n", who_am_i());
 
        for (i = mergelist_cnt; i-- > 0; ) {
-               struct filter_struct *ex = mergelist_parents[i];
-               struct filter_list_struct *lp = ex->u.mergelist;
+               filter_rule *ex = mergelist_parents[i];
+               filter_rule_list *lp = ex->u.mergelist;
 
                if (DEBUG_GTE(FILTER, 2)) {
                        rprintf(FINFO, "[%s] popping mergelist #%d%s\n",
 
                if (DEBUG_GTE(FILTER, 2)) {
                        rprintf(FINFO, "[%s] popping mergelist #%d%s\n",
@@ -600,7 +600,7 @@ void pop_local_filters(void *mem)
 
        for (i = 0; i < mergelist_cnt; i++) {
                memcpy(mergelist_parents[i]->u.mergelist, &pop->mergelists[i],
 
        for (i = 0; i < mergelist_cnt; i++) {
                memcpy(mergelist_parents[i]->u.mergelist, &pop->mergelists[i],
-                      sizeof (struct filter_list_struct));
+                      sizeof (filter_rule_list));
        }
 
        free(pop);
        }
 
        free(pop);
@@ -634,7 +634,7 @@ void change_local_filter_dir(const char *dname, int dlen, int dir_depth)
        filt_array[cur_depth] = push_local_filters(dname, dlen);
 }
 
        filt_array[cur_depth] = push_local_filters(dname, dlen);
 }
 
-static int rule_matches(const char *fname, struct filter_struct *ex, int name_is_dir)
+static int rule_matches(const char *fname, filter_rule *ex, int name_is_dir)
 {
        int slash_handling, str_cnt = 0, anchored_match = 0;
        int ret_match = ex->rflags & FILTRULE_NEGATE ? 0 : 1;
 {
        int slash_handling, str_cnt = 0, anchored_match = 0;
        int ret_match = ex->rflags & FILTRULE_NEGATE ? 0 : 1;
@@ -714,7 +714,7 @@ static int rule_matches(const char *fname, struct filter_struct *ex, int name_is
 
 
 static void report_filter_result(enum logcode code, char const *name,
 
 
 static void report_filter_result(enum logcode code, char const *name,
-                                struct filter_struct const *ent,
+                                filter_rule const *ent,
                                 int name_is_dir, const char *type)
 {
        /* If a trailing slash is present to match only directories,
                                 int name_is_dir, const char *type)
 {
        /* If a trailing slash is present to match only directories,
@@ -737,10 +737,10 @@ static void report_filter_result(enum logcode code, char const *name,
  * Return -1 if file "name" is defined to be excluded by the specified
  * exclude list, 1 if it is included, and 0 if it was not matched.
  */
  * Return -1 if file "name" is defined to be excluded by the specified
  * exclude list, 1 if it is included, and 0 if it was not matched.
  */
-int check_filter(struct filter_list_struct *listp, enum logcode code,
+int check_filter(filter_rule_list *listp, enum logcode code,
                 const char *name, int name_is_dir)
 {
                 const char *name, int name_is_dir)
 {
-       struct filter_struct *ent;
+       filter_rule *ent;
 
        for (ent = listp->head; ent; ent = ent->next) {
                if (ignore_perishable && ent->rflags & FILTRULE_PERISHABLE)
 
        for (ent = listp->head; ent; ent = ent->next) {
                if (ignore_perishable && ent->rflags & FILTRULE_PERISHABLE)
@@ -1039,7 +1039,7 @@ static void get_cvs_excludes(uint32 rflags)
 }
 
 
 }
 
 
-void parse_rule(struct filter_list_struct *listp, const char *pattern,
+void parse_rule(filter_rule_list *listp, const char *pattern,
                uint32 rflags, int xflags)
 {
        unsigned int pat_len;
                uint32 rflags, int xflags)
 {
        unsigned int pat_len;
@@ -1115,7 +1115,7 @@ void parse_rule(struct filter_list_struct *listp, const char *pattern,
 }
 
 
 }
 
 
-void parse_filter_file(struct filter_list_struct *listp, const char *fname,
+void parse_filter_file(filter_rule_list *listp, const char *fname,
                       uint32 rflags, int xflags)
 {
        FILE *fp;
                       uint32 rflags, int xflags)
 {
        FILE *fp;
@@ -1254,9 +1254,9 @@ char *get_rule_prefix(int rflags, const char *pat, int for_xfer,
        return buf;
 }
 
        return buf;
 }
 
-static void send_rules(int f_out, struct filter_list_struct *flp)
+static void send_rules(int f_out, filter_rule_list *flp)
 {
 {
-       struct filter_struct *ent, *prev = NULL;
+       filter_rule *ent, *prev = NULL;
 
        for (ent = flp->head; ent; ent = ent->next) {
                unsigned int len, plen, dlen;
 
        for (ent = flp->head; ent; ent = ent->next) {
                unsigned int len, plen, dlen;
diff --git a/flist.c b/flist.c
index 2af7e88..1dee087 100644 (file)
--- a/flist.c
+++ b/flist.c
@@ -79,8 +79,8 @@ extern char curr_dir[MAXPATHLEN];
 
 extern struct chmod_mode_struct *chmod_modes;
 
 
 extern struct chmod_mode_struct *chmod_modes;
 
-extern struct filter_list_struct filter_list;
-extern struct filter_list_struct daemon_filter_list;
+extern filter_rule_list filter_list;
+extern filter_rule_list daemon_filter_list;
 
 #ifdef ICONV_OPTION
 extern int filesfrom_convert;
 
 #ifdef ICONV_OPTION
 extern int filesfrom_convert;
@@ -1743,7 +1743,7 @@ static void send_implied_dirs(int f, struct file_list *flist, char *fname,
        item_list *relname_list;
        relnamecache **rnpp;
        int len, need_new_dir, depth = 0;
        item_list *relname_list;
        relnamecache **rnpp;
        int len, need_new_dir, depth = 0;
-       struct filter_list_struct save_filter_list = filter_list;
+       filter_rule_list save_filter_list = filter_list;
 
        flags = (flags | FLAG_IMPLIED_DIR) & ~(FLAG_TOP_DIR | FLAG_CONTENT_DIR);
        filter_list.head = filter_list.tail = NULL; /* Don't filter implied dirs. */
 
        flags = (flags | FLAG_IMPLIED_DIR) & ~(FLAG_TOP_DIR | FLAG_CONTENT_DIR);
        filter_list.head = filter_list.tail = NULL; /* Don't filter implied dirs. */
index 1ccb55a..99b8057 100644 (file)
@@ -97,7 +97,7 @@ extern mode_t orig_umask;
 extern uid_t our_uid;
 extern char *basis_dir[MAX_BASIS_DIRS+1];
 extern struct file_list *cur_flist, *first_flist, *dir_flist;
 extern uid_t our_uid;
 extern char *basis_dir[MAX_BASIS_DIRS+1];
 extern struct file_list *cur_flist, *first_flist, *dir_flist;
-extern struct filter_list_struct filter_list, daemon_filter_list;
+extern filter_rule_list filter_list, daemon_filter_list;
 
 int maybe_ATTRS_REPORT = 0;
 
 
 int maybe_ATTRS_REPORT = 0;
 
diff --git a/main.c b/main.c
index bf0bb14..8c2307a 100644 (file)
--- a/main.c
+++ b/main.c
@@ -82,7 +82,7 @@ extern char curr_dir[MAXPATHLEN];
 extern char backup_dir_buf[MAXPATHLEN];
 extern char *basis_dir[MAX_BASIS_DIRS+1];
 extern struct file_list *first_flist;
 extern char backup_dir_buf[MAXPATHLEN];
 extern char *basis_dir[MAX_BASIS_DIRS+1];
 extern struct file_list *first_flist;
-extern struct filter_list_struct daemon_filter_list;
+extern filter_rule_list daemon_filter_list;
 
 uid_t our_uid;
 int am_generator = 0;
 
 uid_t our_uid;
 int am_generator = 0;
@@ -1000,7 +1000,7 @@ static void do_server_recv(int f_in, int f_out, int argc, char *argv[])
 
        if (daemon_filter_list.head) {
                char **dir_p;
 
        if (daemon_filter_list.head) {
                char **dir_p;
-               struct filter_list_struct *elp = &daemon_filter_list;
+               filter_rule_list *elp = &daemon_filter_list;
 
                for (dir_p = basis_dir; *dir_p; dir_p++) {
                        char *dir = *dir_p;
 
                for (dir_p = basis_dir; *dir_p; dir_p++) {
                        char *dir = *dir_p;
index 49af4b4..bd6a495 100644 (file)
--- a/options.c
+++ b/options.c
@@ -29,8 +29,8 @@ extern int local_server;
 extern int sanitize_paths;
 extern int daemon_over_rsh;
 extern unsigned int module_dirlen;
 extern int sanitize_paths;
 extern int daemon_over_rsh;
 extern unsigned int module_dirlen;
-extern struct filter_list_struct filter_list;
-extern struct filter_list_struct daemon_filter_list;
+extern filter_rule_list filter_list;
+extern filter_rule_list daemon_filter_list;
 
 int make_backups = 0;
 
 
 int make_backups = 0;
 
@@ -1972,7 +1972,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        backup_dir = sanitize_path(NULL, backup_dir, NULL, 0, SP_DEFAULT);
        }
        if (daemon_filter_list.head && !am_sender) {
                        backup_dir = sanitize_path(NULL, backup_dir, NULL, 0, SP_DEFAULT);
        }
        if (daemon_filter_list.head && !am_sender) {
-               struct filter_list_struct *elp = &daemon_filter_list;
+               filter_rule_list *elp = &daemon_filter_list;
                if (tmpdir) {
                        char *dir;
                        if (!*tmpdir)
                if (tmpdir) {
                        char *dir;
                        if (!*tmpdir)
index d6481eb..9d839fa 100644 (file)
@@ -56,7 +56,7 @@ extern char *partial_dir;
 extern char *basis_dir[MAX_BASIS_DIRS+1];
 extern char sender_file_sum[MAX_DIGEST_LEN];
 extern struct file_list *cur_flist, *first_flist, *dir_flist;
 extern char *basis_dir[MAX_BASIS_DIRS+1];
 extern char sender_file_sum[MAX_DIGEST_LEN];
 extern struct file_list *cur_flist, *first_flist, *dir_flist;
-extern struct filter_list_struct daemon_filter_list;
+extern filter_rule_list daemon_filter_list;
 
 static struct bitbag *delayed_bits = NULL;
 static int phase = 0, redoing = 0;
 
 static struct bitbag *delayed_bits = NULL;
 static int phase = 0, redoing = 0;
diff --git a/rsync.h b/rsync.h
index baf2f02..0efccfa 100644 (file)
--- a/rsync.h
+++ b/rsync.h
@@ -824,7 +824,7 @@ struct map_struct {
                                | FILTRULE_NEGATE | FILTRULE_RECEIVER_SIDE \
                                | FILTRULE_PERISHABLE)
 
                                | FILTRULE_NEGATE | FILTRULE_RECEIVER_SIDE \
                                | FILTRULE_PERISHABLE)
 
-struct filter_struct {
+typedef struct filter_struct {
        struct filter_struct *next;
        char *pattern;
        uint32 rflags;
        struct filter_struct *next;
        char *pattern;
        uint32 rflags;
@@ -832,14 +832,14 @@ struct filter_struct {
                int slash_cnt;
                struct filter_list_struct *mergelist;
        } u;
                int slash_cnt;
                struct filter_list_struct *mergelist;
        } u;
-};
+} filter_rule;
 
 
-struct filter_list_struct {
-       struct filter_struct *head;
-       struct filter_struct *tail;
-       struct filter_struct *parent_dirscan_head;
+typedef struct filter_list_struct {
+       filter_rule *head;
+       filter_rule *tail;
+       filter_rule *parent_dirscan_head;
        char *debug_type;
        char *debug_type;
-};
+} filter_rule_list;
 
 struct stats {
        int64 total_size;
 
 struct stats {
        int64 total_size;
index db6d1fe..e176b8b 100644 (file)
--- a/t_stub.c
+++ b/t_stub.c
@@ -30,7 +30,7 @@ mode_t orig_umask = 002;
 char number_separator = ',';
 char *partial_dir;
 char *module_dir;
 char number_separator = ',';
 char *partial_dir;
 char *module_dir;
-struct filter_list_struct daemon_filter_list;
+filter_rule_list daemon_filter_list;
 
  void rprintf(UNUSED(enum logcode code), const char *format, ...)
 {
 
  void rprintf(UNUSED(enum logcode code), const char *format, ...)
 {
@@ -57,7 +57,7 @@ struct filter_list_struct daemon_filter_list;
        exit(code);
 }
 
        exit(code);
 }
 
- int check_filter(UNUSED(struct filter_list_struct *listp), UNUSED(enum logcode code),
+ int check_filter(UNUSED(filter_rule_list *listp), UNUSED(enum logcode code),
                  UNUSED(const char *name), UNUSED(int name_is_dir))
 {
        /* This function doesn't really get called in this test context, so
                  UNUSED(const char *name), UNUSED(int name_is_dir))
 {
        /* This function doesn't really get called in this test context, so
diff --git a/util.c b/util.c
index bec9a93..4d58dc4 100644 (file)
--- a/util.c
+++ b/util.c
@@ -34,7 +34,7 @@ extern char *module_dir;
 extern unsigned int module_dirlen;
 extern mode_t orig_umask;
 extern char *partial_dir;
 extern unsigned int module_dirlen;
 extern mode_t orig_umask;
 extern char *partial_dir;
-extern struct filter_list_struct daemon_filter_list;
+extern filter_rule_list daemon_filter_list;
 
 int sanitize_paths = 0;
 
 
 int sanitize_paths = 0;