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

C++ command_add函数代码示例

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

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



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

示例1: fn_format_msdos_floppy

void
fn_format_msdos_floppy(struct i_fn_args *a)
{
	struct commands *cmds;

	switch (dfui_be_present_dialog(a->c, _("Format MSDOS Floppy"),
	    _("Format Floppy|Return to Utilities Menu"),
	    _("Please insert the floppy to be formatted "
	    "in unit 0 (``drive A:'')."))) {
	case 1:
		cmds = commands_new();
		command_add(cmds, "%s%s -y -f 1440 /dev/fd0",
		    a->os_root, cmd_name(a, "FDFORMAT"));
		command_add(cmds, "%s%s -f 1440 fd0",
		    a->os_root, cmd_name(a, "NEWFS_MSDOS"));
		if (commands_execute(a, cmds))
			inform(a->c, _("Floppy successfully formatted!"));
		else
			inform(a->c, _("Floppy was not successfully formatted."));
		break;
	case 2:
		return;
	default:
		abort_backend();
	}
}
开发者ID:mihaicarabas,项目名称:dragonfly,代码行数:26,代码来源:fn_disk.c


示例2: command_add

void vehicles::create() {
    command_add("vehicle_paintjob", std::tr1::bind(&vehicles::cmd_vehicle_paintjob, this, std::tr1::placeholders::_1, std::tr1::placeholders::_2, std::tr1::placeholders::_3, std::tr1::placeholders::_4, std::tr1::placeholders::_5), cmd_game, std::tr1::bind(&vehicles::cmd_vehicle_paintjob_access_checker, this, std::tr1::placeholders::_1, std::tr1::placeholders::_2));
    command_add("vehicle_color", std::tr1::bind(&vehicles::cmd_vehicle_color, this, std::tr1::placeholders::_1, std::tr1::placeholders::_2, std::tr1::placeholders::_3, std::tr1::placeholders::_4, std::tr1::placeholders::_5), cmd_game, std::tr1::bind(&vehicles::cmd_vehicle_color_access_checker, this, std::tr1::placeholders::_1, std::tr1::placeholders::_2));
    command_add("vehicle_modification", std::tr1::bind(&vehicles::cmd_vehicle_modification, this, std::tr1::placeholders::_1, std::tr1::placeholders::_2, std::tr1::placeholders::_3, std::tr1::placeholders::_4, std::tr1::placeholders::_5), cmd_game, std::tr1::bind(&vehicles::cmd_vehicle_modification_access_checker, this, std::tr1::placeholders::_1, std::tr1::placeholders::_2));

    command_add("vehicle_color_list", bind(&vehicles::cmd_vehicle_color_list, this, std::tr1::placeholders::_1, std::tr1::placeholders::_2, std::tr1::placeholders::_3, std::tr1::placeholders::_4, std::tr1::placeholders::_5), cmd_info_only, std::tr1::bind(&vehicles::cmd_vehicle_color_access_checker, this, std::tr1::placeholders::_1, std::tr1::placeholders::_2));
    command_add("vehicle_modification_list", bind(&vehicles::cmd_vehicle_modification_list, this, std::tr1::placeholders::_1, std::tr1::placeholders::_2, std::tr1::placeholders::_3, std::tr1::placeholders::_4, std::tr1::placeholders::_5), cmd_info_only, std::tr1::bind(&vehicles::cmd_vehicle_modification_access_checker, this, std::tr1::placeholders::_1, std::tr1::placeholders::_2));
}
开发者ID:streloksps,项目名称:gta-paradise-sa,代码行数:8,代码来源:vehicles.cpp


示例3: _modinit

void _modinit(module_t *m)
{
	MODULE_USE_SYMBOL(os_cmdtree, "operserv/main", "os_cmdtree");
	MODULE_USE_SYMBOL(os_helptree, "operserv/main", "os_helptree");

        command_add(&os_identify, os_cmdtree);
        command_add(&os_id, os_cmdtree);
	help_addentry(os_helptree, "IDENTIFY", "help/oservice/identify", NULL);
}
开发者ID:danopia,项目名称:atheme,代码行数:9,代码来源:identify.c


示例4: _modinit

void _modinit(module_t *m)
{
	MODULE_USE_SYMBOL(ns_cmdtree, "nickserv/main", "ns_cmdtree");
	MODULE_USE_SYMBOL(ns_helptree, "nickserv/main", "ns_helptree");

	command_add(&ns_acc, ns_cmdtree);
	command_add(&ns_status, ns_cmdtree);
	help_addentry(ns_helptree, "STATUS", "help/nickserv/status", NULL);
}
开发者ID:BackupTheBerlios,项目名称:phoenixfn-svn,代码行数:9,代码来源:status.c


示例5: _modinit

void _modinit(module_t *m)
{
	MODULE_USE_SYMBOL(ns_cmdtree, "nickserv/main", "ns_cmdtree");
	MODULE_USE_SYMBOL(ns_helptree, "nickserv/main", "ns_helptree");

	command_add(&ns_drop, ns_cmdtree);
	command_add(&ns_fdrop, ns_cmdtree);
	help_addentry(ns_helptree, "DROP", "help/nickserv/drop", NULL);
	help_addentry(ns_helptree, "FDROP", "help/nickserv/fdrop", NULL);
}
开发者ID:danopia,项目名称:atheme,代码行数:10,代码来源:drop.c


示例6: _modinit

void _modinit(module_t *m)
{
	MODULE_USE_SYMBOL(hs_cmdtree, "hostserv/main", "hs_cmdtree");
	MODULE_USE_SYMBOL(hs_helptree, "hostserv/main", "hs_helptree");

	command_add(&hs_on, hs_cmdtree);
	command_add(&hs_off, hs_cmdtree);
	help_addentry(hs_helptree, "ON", "help/hostserv/on", NULL);
	help_addentry(hs_helptree, "OFF", "help/hostserv/off", NULL);
}
开发者ID:danopia,项目名称:atheme,代码行数:10,代码来源:onoff.c


示例7: _commands

static void	_commands(t_module * module)
{
  command_add(module->functions, "graphic", graph_graphic);
  command_add(module->functions, "msz", graph_msz);
  command_add(module->functions, "bct", graph_bct);
  command_add(module->functions, "mct", graph_mct);
  command_add(module->functions, "tna", graph_tna);
  command_add(module->functions, "ppo", graph_ppo);
  command_add(module->functions, "plv", graph_plv);
  command_add(module->functions, "pin", graph_pin);
  command_add(module->functions, "sgt", graph_sgt);
  command_add(module->functions, "sst", graph_sst);
}
开发者ID:Nwazette,项目名称:Zappy,代码行数:13,代码来源:init.c


示例8: _modinit

void _modinit(module_t *m)
{
	MODULE_USE_SYMBOL(cs_cmdtree, "chanserv/main", "cs_cmdtree");
	MODULE_USE_SYMBOL(cs_fcmdtree, "chanserv/main", "cs_fcmdtree");
	MODULE_USE_SYMBOL(cs_helptree, "chanserv/main", "cs_helptree");

        command_add(&cs_topic, cs_cmdtree);
        command_add(&cs_topicappend, cs_cmdtree);
	fcommand_add(&fc_topic, cs_fcmdtree);
	fcommand_add(&fc_topicappend, cs_fcmdtree);

	help_addentry(cs_helptree, "TOPIC", "help/cservice/topic", NULL);
	help_addentry(cs_helptree, "TOPICAPPEND", "help/cservice/topicappend", NULL);
}
开发者ID:BackupTheBerlios,项目名称:phoenixfn-svn,代码行数:14,代码来源:topic.c


示例9: _modinit

void _modinit(module_t *m)
{
	MODULE_USE_SYMBOL(cs_cmdtree, "chanserv/main", "cs_cmdtree");
	MODULE_USE_SYMBOL(cs_fcmdtree, "chanserv/main", "cs_fcmdtree");
	MODULE_USE_SYMBOL(cs_helptree, "chanserv/main", "cs_helptree");

        command_add(&cs_halfop, cs_cmdtree);
        command_add(&cs_dehalfop, cs_cmdtree);
	fcommand_add(&fc_halfop, cs_fcmdtree);
	fcommand_add(&fc_hop, cs_fcmdtree);
	fcommand_add(&fc_dehalfop, cs_fcmdtree);
	fcommand_add(&fc_dehop, cs_fcmdtree);

	help_addentry(cs_helptree, "HALFOP", "help/cservice/op_voice", NULL);
	help_addentry(cs_helptree, "DEHALFOP", "help/cservice/op_voice", NULL);
}
开发者ID:BackupTheBerlios,项目名称:phoenixfn-svn,代码行数:16,代码来源:halfop.c


示例10: unmount_all_under

/*
 * Unmount all mountpoints under a given mountpoint in order (e.g. /var/tmp is
 * unmounted before /var).
 */
void
unmount_all_under(struct i_fn_args *a, struct commands *cmds, const char *fmt, ...)
{
	struct statfs *mt_array;
	int count, i;
	char *mtpt;
	va_list args;

	va_start(args, fmt);
	vasprintf(&mtpt, fmt, args);
	va_end(args);

	count = getmntinfo(&mt_array, MNT_WAIT);

	/* Order mount points in reverse lexicographically order. */
	qsort((void*)mt_array, count, sizeof(struct statfs), compare);

	for (i = 0; i < count; i++) {
		if (strncmp(mtpt, mt_array[i].f_mntonname, strlen(mtpt)) != 0)
			continue;
		if (strlen(mtpt) > strlen(mt_array[i].f_mntonname))
			continue;

		command_add(cmds, "%s%s %s",
		    a->os_root, cmd_name(a, "UMOUNT"), mt_array[i].f_mntonname);
	}

	free(mtpt);
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:33,代码来源:mount.c


示例11: _modinit

void _modinit(module_t *m)
{
	MODULE_TRY_REQUEST_DEPENDENCY(m, "nickserv/enforce");
	MODULE_TRY_REQUEST_SYMBOL(m, ns_set_cmdtree, "nickserv/set_core", "ns_set_cmdtree");

	command_add(&ns_set_enforcetime, *ns_set_cmdtree);
}
开发者ID:Gryllida,项目名称:atheme,代码行数:7,代码来源:set_enforcetime.c


示例12: _modinit

void _modinit(module_t *m)
{
	use_groupserv_main_symbols(m);
	use_groupserv_set_symbols(m);

	command_add(&gs_set_channel, gs_set_cmdtree);
}
开发者ID:Acidburn0zzz,项目名称:atheme,代码行数:7,代码来源:set_channel.c


示例13: init_commands

static void		init_commands(t_mod_func *func)
{
  command_relative(func, "avance", zappy_avance, 7);
  command_relative(func, "droite", zappy_droite, 7);
  command_relative(func, "gauche", zappy_gauche, 7);
  command_relative(func, "voir", zappy_voir, 7);
  command_relative(func, "inventaire", zappy_inventaire, 1);
  command_relative(func, "prend", zappy_prend, 7);
  command_relative(func, "pose", zappy_pose, 7);
  command_relative(func, "expulse", zappy_expulse, 7);
  command_relative(func, "broadcast", zappy_broadcast, 7);
  command_relative(func, "fork", zappy_fork, 42);
  command_add(func, "incantation", zappy_incantation);
  command_add(func, "connect_nbr", zappy_connect_nbr);
  event_catch("EggHatch", egg_eclosion);
}
开发者ID:Nwazette,项目名称:Zappy,代码行数:16,代码来源:get_module.c


示例14: decode_command

static int
decode_command (int argc, char *argv[], ProgEnv *env)
{
    int opt_idx;

    for (opt_idx = 0; opt_idx < argc; opt_idx++) {
        if (strcmp (argv[opt_idx], "add") == 0) {
            ++opt_idx;
            opt_idx += command_add (argc - opt_idx, argv + opt_idx, env);
        } else if (strcmp (argv[opt_idx], "add-list") == 0) {
            ++opt_idx;
            opt_idx += command_add_list (argc - opt_idx, argv + opt_idx, env);
        } else if (strcmp (argv[opt_idx], "delete") == 0) {
            ++opt_idx;
            opt_idx += command_delete (argc - opt_idx, argv + opt_idx, env);
        } else if (strcmp (argv[opt_idx], "delete-list") == 0) {
            ++opt_idx;
            opt_idx += command_delete_list (argc - opt_idx, argv + opt_idx, env);
        } else if (strcmp (argv[opt_idx], "query") == 0) {
            ++opt_idx;
            opt_idx += command_query (argc - opt_idx, argv + opt_idx, env);
        } else if (strcmp (argv[opt_idx], "list") == 0) {
            ++opt_idx;
            opt_idx += command_list (argc - opt_idx, argv + opt_idx, env);
        } else {
            fprintf (stderr, "Unknown command: %s\n", argv[opt_idx]);
            return EXIT_FAILURE;
        }
    }

    return EXIT_SUCCESS;
}
开发者ID:svn2github,项目名称:datrie,代码行数:32,代码来源:trietool.c


示例15: add_help_file

/** Add new help command. This function is
 * the basis for the help_command directive in mush.cnf. It creates
 * a new help entry for the hash table, builds a help index,
 * and adds the new command to the command table.
 * \param command_name name of help command to add.
 * \param filename name of the help file to use for this command.
 * \param admin if 1, this command reads admin topics, rather than standard.
 */
void
add_help_file(const char *command_name, const char *filename, int admin)
{
  help_file *h;

  if (help_init == 0)
    init_help_files();

  if (!command_name || !filename || !*command_name || !*filename)
    return;

  /* If there's already an entry for it, complain */
  h = hashfind(strupper(command_name), &help_files);
  if (h) {
    do_rawlog(LT_ERR, "Duplicate help_command %s ignored.", command_name);
    return;
  }

  h = mush_malloc(sizeof *h, "help_file.entry");
  h->command = mush_strdup(strupper(command_name), "help_file.command");
  h->file = mush_strdup(filename, "help_file.filename");
  h->entries = 0;
  h->indx = NULL;
  h->admin = admin;
  help_build_index(h, h->admin);
  if (!h->indx) {
    mush_free(h->command, "help_file.command");
    mush_free(h->file, "help_file.filename");
    mush_free(h, "help_file.entry");
    return;
  }
  (void) command_add(h->command, CMD_T_ANY | CMD_T_NOPARSE, NULL, 0, NULL,
                     cmd_helpcmd);
  hashadd(h->command, h, &help_files);
}
开发者ID:kymoon,项目名称:pennmush,代码行数:43,代码来源:help.c


示例16: _modinit

void _modinit(module_t *m)
{
	MODULE_USE_SYMBOL(cs_cmdtree, "chanserv/main", "cs_cmdtree");
	MODULE_USE_SYMBOL(cs_helptree, "chanserv/main", "cs_helptree");

        command_add(&cs_fflags, cs_cmdtree);
	help_addentry(cs_helptree, "FFLAGS", "help/cservice/fflags", NULL);
}
开发者ID:danopia,项目名称:atheme,代码行数:8,代码来源:fflags.c


示例17: _modinit

void _modinit(module_t *m)
{
	MODULE_USE_SYMBOL(os_cmdtree, "operserv/main", "os_cmdtree");
	MODULE_USE_SYMBOL(os_helptree, "operserv/main", "os_helptree");

        command_add(&os_restart, os_cmdtree);
	help_addentry(os_helptree, "RESTART", "help/oservice/restart", NULL);
}
开发者ID:BackupTheBerlios,项目名称:phoenixfn-svn,代码行数:8,代码来源:restart.c


示例18: _modinit

void _modinit(module_t *m)
{
	MODULE_TRY_REQUEST_SYMBOL(m, cs_set_cmdtree, "chanserv/set_core", "cs_set_cmdtree");

	command_add(&cs_set_private, *cs_set_cmdtree);

	use_channel_private++;
}
开发者ID:XthemeOrg,项目名称:Xtheme,代码行数:8,代码来源:set_private.c


示例19: _modinit

void _modinit(module_t *m)
{
	MODULE_USE_SYMBOL(cs_cmdtree, "chanserv/main", "cs_cmdtree");
	MODULE_USE_SYMBOL(cs_helptree, "chanserv/main", "cs_helptree");

        command_add(&cs_drop, cs_cmdtree);
	help_addentry(cs_helptree, "DROP", "help/cservice/drop", NULL);
}
开发者ID:BackupTheBerlios,项目名称:phoenixfn-svn,代码行数:8,代码来源:drop.c


示例20: _modinit

void _modinit(module_t *m)
{
	MODULE_USE_SYMBOL(gs_cmdtree, "gameserv/main", "gs_cmdtree");
	MODULE_USE_SYMBOL(gs_helptree, "gameserv/main", "gs_helptree");

	command_add(&gs_help, gs_cmdtree);
	help_addentry(gs_helptree, "HELP", "help/help", NULL);
}
开发者ID:danopia,项目名称:atheme,代码行数:8,代码来源:help.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ command_bind函数代码示例发布时间:2022-05-30
下一篇:
C++ command函数代码示例发布时间: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