当前位置: 首页>>代码示例>>C++>>正文


C++ set_list函数代码示例

本文整理汇总了C++中set_list函数的典型用法代码示例。如果您正苦于以下问题:C++ set_list函数的具体用法?C++ set_list怎么用?C++ set_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了set_list函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: world_initialize

void world_initialize(World* world)
{
    initialize_null(&world->modulesByName);
    initialize_null(&world->modulesByFilename);
    initialize_null(&world->everyModule);
    initialize_null(&world->fileSources);
    initialize_null(&world->moduleSearchPaths);

    set_hashtable(&world->modulesByName);
    set_hashtable(&world->modulesByFilename);
    set_list(&world->everyModule);
    set_list(&world->moduleSearchPaths);
    set_list(&world->fileSources);

    world->moduleSearchPaths.append_str("$builtins");

    world->fileWatchWorld = alloc_file_watch_world();
    world->builtinPatch = circa_create_native_patch(world, "builtins");

    #if CIRCA_ENABLE_LIBUV
        world->libuvWorld = alloc_libuv_world();
    #endif

    perlin_init();
}
开发者ID:andyfischer,项目名称:circa,代码行数:25,代码来源:world.cpp

示例2: List__slice

void List__slice(caStack* stack)
{
    caValue* input = circa_input(stack, 0);
    int start = circa_int_input(stack, 1);
    int end = circa_int_input(stack, 2);
    caValue* output = circa_output(stack, 0);

    if (start < 0)
        start = 0;
    else if (start > list_length(input))
        start = list_length(input);

    if (end > list_length(input))
        end = list_length(input);
    else if (end < 0)
        end = list_length(input) + end;

    if (end < start) {
        set_list(output, 0);
        return;
    }

    int length = end - start;
    set_list(output, length);

    for (int i=0; i < length; i++)
        copy(list_get(input, start + i), list_get(output, i));
}
开发者ID:whunmr,项目名称:circa,代码行数:28,代码来源:kernel.cpp

示例3: create_compound_type

Type* create_compound_type()
{
    Type* type = create_type();

    list_t::setup_type(type);
    caValue* param = &type->parameter;
    set_list(param, 2);
    set_list(list_get(param, 0), 0);
    set_list(list_get(param, 1), 0);
    return type;
}
开发者ID:RickMoynihan,项目名称:circa,代码行数:11,代码来源:list.cpp

示例4: perf_stats_to_list

void perf_stats_to_list(caValue* list)
{
    set_list(list, c_numPerfStats);
    for (int i = c_firstStatIndex; i < name_LastStatIndex-1; i++) {
        Name name = i;
        int64 value = PERF_STATS[i - c_firstStatIndex];
        caValue* element = list_get(list, i - c_firstStatIndex);
        set_list(element, 2);
        set_string(list_get(element, 0), builtin_name_to_string(name));
        char buf[100];
        sprintf(buf, "%llu", value);
        set_string(list_get(element, 1), buf);
    }
}
开发者ID:RickMoynihan,项目名称:circa,代码行数:14,代码来源:debug.cpp

示例5: Branch__get_static_errors_formatted

void Branch__get_static_errors_formatted(caStack* stack)
{
    Branch* branch = as_branch(circa_input(stack, 0));
    if (branch == NULL)
        return circa_output_error(stack, "NULL branch");

    if (is_null(&branch->staticErrors))
        set_list(circa_output(stack, 0), 0);

    caValue* errors = &branch->staticErrors;
    caValue* out = circa_output(stack, 0);
    set_list(out, circa_count(errors));
    for (int i=0; i < circa_count(out); i++)
        format_static_error(circa_index(errors, i), circa_index(out, i));
}
开发者ID:julianhaslinger,项目名称:circa,代码行数:15,代码来源:metaprogramming.cpp

示例6: arch

/*
 * The parser. This implements the grammar:
 *    setfile::= (arch())+ <EOF>
 *             | <EOF>
 *    arch::= <ARCHITECTURE> "{" (set_list())* "}"
 *    set_list::= (set())+ ";"
 *    set::= <IDENTIFIER> ["[" "WEAK" "]"] ":" "{" (ancestors) "}" ";"
 *    ancestors::= <IDENTIFIER> | <ancestors> "," <IDENTIFIER>
 *    where <ARCHITECTURE> and <IDENTIFIER> are tokens.
 */
static int
arch(void)
{
	int olderrors;

	errlog(BEGIN, "arch() {");
	if (comment()) {
		errlog(END, "} /* arch */");
		return (TRUE);
	}
	if (arch_name() == FALSE) {
		errlog(END, "} /* arch */");
		return (FALSE);
	}
	if (accept_token("{") == FALSE) {
		errlog(END, "} /* arch */");
		return (FALSE);
	}

	olderrors = Errors;
	if (set_list() == FALSE) {
		if (olderrors != Errors) {
			errlog(END, "} /* arch */");
			return (FALSE);
		}
	}

	errlog(END, "} /* arch */");
	return (TRUE);
}
开发者ID:0xffea,项目名称:illumos-gate,代码行数:40,代码来源:versions.c

示例7: get_relative_name_as_list

void get_relative_name_as_list(Term* term, Block* relativeTo, Value* nameOutput)
{
    set_list(nameOutput, 0);

    // Walk upwards and build the name, stop when we reach relativeTo.
    // The output list will be reversed but we'll fix that.

    while (true) {
        set_value(list_append(nameOutput), unique_name(term));

        if (term->owningBlock == relativeTo) {
            break;
        }

        term = parent_term(term);

        // If term is null, then it wasn't really a child of relativeTo
        if (term == NULL) {
            set_null(nameOutput);
            return;
        }
    }

    // Fix output list
    list_reverse(nameOutput);
}
开发者ID:ShenTensen,项目名称:circa,代码行数:26,代码来源:names.cpp

示例8: config_address

void config_address(void)
{
  struct Buffer err;
  mutt_buffer_init(&err);
  err.dsize = 256;
  err.data = mutt_mem_calloc(1, err.dsize);
  mutt_buffer_reset(&err);

  struct ConfigSet *cs = cs_new(30);

  address_init(cs);
  dont_fail = true;
  if (!cs_register_variables(cs, Vars, 0))
    return;
  dont_fail = false;

  cs_add_listener(cs, log_listener);

  set_list(cs);

  TEST_CHECK(test_initial_values(cs, &err));
  TEST_CHECK(test_string_set(cs, &err));
  TEST_CHECK(test_string_get(cs, &err));
  TEST_CHECK(test_native_set(cs, &err));
  TEST_CHECK(test_native_get(cs, &err));
  TEST_CHECK(test_reset(cs, &err));
  TEST_CHECK(test_validator(cs, &err));
  TEST_CHECK(test_inherit(cs, &err));

  cs_free(&cs);
  FREE(&err.data);
}
开发者ID:darnir,项目名称:neomutt,代码行数:32,代码来源:address.c

示例9: set_list

List*
List::lazyCast(caValue* v)
{
    if (!is_list(v))
        set_list(v, 0);
    return (List*) v;
}
开发者ID:RickMoynihan,项目名称:circa,代码行数:7,代码来源:list.cpp

示例10: update_patch_function_lookup_for_module

static void update_patch_function_lookup_for_module(NativePatch* module)
{
    World* world = module->world;
    caValue* everyPatchedFunction = &world->nativePatchWorld->everyPatchedFunction;

    caValue* targetName = &module->targetName;

    // Look at every function that this module patches.
    std::map<std::string, EvaluateFunc>::const_iterator it;

    for (it = module->patches.begin(); it != module->patches.end(); it++) {

        Value functionName;
        set_string(&functionName, it->first.c_str());

        // Construct a global name for this function, using the block's global name.

        Value globalName;
        copy(targetName, &globalName);
        string_append_qualified_name(&globalName, &functionName);

        // Save this line.
        caValue* entry = hashtable_insert(everyPatchedFunction, &globalName);
        set_list(entry, 2);
        copy(&module->targetName, list_get(entry, 0));
        copy(&functionName, list_get(entry, 1));
    }
}
开发者ID:RickMoynihan,项目名称:circa,代码行数:28,代码来源:native_patch.cpp

示例11: symbol_initialize_global_table

void symbol_initialize_global_table()
{
    g_runtimeSymbolMap = new Value();
    set_hashtable(g_runtimeSymbolMap);
    g_runtimeSymbolTable = new Value();
    set_list(g_runtimeSymbolTable, 0);
}
开发者ID:arn-e,项目名称:circa,代码行数:7,代码来源:symbols.cpp

示例12: set_list

void CommandList::clean_history_callback()
{
	QStringList list;
	//model->setStringList(list);
	project_history.clear();
	set_list(list);
}
开发者ID:OpticaMonografia,项目名称:QtOctave,代码行数:7,代码来源:command_list.cpp

示例13: Block__get_static_errors_formatted

void Block__get_static_errors_formatted(VM* vm)
{
    Block* block = as_block(vm->input(0));
    if (block == NULL)
        return vm->throw_str("NULL block");

    Value* errors = block_get_static_errors(block);
    if (errors == NULL) {
        set_list(vm->output(), 0);
        return;
    }

    Value* out = vm->output();
    set_list(out, circa_count(errors));
    for (int i=0; i < circa_count(out); i++)
        format_static_error(circa_index(errors, i), circa_index(out, i));
}
开发者ID:ShenTensen,项目名称:circa,代码行数:17,代码来源:reflection.cpp

示例14: _parameter

Control::Control(const Parameter&               parameter,
                 const ParameterDescriptor&     desc,
                 boost::shared_ptr<ControlList> list)
	: _parameter(parameter)
	, _user_value(list ? list->default_value() : desc.normal)
{
	set_list (list);
}
开发者ID:gesius,项目名称:AudioComplete,代码行数:8,代码来源:Control.cpp

示例15: overload__get_contents

void overload__get_contents(caStack* stack)
{
    Branch* self = (Branch*) circa_branch(circa_input(stack, 0));
    caValue* out = circa_output(stack, 0);
    set_list(out, 0);

    list_overload_contents(self, out);
}
开发者ID:julianhaslinger,项目名称:circa,代码行数:8,代码来源:metaprogramming.cpp


注:本文中的set_list函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。