Ejemplo n.º 1
0
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();
	}
}
Ejemplo n.º 2
0
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));
}
Ejemplo n.º 3
0
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);
}
Ejemplo n.º 4
0
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);
}
Ejemplo n.º 5
0
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);
}
Ejemplo n.º 6
0
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);
}
Ejemplo n.º 7
0
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);
}
Ejemplo n.º 8
0
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);
}
Ejemplo n.º 9
0
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);
}
Ejemplo n.º 10
0
/*
 * 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);
}
Ejemplo n.º 11
0
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);
}
Ejemplo n.º 12
0
void _modinit(module_t *m)
{
	MODULE_TRY_REQUEST_SYMBOL(m, ns_set_cmdtree, "nickserv/set_core", "ns_set_cmdtree");

	command_add(&ns_set_hidelastlogin, *ns_set_cmdtree);

}
Ejemplo n.º 13
0
void _modinit(module_t *m)
{
	use_groupserv_main_symbols(m);
	use_groupserv_set_symbols(m);

	command_add(&gs_set_channel, gs_set_cmdtree);
}
Ejemplo n.º 14
0
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);
}
Ejemplo n.º 15
0
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;
}
Ejemplo n.º 16
0
/** 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);
}
Ejemplo n.º 17
0
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);
}
Ejemplo n.º 18
0
/*
 * state_create_subpartitions: let the user specify what subpartitions they
 * want on the disk, how large each should be, and where it should be mounted.
 */
void
state_create_subpartitions(struct i_fn_args *a)
{
	struct commands *cmds;

	if (measure_activated_swap_from_slice(a, storage_get_selected_disk(a->s),
	    storage_get_selected_slice(a->s)) > 0) {
		if (swapoff_all(a) == NULL) {
			inform(a->c, _("Warning: swap could not be turned off."));
			state = disk_get_formatted(storage_get_selected_disk(a->s)) ?
			    state_select_disk : state_select_slice;
			return;
		}
	}

	cmds = commands_new();

	/*
	 * Auto-disklabel the slice.
	 * NB: one cannot use "/dev/adXsY" here -
	 * it must be in the form "adXsY".
	 */
	command_add(cmds, "%s%s -W %s",
	    a->os_root, cmd_name(a, "DISKLABEL64"),
	    slice_get_device_name(storage_get_selected_slice(a->s)));
	command_add(cmds, "%s%s if=/dev/zero of=/dev/%s bs=32k count=16",
	    a->os_root, cmd_name(a, "DD"),
	    slice_get_device_name(storage_get_selected_slice(a->s)));
	command_add(cmds, "%s%s -B -r -w %s auto",
	    a->os_root, cmd_name(a, "DISKLABEL64"),
	    slice_get_device_name(storage_get_selected_slice(a->s)));
	commands_execute(a, cmds);
	commands_free(cmds);

	if (use_hammer)
		fn_create_subpartitions_hammer(a);
	else
		fn_create_subpartitions_ufs(a);

	if (a->result) {
		state = state_install_os;
	} else {
		state = disk_get_formatted(storage_get_selected_disk(a->s)) ?
		    state_select_disk : state_select_slice;
	}
}
Ejemplo n.º 19
0
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);
}
Ejemplo n.º 20
0
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++;
}
Ejemplo n.º 21
0
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);
}
Ejemplo n.º 22
0
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);
}
Ejemplo n.º 23
0
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_clear, cs_cmdtree);
	help_addentry(cs_helptree, "CLEAR", NULL, cs_help_clear);
}
Ejemplo n.º 24
0
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_ping, cs_cmdtree);
	help_addentry(cs_helptree, "PING", "help/contrib/cs_ping", NULL);
}
Ejemplo n.º 25
0
void _modinit(module_t *m)
{
	MODULE_USE_SYMBOL(cs_cmdtree, "chanserv/main", "cs_cmdtree");
	MODULE_USE_SYMBOL(cs_fcmdtree, "chanserv/main", "cs_fcmdtree");

        command_add(&cs_ping, cs_cmdtree);
	fcommand_add(&fc_ping, cs_fcmdtree);
}
Ejemplo n.º 26
0
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_modinspect, os_cmdtree);
	help_addentry(os_helptree, "MODINSPECT", "help/oservice/modinspect", NULL);
}
Ejemplo n.º 27
0
static void mod_init(module_t *m)
{
	MODULE_USE_SYMBOL(ns_cmdtree, "nickserv/main", "ns_cmdtree");
	MODULE_USE_SYMBOL(ns_helptree, "nickserv/main", "ns_helptree");

	command_add(&ns_regain, ns_cmdtree);
	help_addentry(ns_helptree, "REGAIN", "help/nickserv/regain", NULL);
}
Ejemplo n.º 28
0
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_update, os_cmdtree);
	help_addentry(os_helptree, "UPDATE", "help/oservice/update", NULL);
}
Ejemplo n.º 29
0
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_freeze, ns_cmdtree);
	help_addentry(ns_helptree, "FREEZE", "help/nickserv/freeze", NULL);
}
Ejemplo n.º 30
0
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_help, os_cmdtree);
	help_addentry(os_helptree, "HELP", "help/help", NULL);
}