struct context *context_new_test(struct context *parent, void *context, const char *called_path) { struct context *c; c = talloc(context, struct context); c->type = CONTEXT_TYPE_TEST; c->parent = c; c->test_parent = parent; c->bin_dir = talloc_reference(c, parent->chk_dir); c->lib_dir = talloc_reference(c, parent->lib_dir); c->hdr_dir = talloc_reference(c, parent->hdr_dir); c->obj_dir = talloc_reference(c, parent->obj_dir); c->src_dir = talloc_asprintf(c, "%s/%s", parent->tst_dir, parent->called_path); c->chk_dir = talloc_reference(c, parent->chk_dir); c->tst_dir = talloc_reference(c, parent->tst_dir); c->gen_dir = talloc_reference(c, parent->gen_dir); c->prefix = talloc_reference(c, parent->prefix); c->libexec_dir = talloc_reference(c, parent->libexec_dir); c->share_dir = talloc_reference(c, parent->share_dir); c->compile_opts = stringlist_copy(parent->compile_opts, c); c->link_opts = stringlist_copy(parent->link_opts, c); c->mf = talloc_reference(c, parent->mf); c->ll = talloc_reference(c, parent->ll); c->shared_target = false; c->s = parent->s; c->language = NULL; c->objects = stringlist_new(c); c->libraries = stringlist_new(c); c->testdeps = stringlist_copy(parent->testdeps, c); c->testdir = talloc_strdup(c, parent->testdir); c->src_dir = talloc_strdup(c, parent->testdir); c->autodeps = parent->autodeps; c->called_path = talloc_strdup(c, called_path); c->full_path = talloc_asprintf(c, "%s/%s/%s", c->bin_dir, parent->called_path, called_path); c->link_path = talloc_strdup(c, ""); c->link_path_install = talloc_strdup(c, ""); talloc_set_destructor(c, &context_test_destructor); return c; }
struct context *context_new_fullsrc(struct context *parent, void *context, const char *full_path) { struct context *c; c = talloc(context, struct context); c->type = CONTEXT_TYPE_SOURCE; c->parent = parent->parent; c->test_parent = NULL; c->bin_dir = talloc_reference(c, parent->bin_dir); c->lib_dir = talloc_reference(c, parent->lib_dir); c->hdr_dir = talloc_reference(c, parent->hdr_dir); c->obj_dir = talloc_reference(c, parent->obj_dir); c->src_dir = talloc_reference(c, parent->src_dir); c->chk_dir = talloc_reference(c, parent->chk_dir); c->tst_dir = talloc_reference(c, parent->tst_dir); c->gen_dir = talloc_reference(c, parent->gen_dir); c->prefix = talloc_reference(c, parent->prefix); c->libexec_dir = talloc_reference(c, parent->libexec_dir); c->compile_opts = stringlist_copy(parent->compile_opts, c); c->link_opts = stringlist_copy(parent->link_opts, c); c->shared_target = parent->shared_target; c->mf = talloc_reference(c, parent->mf); c->ll = talloc_reference(c, parent->ll); c->s = parent->s; c->language = NULL; c->objects = stringlist_new(c); c->libraries = stringlist_new(c); c->testdeps = stringlist_new(c); c->full_path = talloc_strdup(c, full_path); c->link_path = talloc_strdup(c, ""); c->link_path_install = talloc_strdup(c, ""); talloc_set_destructor(c, &context_source_destructor); return c; }
static STRINGLIST *make_excludes(const char *input) { if (!input) { return NULL; } TOKENIZER *t = tokenizer_new(); tokenizer_set_delimiters(t, ":"); tokenizer_enable_escaped_delimiters(t, true); STRINGLIST *excludes = stringlist_copy(tokenizer_create_tokens(t, input)); tokenizer_free_tokens(t); tokenizer_delete(t); return excludes; }