struct cache_entry **active_cache = NULL;
unsigned int active_nr = 0, active_alloc = 0;
-void usage(const char *err)
+void usage(const char *err, ...)
{
- fprintf(stderr, "read-tree: %s\n", err);
+ va_list args;
+
+ va_start(args, err);
+ vfprintf(stderr, err, args);
+ va_end(args);
exit(1);
}
return 0;
}
-int add_cache_entry(struct cache_entry *ce)
+int add_cache_entry(struct cache_entry *ce, int ok_to_add)
{
int pos;
return 0;
}
+ if (!ok_to_add)
+ return -1;
+
/* Make sure the array is big enough .. */
if (active_nr == active_alloc) {
active_alloc = alloc_nr(active_alloc);