static int include_anchored = EXCLUDE_ANCHORED;
/* Pattern anchoring options used for file inclusion */
-#define EXCLUDE_OPTIONS \
- (((wildcards != disable_wildcards) ? EXCLUDE_WILDCARDS : 0) \
- | matching_flags \
- | recursion_option)
-
-#define INCLUDE_OPTIONS \
- (((wildcards == enable_wildcards) ? EXCLUDE_WILDCARDS : 0) \
- | include_anchored \
- | matching_flags \
- | recursion_option)
+static int
+exclude_options (void)
+{
+ return (((wildcards != disable_wildcards) ? EXCLUDE_WILDCARDS : 0)
+ | matching_flags
+ | recursion_option);
+}
+
+static int
+include_options (void)
+{
+ return (((wildcards == enable_wildcards) ? EXCLUDE_WILDCARDS : 0)
+ | include_anchored
+ | matching_flags
+ | recursion_option);
+}
\f
static char const *const vcs_file_table[] = {
/* CVS: */
break;
case EXCLUDE_OPTION:
- add_exclude (excluded, arg, EXCLUDE_OPTIONS);
+ add_exclude (excluded, arg, exclude_options ());
break;
case EXCLUDE_CACHES_OPTION:
break;
case 'X':
- if (add_exclude_file (add_exclude, excluded, arg, EXCLUDE_OPTIONS, '\n')
+ if (add_exclude_file (add_exclude, excluded, arg,
+ exclude_options (), '\n')
!= 0)
paxfatal (errno, "%s", quotearg_colon (arg));
break;
buffer->change_dir = change_dir;
buffer->next = 0;
buffer->found_count = 0;
- buffer->matching_flags = INCLUDE_OPTIONS;
+ buffer->matching_flags = include_options ();
buffer->directory = NULL;
buffer->parent = NULL;
buffer->cmdline = true;
name->prev = nametail;
name->next = NULL;
name->found_count = 0;
- name->matching_flags = INCLUDE_OPTIONS;
+ name->matching_flags = include_options ();
name->change_dir = change_dir;
name->directory = NULL;
name->parent = parent;
nametail = namelist;
name->found_count = 0;
- name->matching_flags = INCLUDE_OPTIONS;
+ name->matching_flags = include_options ();
name->change_dir = 0;
name->directory = NULL;
name->parent = NULL;
to order names. Return the sorted list. Note that after calling
this function, the 'prev' links in list elements are messed up.
- Apart from the type 'struct name' and the definition of SUCCESSOR,
+ Apart from the type 'struct name' and its 'next' member,
this is a generic list-sorting function, but it's too painful to
make it both generic and portable
in C. */
struct name *cursor;
int counter;
-# define SUCCESSOR(name) ((name)->next)
-
if (length == 1)
return list;
if (length == 2)
{
- if ((*compare) (list, SUCCESSOR (list)) > 0)
+ if (compare (list, list->next) > 0)
{
- result = SUCCESSOR (list);
- SUCCESSOR (result) = list;
- SUCCESSOR (list) = 0;
+ result = list->next;
+ result->next = list;
+ list->next = 0;
return result;
}
return list;
second_length = length / 2;
for (cursor = list, counter = first_length - 1;
counter;
- cursor = SUCCESSOR (cursor), counter--)
+ cursor = cursor->next, counter--)
continue;
- second_list = SUCCESSOR (cursor);
- SUCCESSOR (cursor) = 0;
+ second_list = cursor->next;
+ cursor->next = 0;
first_list = merge_sort_sll (first_list, first_length, compare);
second_list = merge_sort_sll (second_list, second_length, compare);
merge_point = &result;
while (first_list && second_list)
- if ((*compare) (first_list, second_list) < 0)
+ if (compare (first_list, second_list) < 0)
{
- cursor = SUCCESSOR (first_list);
+ cursor = first_list->next;
*merge_point = first_list;
- merge_point = &SUCCESSOR (first_list);
+ merge_point = &first_list->next;
first_list = cursor;
}
else
{
- cursor = SUCCESSOR (second_list);
+ cursor = second_list->next;
*merge_point = second_list;
- merge_point = &SUCCESSOR (second_list);
+ merge_point = &second_list->next;
second_list = cursor;
}
if (first_list)
*merge_point = second_list;
return result;
-
-#undef SUCCESSOR
}
/* Sort doubly linked LIST of names, of given LENGTH, using COMPARE