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


C++ options_set_number函数代码示例

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


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

示例1: cmd_rename_window_exec

enum cmd_retval
cmd_rename_window_exec(struct cmd *self, struct cmd_q *cmdq)
{
	struct args	*args = self->args;
	struct winlink	*wl = cmdq->state.tflag.wl;

	window_set_name(wl->window, args->argv[0]);
	options_set_number(wl->window->options, "automatic-rename", 0);

	server_status_window(wl->window);

	return (CMD_RETURN_NORMAL);
}
开发者ID:20400992,项目名称:tmux,代码行数:13,代码来源:cmd-rename-window.c

示例2: cmd_set_option_attributes

/* Set an attributes option. */
struct options_entry *
cmd_set_option_attributes(unused struct cmd *self, struct cmd_ctx *ctx,
    const struct options_table_entry *oe, struct options *oo, const char *value)
{
	int	attr;

	if ((attr = attributes_fromstring(value)) == -1) {
		ctx->error(ctx, "bad attributes: %s", value);
		return (NULL);
	}

	return (options_set_number(oo, oe->name, attr));
}
开发者ID:sofuture,项目名称:bitrig,代码行数:14,代码来源:cmd-set-option.c

示例3: options_table_populate_tree

/* Populate an options tree from a table. */
void
options_table_populate_tree(
    const struct options_table_entry *table, struct options *oo)
{
	const struct options_table_entry	*oe;

	for (oe = table; oe->name != NULL; oe++) {
		if (oe->default_str != NULL)
			options_set_string(oo, oe->name, "%s", oe->default_str);
		else
			options_set_number(oo, oe->name, oe->default_num);
	}
}
开发者ID:Hooman3,项目名称:minix,代码行数:14,代码来源:options-table.c

示例4: cmd_set_option_key

/* Set a key option. */
struct options_entry *
cmd_set_option_key(unused struct cmd *self, struct cmd_ctx *ctx,
    const struct options_table_entry *oe, struct options *oo, const char *value)
{
	int	key;

	if ((key = key_string_lookup_string(value)) == KEYC_NONE) {
		ctx->error(ctx, "bad key: %s", value);
		return (NULL);
	}

	return (options_set_number(oo, oe->name, key));
}
开发者ID:sofuture,项目名称:bitrig,代码行数:14,代码来源:cmd-set-option.c

示例5: cmd_set_option_colour

/* Set a colour option. */
struct options_entry *
cmd_set_option_colour(unused struct cmd *self, struct cmd_ctx *ctx,
    const struct options_table_entry *oe, struct options *oo, const char *value)
{
	int	colour;

	if ((colour = colour_fromstring(value)) == -1) {
		ctx->error(ctx, "bad colour: %s", value);
		return (NULL);
	}

	return (options_set_number(oo, oe->name, colour));
}
开发者ID:sofuture,项目名称:bitrig,代码行数:14,代码来源:cmd-set-option.c

示例6: input_exit_rename

/* Rename terminator (ST) received. */
void
input_exit_rename(struct input_ctx *ictx)
{
	if (ictx->flags & INPUT_DISCARD)
		return;
	log_debug("%s: \"%s\"", __func__, ictx->input_buf);

	xfree(ictx->wp->window->name);
	ictx->wp->window->name = xstrdup(ictx->input_buf);
	options_set_number(&ictx->wp->window->options, "automatic-rename", 0);

	server_status_window(ictx->wp->window);
}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:14,代码来源:input.c

示例7: input_exit_rename

/* Rename terminator (ST) received. */
void
input_exit_rename(struct input_ctx *ictx)
{
	if (ictx->flags & INPUT_DISCARD)
		return;
	if (!options_get_number(ictx->wp->window->options, "allow-rename"))
		return;
	log_debug("%s: \"%s\"", __func__, ictx->input_buf);

	window_set_name(ictx->wp->window, ictx->input_buf);
	options_set_number(ictx->wp->window->options, "automatic-rename", 0);

	server_status_window(ictx->wp->window);
}
开发者ID:kylape,项目名称:tmux,代码行数:15,代码来源:input.c

示例8: cmd_set_option_attributes

/* Set an attributes option. */
struct options_entry *
cmd_set_option_attributes(struct cmd *self, struct cmd_ctx *ctx,
    const struct options_table_entry *oe, struct options *oo)
{
	struct cmd_target_data	*data = self->data;
	int			 attr;

	if ((attr = attributes_fromstring(data->arg2)) == -1) {
		ctx->error(ctx, "bad attributes: %s", data->arg2);
		return (NULL);
	}

	return (options_set_number(oo, oe->name, attr));
}
开发者ID:ddollar,项目名称:tmux,代码行数:15,代码来源:cmd-set-option.c

示例9: cmd_set_option_colour

/* Set a colour option. */
struct options_entry *
cmd_set_option_colour(struct cmd *self, struct cmd_ctx *ctx,
    const struct options_table_entry *oe, struct options *oo)
{
	struct cmd_target_data	*data = self->data;
	int			 colour;

	if ((colour = colour_fromstring(data->arg2)) == -1) {
		ctx->error(ctx, "bad colour: %s", data->arg2);
		return (NULL);
	}

	return (options_set_number(oo, oe->name, colour));
}
开发者ID:ddollar,项目名称:tmux,代码行数:15,代码来源:cmd-set-option.c

示例10: cmd_set_option_number

/* Set a number option. */
struct options_entry *
cmd_set_option_number(unused struct cmd *self, struct cmd_q *cmdq,
    const struct options_table_entry *oe, struct options *oo, const char *value)
{
	long long	 ll;
	const char     	*errstr;

	ll = strtonum(value, oe->minimum, oe->maximum, &errstr);
	if (errstr != NULL) {
		cmdq_error(cmdq, "value is %s: %s", errstr, value);
		return (NULL);
	}

	return (options_set_number(oo, oe->name, ll));
}
开发者ID:FauxFaux,项目名称:tmux,代码行数:16,代码来源:cmd-set-option.c

示例11: cmd_set_option_number

/* Set a number option. */
struct options_entry *
cmd_set_option_number(struct cmd *self, struct cmd_ctx *ctx,
    const struct options_table_entry *oe, struct options *oo)
{
	struct cmd_target_data	*data = self->data;
	long long		 ll;
	const char     		*errstr;

	ll = strtonum(data->arg2, oe->minimum, oe->maximum, &errstr);
	if (errstr != NULL) {
		ctx->error(ctx, "value is %s: %s", errstr, data->arg2);
		return (NULL);
	}

	return (options_set_number(oo, oe->name, ll));
}
开发者ID:ddollar,项目名称:tmux,代码行数:17,代码来源:cmd-set-option.c

示例12: cmd_rename_window_exec

enum cmd_retval
cmd_rename_window_exec(struct cmd *self, struct cmd_ctx *ctx)
{
	struct args	*args = self->args;
	struct session	*s;
	struct winlink	*wl;

	if ((wl = cmd_find_window(ctx, args_get(args, 't'), &s)) == NULL)
		return (CMD_RETURN_ERROR);

	window_set_name(wl->window, args->argv[0]);
	options_set_number(&wl->window->options, "automatic-rename", 0);

	server_status_window(wl->window);

	return (CMD_RETURN_NORMAL);
}
开发者ID:HonestQiao,项目名称:tmux,代码行数:17,代码来源:cmd-rename-window.c

示例13: cmd_rename_window_exec

int
cmd_rename_window_exec(struct cmd *self, struct cmd_ctx *ctx)
{
	struct cmd_target_data	*data = self->data;
	struct session		*s;
	struct winlink		*wl;

	if ((wl = cmd_find_window(ctx, data->target, &s)) == NULL)
		return (-1);

	xfree(wl->window->name);
	wl->window->name = xstrdup(data->arg);
	options_set_number(&wl->window->options, "automatic-rename", 0);

	server_status_window(wl->window);

	return (0);
}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:18,代码来源:cmd-rename-window.c

示例14: options_table_populate_tree

/* Populate an options tree from a table. */
void
options_table_populate_tree(
    const struct options_table_entry *table, struct options *oo)
{
	const struct options_table_entry	*oe;

	for (oe = table; oe->name != NULL; oe++) {
		switch (oe->type) {
		case OPTIONS_TABLE_STRING:
			options_set_string(oo, oe->name, "%s", oe->default_str);
			break;
		case OPTIONS_TABLE_STYLE:
			options_set_style(oo, oe->name, oe->default_str, 0);
			break;
		default:
			options_set_number(oo, oe->name, oe->default_num);
			break;
		}
	}
}
开发者ID:theg5prank,项目名称:tmux,代码行数:21,代码来源:options-table.c

示例15: cmd_set_option_attributes

void
cmd_set_option_attributes(struct cmd_ctx *ctx, struct options *oo,
    const struct set_option_entry *entry, char *value)
{
	struct options_entry	*o;
	int			 attr;

	if (value == NULL) {
		ctx->error(ctx, "empty value");
		return;
	}

	if ((attr = attributes_fromstring(value)) == -1) {
		ctx->error(ctx, "bad attributes: %s", value);
		return;
	}

	o = options_set_number(oo, entry->name, attr);
	ctx->info(ctx,
	    "set option: %s -> %s", o->name, cmd_set_option_print(entry, o));
}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:21,代码来源:cmd-set-option.c


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