本文整理汇总了C++中set_list函数的典型用法代码示例。如果您正苦于以下问题:C++ set_list函数的具体用法?C++ set_list怎么用?C++ set_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_list函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: add_file_watch_native_patch
FileWatch* add_file_watch_native_patch(World* world, const char* filename, const char* moduleName)
{
circa::Value action;
set_list(&action, 2);
set_int(list_get(&action, 0), name_NativePatch);
set_string(list_get(&action, 1), moduleName);
return add_file_watch_action(world, filename, &action);
}
开发者ID:RickMoynihan,项目名称:circa,代码行数:8,代码来源:file_watch.cpp
示例17: add_file_watch_module_load
FileWatch* add_file_watch_module_load(World* world, const char* filename, const char* moduleName)
{
circa::Value action;
set_list(&action, 2);
set_symbol(list_get(&action, 0), sym_PatchBlock);
set_string(list_get(&action, 1), moduleName);
return add_file_watch_action(world, filename, &action);
}
开发者ID:arn-e,项目名称:circa,代码行数:8,代码来源:file_watch.cpp
示例18: Branch__get_static_errors
void Branch__get_static_errors(caStack* stack)
{
Branch* branch = as_branch(circa_input(stack, 0));
if (is_null(&branch->staticErrors))
set_list(circa_output(stack, 0), 0);
else
copy(&branch->staticErrors, circa_output(stack, 0));
}
开发者ID:julianhaslinger,项目名称:circa,代码行数:9,代码来源:metaprogramming.cpp
示例19: mark
/**
* Adds the actor to the Repsheet
*
* @param context the Redis connection
* @param actor the actors user data or ip address
* @param type IP or USER
* @reason string to describe the reason for marking
*
* @returns an integer result
*/
int mark(redisContext *context, const char *actor, int type, const char *reason)
{
redisReply *reply;
switch(type) {
case IP:
return set_list(context, actor, "ip", "marked", reason);
break;
case USER:
return set_list(context, actor, "user", "marked", reason);
break;
case BLOCK:
return set_block(context, actor, "marked", reason);
default:
return UNSUPPORTED;
break;
}
}
开发者ID:jeff-ayars,项目名称:librepsheet,代码行数:28,代码来源:marked.c
示例20: test_write_fake_file
void test_write_fake_file(const char* filename, int version, const char* contents)
{
Value key;
set_string(&key, filename);
Value* entry = hashtable_insert(gFakeFileMap, &key);
set_list(entry, 2);
set_int(list_get(entry, 0), version);
set_string(list_get(entry, 1), contents);
}
开发者ID:andyfischer,项目名称:circa,代码行数:9,代码来源:main.cpp
注:本文中的set_list函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论