/* Initializes the revision cache */ static void pr_cache_init(path_repo_t *repo, int size) { int i; repo->cache = apr_array_make(repo->pool, size, sizeof(pr_cache_entry_t)); for (i = 0; i < size; i++) { APR_ARRAY_PUSH(repo->cache, pr_cache_entry_t).revision = -1; APR_ARRAY_IDX(repo->cache, i, pr_cache_entry_t).tree = cb_tree_make(); } repo->cache_index = 0; }
/* Program entry point */ int main(int argc, char **argv) { cb_tree_t tree = cb_tree_make(); printf("%d ", ++tnum); fflush(stdout); test_insert(&tree); printf("%d ", ++tnum); fflush(stdout); test_complete(&tree, sizeof(dict) / sizeof(const char *)); printf("%d ", ++tnum); fflush(stdout); test_insert_dup(&tree); printf("%d ", ++tnum); fflush(stdout); test_contains(&tree); printf("%d ", ++tnum); fflush(stdout); test_delete(&tree); printf("%d ", ++tnum); fflush(stdout); cb_tree_clear(&tree); test_insert(&tree); test_complete(&tree, sizeof(dict) / sizeof(const char *)); printf("%d ", ++tnum); fflush(stdout); test_delete_all(&tree); printf("%d ", ++tnum); fflush(stdout); test_complete(&tree, 0); printf("%d ", ++tnum); fflush(stdout); cb_tree_clear(&tree); test_empty(&tree); printf("%d ", ++tnum); fflush(stdout); test_insert(&tree); test_prefixes(&tree); cb_tree_clear(&tree); printf("ok\n"); return 0; }