• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ do_load函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: param_main

int
param_main(int argc, char *argv[])
{
	if (argc >= 2) {
		if (!strcmp(argv[1], "save")) {
			if (argc >= 3) {
				do_save(argv[2]);
			} else {
				do_save(param_get_default_file());
			}
		}

		if (!strcmp(argv[1], "load")) {
			if (argc >= 3) {
				do_load(argv[2]);
			} else {
				do_load(param_get_default_file());
			}
		}

		if (!strcmp(argv[1], "import")) {
			if (argc >= 3) {
				do_import(argv[2]);
			} else {
				do_import(param_get_default_file());
			}
		}

		if (!strcmp(argv[1], "select")) {
			if (argc >= 3) {
				param_set_default_file(argv[2]);
			} else {
				param_set_default_file(NULL);
			}
			warnx("selected parameter default file %s", param_get_default_file());
			exit(0);
		}

		if (!strcmp(argv[1], "show"))
			if (argc >= 3) {
				do_show(argv[2]);
			} else {
				do_show(NULL);
			}
	}
	
	errx(1, "expected a command, try 'load', 'import', 'show', 'select' or 'save'");
}
开发者ID:DuinoPilot,项目名称:Firmware,代码行数:48,代码来源:param.c


示例2: event_handler

static void event_handler(switch_event_t *event)
{
	if (globals.auto_reload) {
		do_load();
		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "PocketSphinx Reloaded\n");
	}
}
开发者ID:hsaid,项目名称:FreeSWITCH,代码行数:7,代码来源:mod_pocketsphinx.c


示例3: check_loader_oom_func

static dbus_bool_t
check_loader_oom_func (void *data)
{
  LoaderOomData *d = data;

  return do_load (d->full_path, d->validity, TRUE);
}
开发者ID:Jeanlst,项目名称:Onlive-Source-Backup,代码行数:7,代码来源:config-parser-trivial.c


示例4: assert

void BaseTextureLoader::into(Loadable& resource, const LoaderOptions& options) {
    Loadable* res_ptr = &resource;
    Texture* tex = dynamic_cast<Texture*>(res_ptr);
    assert(tex && "You passed a Resource that is not a texture to the texture loader");

    std::vector<unsigned char> buffer(
        (std::istreambuf_iterator<char>(*this->data_)),
        std::istreambuf_iterator<char>()
    );

    auto result = do_load(buffer);

    /* Respect the auto_upload option if it exists*/
    bool auto_upload = true;
    if(options.count("auto_upload")) {
        auto_upload = smlt::any_cast<bool>(options.at("auto_upload"));
    }

    if (result.data.empty()) {
        L_ERROR(_F("Unable to load texture with name: {0}").format(filename_));
        throw std::runtime_error("Couldn't load the file: " + filename_.encode());
    } else {
        tex->set_source(filename_);
        tex->set_format(result.format, result.texel_type);
        tex->resize(result.width, result.height);
        tex->data().assign(result.data.begin(), result.data.end());
        tex->set_auto_upload(auto_upload);

        if(format_stored_upside_down()) {
            tex->flip_vertically();
        }
    }
}
开发者ID:Kazade,项目名称:KGLT,代码行数:33,代码来源:loader.cpp


示例5: bind

void G1PreBarrierStub::emit_code(LIR_Assembler* ce) {
    // At this point we know that marking is in progress.
    // If do_load() is true then we have to emit the
    // load of the previous value; otherwise it has already
    // been loaded into _pre_val.

    __ bind(_entry);

    assert(pre_val()->is_register(), "Precondition.");
    Register pre_val_reg = pre_val()->as_register();

    if (do_load()) {
        ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/);
    }

    if (__ is_in_wdisp16_range(_continuation)) {
        __ br_null(pre_val_reg, /*annul*/false, Assembler::pt, _continuation);
    } else {
        __ cmp(pre_val_reg, G0);
        __ brx(Assembler::equal, false, Assembler::pn, _continuation);
    }
    __ delayed()->nop();

    __ call(Runtime1::entry_for(Runtime1::Runtime1::g1_pre_barrier_slow_id));
    __ delayed()->mov(pre_val_reg, G4);
    __ br(Assembler::always, false, Assembler::pt, _continuation);
    __ delayed()->nop();

}
开发者ID:AllenWeb,项目名称:jdk7u-hotspot,代码行数:29,代码来源:c1_CodeStubs_sparc.cpp


示例6: QDialog

    select_world::select_world(editor_world_ptr w, QWidget* parent)
      : QDialog(parent)
      , world_(w)
    {
      setWindowTitle("Load the world");
      setWindowIcon(QIcon(":/core/life.png"));
      setFixedSize(200, 150);
      setModal(true);

      QGridLayout* l = new QGridLayout(this);

      // World id
      l->addWidget(new QLabel("Id: ", this), 0, 0);
      world_id_ = new QLineEdit(this);
      world_id_->setText(QString::number(world_->id()));
      l->addWidget(world_id_, 0, 1, 1, 2);

      // Buttons
      QPushButton* btn_cancel = new QPushButton("Cancel", this);
      btn_cancel->setMaximumWidth(80);
      l->addWidget(btn_cancel, 1, 1);
      connect(btn_cancel, SIGNAL(clicked()), SLOT(do_cancel()));

      QPushButton* btn_load = new QPushButton("Load", this);
      btn_load->setMaximumWidth(80);
      l->addWidget(btn_load, 1, 2);
      connect(btn_load, SIGNAL(clicked()), SLOT(do_load()));
    }
开发者ID:nelbok,项目名称:MaskedDuck,代码行数:28,代码来源:select_world.cpp


示例7: main

int main (int argc, char ** argv)
{
    uint64_t *      p0;
    const char *    source_fname;
    size_t          embed_minimum_size;

    if (argc < 2) {
        fputs ("Usage: winloader.exe <program.prg> [args...]\n", stderr);
        return 1;
    }

    source_fname = argv[1];

    embed_minimum_size = init_load (source_fname);
    p0 = VirtualAlloc (NULL, embed_minimum_size + MAX_HEAP_SIZE,
                 MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
    assert (p0 != NULL);
    printf ("p0 = %p\n", p0);

    init_syscall
        ((((uint64_t) p0) + embed_minimum_size),
         (((uint64_t) p0) + embed_minimum_size + MAX_HEAP_SIZE));
    do_load (p0, syscall_shim, source_fname);

    printf ("launch = %p\n\n\n\n", p0);

    go_shim (p0, argc - 1, &argv[1]);
    /* failure...! */
    return 1;
}
开发者ID:jwhitham,项目名称:frotz,代码行数:30,代码来源:winloader.c


示例8: setfont_main

int setfont_main(int argc UNUSED_PARAM, char **argv)
{
	size_t len;
	struct psf_header *psfhdr;
	char *mapfilename;
	int fd;

	opt_complementary = "=1";
	getopt32(argv, "m:", &mapfilename);
	argv += optind;

	// load font
	len = 32*1024; // can't be larger
	psfhdr = (struct psf_header *) xmalloc_open_zipped_read_close(*argv, &len);
	fd = get_console_fd_or_die();
	do_load(fd, psfhdr, len);

	// load the screen map, if any
	if (option_mask32 & 1) { // -m
		void *map = xmalloc_open_zipped_read_close(mapfilename, &len);
		if (len == E_TABSZ || len == 2*E_TABSZ) {
			xioctl(fd, (len == 2*E_TABSZ) ? PIO_UNISCRNMAP : PIO_SCRNMAP, map);
		}
	}

	return EXIT_SUCCESS;
}
开发者ID:WiseMan787,项目名称:ralink_sdk,代码行数:27,代码来源:loadfont.c


示例9: event_handler

static void event_handler(switch_event_t *event)
{
	switch_mutex_lock(MUTEX);
	do_unload();
	do_load();
	switch_mutex_unlock(MUTEX);
	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Number Translations Reloaded\n");
}
开发者ID:PauloFer1,项目名称:FreeSWITCH,代码行数:8,代码来源:mod_translate.c


示例10: default_load_params

/**
 * @param file_path Путь к файлу документа
 * @param params Параметры загрузки документа
 * @param loc Локализация документа
 * @throw SyntaxError Ошибка синтаксиса в документе
 * @throw MacroError Ошибка при обработке макрокоманды
 */
inline
Document::Document( const Path_t &      file_path
                  , const LoadParams &  params /*= default_load_params()*/
                  , const std::locale & loc /*= std::locale()*/
                  )
{
    do_load( file_path , params , loc );
}
开发者ID:Aleksei-Badyaev,项目名称:msdotconf,代码行数:15,代码来源:document.hpp


示例11: main

int main(void)
{
    OCI_Connection *con = NULL;

    if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT))
    {
        return EXIT_FAILURE;
    }

    con = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);

    /* Nominal test */
    do_load(con, FALSE, FALSE, FALSE, FALSE, "TEST BASE         - DEFAULT MODE");

    /* insufficient stream buffer size tests */
    do_load(con, FALSE, FALSE, TRUE, FALSE, "TEST SMALL BUFFER - DEFAULT MODE");
    do_load(con, FALSE, FALSE, TRUE, TRUE, "TEST SMALL BUFFER - FORCE   MODE");

    /* conversion error tests */
    do_load(con, TRUE, FALSE, FALSE, FALSE, "TEST CONV   ERROR - DEFAULT MODE");
    do_load(con, TRUE, FALSE, FALSE, TRUE, "TEST CONV   ERROR - FORCE   MODE");

    /* loading error tests */
    if (partionning_enabled)
    {
        do_load(con, FALSE, TRUE, FALSE, FALSE, "TEST LOAD   ERROR - DEFAULT MODE");
        do_load(con, FALSE, TRUE, FALSE, TRUE, "TEST LOAD   ERROR - FORCE   MODE");
    }

    OCI_ConnectionFree(con);
    OCI_Cleanup();

    return EXIT_SUCCESS;
}
开发者ID:vrogier,项目名称:ocilib,代码行数:34,代码来源:dirpath_complete.c


示例12: event_handler

static void event_handler(switch_event_t *event)
{
	if (globals.auto_reload) {
		switch_mutex_lock(MUTEX);
		do_load();
		switch_mutex_unlock(MUTEX);
		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "ENUM Reloaded\n");
	}
}
开发者ID:prashantchoudhary,项目名称:FreeswitchModified,代码行数:9,代码来源:mod_enum.c


示例13: hitachi_load

static GwyContainer*
hitachi_load(const gchar *filename,
             G_GNUC_UNUSED GwyRunType mode,
             GError **error,
             const gchar *name)
{
    GwyContainer *container = NULL;
    guchar *buffer = NULL;
    gsize size = 0;
    GError *err = NULL;
    GwyDataField *dfield = NULL;
    GwyDataField *(*do_load)(const guchar*, guint, GError**);
    guint header_size;

    if (gwy_strequal(name, "hitachi-afm")) {
        do_load = &read_data_field;
        header_size = HEADER_SIZE;
    }
    else if (gwy_strequal(name, "hitachi-afm-old")) {
        do_load = &read_data_field_old;
        header_size = HEADER_SIZE_OLD;
    }
    else {
        g_set_error(error, GWY_MODULE_FILE_ERROR,
                    GWY_MODULE_FILE_ERROR_UNIMPLEMENTED,
                    _("Hitachi-AFM has not registered file type `%s'."), name);
        return NULL;
    }

    if (!gwy_file_get_contents(filename, &buffer, &size, &err)) {
        err_GET_FILE_CONTENTS(error, &err);
        return NULL;
    }
    if (size < header_size + 2) {
        err_TOO_SHORT(error);
        gwy_file_abandon_contents(buffer, size, NULL);
        return NULL;
    }

    dfield = do_load(buffer, size, error);
    gwy_file_abandon_contents(buffer, size, NULL);
    if (!dfield)
        return NULL;

    container = gwy_container_new();
    gwy_container_set_object_by_name(container, "/0/data", dfield);
    g_object_unref(dfield);
    gwy_container_set_string_by_name(container, "/0/data/title",
                                     g_strdup("Topography"));

    gwy_app_channel_check_nonsquare(container, 0);
    gwy_file_channel_import_log_add(container, 0, NULL, filename);

    return container;
}
开发者ID:DavidMercier,项目名称:gwyddion,代码行数:55,代码来源:hitachi-afm.c


示例14: while

void json_item_substitution::load( JsonObject &jo )
{
    if( !jo.has_array( "substitutions" ) ) {
        jo.throw_error( "No `substitutions` array found." );
    }
    JsonArray outer_arr = jo.get_array( "substitutions" );
    while( outer_arr.has_more() ) {
        JsonObject subobj = outer_arr.next_object();
        do_load( subobj );
    }
}
开发者ID:AreasAside,项目名称:Cataclysm-DDA,代码行数:11,代码来源:profession.cpp


示例15: main

int main(int argc, char * const *argv) {

    int opt = 0;

    //  getopt treats argv interstingly
    while ((opt = getopt(argc, argv, "b:p:")) != -1) {
        switch (opt) {
        case 'b':
            baud = optarg;
            break;
        case 'p':
            port = optarg;
            break;
        default:
            usage();
            break;
        }
    }

    int baudi = atoi(baud);
    int bval = lookup_baud(baudi);
    if (bval <= 0) {
        fprintf(stderr, "Not a recognized baud rate: %s\n", baud);
        exit(EXIT_FAILURE);
    }

    if (optind >= argc) {
        usage();
    }
    command = argv[optind++];
    if (optind < argc) {
        filename = argv[optind++];
    }
    if (optind < argc) {
        usage();
    }

    openport(bval);

    if (!strcmp(command, "dump")) {
        do_dump();
    }
    else if (!strcmp(command, "load")) {
        do_load();
    }
    else {
        fprintf(stderr, "unknown command '%s'\n", command);
        usage();
    }

    return EXIT_SUCCESS;
}
开发者ID:jwatte,项目名称:xbee,代码行数:52,代码来源:xbee.cpp


示例16: read_keypress

static
void read_keypress()
{
	// Get keypress
	int c = fgetc( stdin );

	// Ignore EOF (e.g. when stdin is /dev/null)
	if (c == EOF) return;

	switch(c) {
	
		// Pause/Play
		case 'p': 
			if (get_state() == MADJACK_STATE_PLAYING) {
				do_pause();
			} else {
				do_play();
			}
		break;
		
		// Load
		case 'l': {
			char* filepath = read_filepath();
			do_load( filepath );
			free( filepath );
			break;
		}

		case 'e': do_eject(); break;
		case 's': do_stop(); break;
		case 'q': do_quit(); break;
		case 'c': do_cue(0.0f); break;

		case 'C': {
			float cuepoint = read_cuepoint();
			do_cue( cuepoint );
			break;
		}
		
		default:
			printf( "Unknown command '%c'.\n", (char)c );
		case 'h':
		case '?':
			display_keyhelp();
		break;
		
		// Ignore return and enter
		case 13:
		case 10:
		break;
	}
}
开发者ID:egasimus,项目名称:madjack,代码行数:52,代码来源:control.c


示例17: load_handler

static
int load_handler(const char *path, const char *types, lo_arg **argv, int argc,
		 lo_message msg, void *user_data)
{
	// Double check arguments
	if (argc!=1 || types[0] != LO_STRING) {
		fprintf(stderr, "Error: was expecting single string argument to /deck/load\n");
		return -1;
	}

	// Load the requested track
	do_load( &argv[0]->s );
    return 0;
}
开发者ID:egasimus,项目名称:madjack,代码行数:14,代码来源:mjosc.c


示例18: do_load

/* use_egg:
 *  Reads an EGG script from a block of memory.
 */
EGG *use_egg(void *data, int length, char *error)
{
   EGG *egg;

   egg_data = data;
   egg_data_length = length;

   egg = do_load(error);

   egg_data = NULL;
   egg_data_length = 0;

   return egg;
}
开发者ID:ReneNyffenegger,项目名称:EGG-Explosion-Graphics-Generator,代码行数:17,代码来源:load.c


示例19: param_main

int
param_main(int argc, char *argv[])
{
	if (argc >= 2) {
		if (!strcmp(argv[1], "save")) {
			if (argc >= 3) {
				do_save(argv[2]);
			} else {
				do_save(param_file_name_default);
			}
		}

		if (!strcmp(argv[1], "load")) {
			if (argc >= 3) {
				do_load(argv[2]);
			} else {
				do_load(param_file_name_default);
			}
		}

		if (!strcmp(argv[1], "import")) {
			if (argc >= 3) {
				do_import(argv[2]);
			} else {
				do_import(param_file_name_default);
			}
		}

		if (!strcmp(argv[1], "show")) {
			do_show();
		}
			
	}

	errx(1, "expected a command, try 'load', 'import', 'show' or 'save'\n");
}
开发者ID:tnaegeli,项目名称:Firmware_Ardrone,代码行数:36,代码来源:param.c


示例20: param_main

int
param_main(int argc, char *argv[])
{
	if (argc >= 2) {
		if (!strcmp(argv[1], "save"))
			do_save();
		if (!strcmp(argv[1], "load"))
			do_load();
		if (!strcmp(argv[1], "import"))
			do_import();
		if (!strcmp(argv[1], "show"))
			do_show();
	}

	errx(1, "expected a command, try 'load', 'import', 'show' or 'save'\n");
}
开发者ID:jemoster,项目名称:Firmware,代码行数:16,代码来源:param.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ do_map_probe函数代码示例发布时间:2022-05-30
下一篇:
C++ do_item_unlink函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap