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

C++ conf_set_str函数代码示例

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

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



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

示例1: process_nonoption_arg

int process_nonoption_arg(char *arg, Conf *conf, int *allow_launch)
{
    char *p, *q = arg;

    if (got_host) {
        /*
         * If we already have a host name, treat this argument as a
         * port number. NB we have to treat this as a saved -P
         * argument, so that it will be deferred until it's a good
         * moment to run it.
         */
        int ret = cmdline_process_param("-P", arg, 1, conf);
        assert(ret == 2);
    } else if (!strncmp(q, "telnet:", 7)) {
        /*
         * If the hostname starts with "telnet:",
         * set the protocol to Telnet and process
         * the string as a Telnet URL.
         */
        char c;

        q += 7;
        if (q[0] == '/' && q[1] == '/')
            q += 2;
        conf_set_int(conf, CONF_protocol, PROT_TELNET);
        p = q;
        while (*p && *p != ':' && *p != '/')
            p++;
        c = *p;
        if (*p)
            *p++ = '\0';
        if (c == ':')
            conf_set_int(conf, CONF_port, atoi(p));
        else
            conf_set_int(conf, CONF_port, -1);
	conf_set_str(conf, CONF_host, q);
        got_host = 1;
    } else {
        /*
         * Otherwise, treat this argument as a host name.
         */
        p = arg;
        while (*p && !isspace((unsigned char)*p))
            p++;
        if (*p)
            *p++ = '\0';
        conf_set_str(conf, CONF_host, q);
        got_host = 1;
    }
    if (got_host)
	*allow_launch = TRUE;
    return 1;
}
开发者ID:BillyWu,项目名称:putty,代码行数:53,代码来源:uxputty.c


示例2: conf_set_int

static int
conf_set_int(const char *path, int val)
{
  char buff[256];
  snprintf(buff, sizeof buff, "%d", val);
  return conf_set_str(path, buff);
}
开发者ID:tidatida,项目名称:alarmd,代码行数:7,代码来源:ticker.c


示例3: gpps

static void gpps(void *handle, const char *name, const char *def,
		 Conf *conf, int primary)
{
    char *val = gpps_raw(handle, name, def);
    conf_set_str(conf, primary, val);
    sfree(val);
}
开发者ID:alexeyaa,项目名称:putty-cac,代码行数:7,代码来源:settings.c


示例4: custom_set_time_format

static
int
custom_set_time_format(const char *fmt)
{
  int rc = conf_set_str(CONF_FORMAT, fmt);
  custom_send_notification(0);
  return rc;
}
开发者ID:tidatida,项目名称:alarmd,代码行数:8,代码来源:ticker.c


示例5: custom_set_timezone

static
int
custom_set_timezone(const char *tz)
{
  tz_set(tz);
  conf_set_str(CONF_ZONE, tz_get());

  int rc = tz_cmp(tz_get(), tz) ? -1 : 0;
  custom_send_notification(0);
  return rc;
}
开发者ID:tidatida,项目名称:alarmd,代码行数:11,代码来源:ticker.c


示例6: conf_set_servaction

static int conf_set_servaction(const char *valstr)
{
    const char* tmp = NULL;

    conf_set_str(&tmp, valstr, NULL);

    if (tmp) {
	if (!strcasecmp(tmp, "install")) {
	    fprintf(stderr, "Installing service");
	    Win32_ServiceInstall();
	} else if (!strcasecmp(tmp, "uninstall")) {
	    fprintf(stderr, "Uninstalling service");
	    Win32_ServiceUninstall();
	} else {
	    fprintf(stderr, "Unknown service action '%s'\n", tmp);
	}

	exitflag = 1;
	xfree((void *)tmp);
    }

    return 0;
}
开发者ID:Danteoriginal,项目名称:PvPGN-2,代码行数:23,代码来源:cmdline.cpp


示例7: conf_set_realmname

static int conf_set_realmname(const char* valstr)
{
	return conf_set_str(&prefs_conf.realmname,valstr,NULL);
}
开发者ID:AleXoundOS,项目名称:pvpgn,代码行数:4,代码来源:prefs.cpp


示例8: conf_setdef_bnetaddr

static int conf_setdef_bnetaddr(void)
{
	return conf_set_str(&prefs_conf.bnetdaddr,NULL,BNETD_SERVER_LIST);
}
开发者ID:AleXoundOS,项目名称:pvpgn,代码行数:4,代码来源:prefs.cpp


示例9: conf_set_newbiefile_necromancer

static int conf_set_newbiefile_necromancer(const char* valstr)
{
	return conf_set_str(&prefs_conf.newbiefile_necromancer, valstr, NULL);
}
开发者ID:AleXoundOS,项目名称:pvpgn,代码行数:4,代码来源:prefs.cpp


示例10: plink_main


//.........这里部分代码省略.........
                usage();
            } else if (!strcmp(p, "-pgpfp")) {
                pgp_fingerprints();
                exit(1);
	    } else {
		fprintf(stderr, "plink: unknown option \"%s\"\n", p);
		errors = 1;
	    }
	} else if (*p) {
	    if (!conf_launchable(conf) || !(got_host || loaded_session)) {
		char *q = p;
		/*
		 * If the hostname starts with "telnet:", set the
		 * protocol to Telnet and process the string as a
		 * Telnet URL.
		 */
		if (!strncmp(q, "telnet:", 7)) {
		    char c;

		    q += 7;
		    if (q[0] == '/' && q[1] == '/')
			q += 2;
		    conf_set_int(conf, CONF_protocol, PROT_TELNET);
		    p = q;
		    while (*p && *p != ':' && *p != '/')
			p++;
		    c = *p;
		    if (*p)
			*p++ = '\0';
		    if (c == ':')
			conf_set_int(conf, CONF_port, atoi(p));
		    else
			conf_set_int(conf, CONF_port, -1);
		    conf_set_str(conf, CONF_host, q);
		    got_host = TRUE;
		} else {
		    char *r, *user, *host;
		    /*
		     * Before we process the [[email protected]]host string, we
		     * first check for the presence of a protocol
		     * prefix (a protocol name followed by ",").
		     */
		    r = strchr(p, ',');
		    if (r) {
			const Backend *b;
			*r = '\0';
			b = backend_from_name(p);
			if (b) {
			    default_protocol = b->protocol;
			    conf_set_int(conf, CONF_protocol,
					 default_protocol);
			    portnumber = b->default_port;
			}
			p = r + 1;
		    }

		    /*
		     * A nonzero length string followed by an @ is treated
		     * as a username. (We discount an _initial_ @.) The
		     * rest of the string (or the whole string if no @)
		     * is treated as a session name and/or hostname.
		     */
		    r = strrchr(p, '@');
		    if (r == p)
			p++, r = NULL; /* discount initial @ */
		    if (r) {
开发者ID:svn2github,项目名称:kitty,代码行数:67,代码来源:winplink.c


示例11: do_cmdline

int do_cmdline(int argc, char **argv, int do_everything, int *allow_launch,
               struct gui_data *inst, Conf *conf)
{
    int err = 0;
    char *val;

    /*
     * Macros to make argument handling easier. Note that because
     * they need to call `continue', they cannot be contained in
     * the usual do {...} while (0) wrapper to make them
     * syntactically single statements; hence it is not legal to
     * use one of these macros as an unbraced statement between
     * `if' and `else'.
     */
#define EXPECTS_ARG { \
    if (--argc <= 0) { \
	err = 1; \
	fprintf(stderr, "%s: %s expects an argument\n", appname, p); \
        continue; \
    } else \
	val = *++argv; \
}
#define SECOND_PASS_ONLY { if (!do_everything) continue; }

    while (--argc > 0) {
	char *p = *++argv;
        int ret;

	/*
	 * Shameless cheating. Debian requires all X terminal
	 * emulators to support `-T title'; but
	 * cmdline_process_param will eat -T (it means no-pty) and
	 * complain that pterm doesn't support it. So, in pterm
	 * only, we convert -T into -title.
	 */
	if ((cmdline_tooltype & TOOLTYPE_NONNETWORK) &&
	    !strcmp(p, "-T"))
	    p = (char*)"-title";

        ret = cmdline_process_param(p, (argc > 1 ? argv[1] : NULL),
                                    do_everything ? 1 : -1, conf);

	if (ret == -2) {
	    cmdline_error("option \"%s\" requires an argument",p);
	} else if (ret == 2) {
	    --argc, ++argv;            /* skip next argument */
            continue;
	} else if (ret == 1) {
            continue;
        }

	if (!strcmp(p, "-fn") || !strcmp(p, "-font")) {
        FontSpec *fs;
	    EXPECTS_ARG;
        SECOND_PASS_ONLY;
        fs = fontspec_new(val);
        conf_set_fontspec(conf, CONF_font, fs);
        fontspec_free(fs);
	} else if (!strcmp(p, "-fb")) {
        FontSpec *fs;
	    EXPECTS_ARG;
	    SECOND_PASS_ONLY;
        fs = fontspec_new(val);
        conf_set_fontspec(conf, CONF_boldfont, fs);
        fontspec_free(fs);
	} else if (!strcmp(p, "-fw")) {
        FontSpec *fs;
	    EXPECTS_ARG;
	    SECOND_PASS_ONLY;
        fs = fontspec_new(val);
        conf_set_fontspec(conf, CONF_widefont, fs);
        fontspec_free(fs);
	} else if (!strcmp(p, "-fwb")) {
        FontSpec *fs;
	    EXPECTS_ARG;
	    SECOND_PASS_ONLY;
        fs = fontspec_new(val);
        conf_set_fontspec(conf, CONF_wideboldfont, fs);
        fontspec_free(fs);
	} else if (!strcmp(p, "-cs")) {
	    EXPECTS_ARG;
	    SECOND_PASS_ONLY;
        conf_set_str(conf, CONF_line_codepage, val);

	} else if (!strcmp(p, "-geometry")) {
#ifdef Q_OS_UNIX
	    int flags, x, y;
	    unsigned int w, h;
	    EXPECTS_ARG;
	    SECOND_PASS_ONLY;

	    flags = XParseGeometry(val, &x, &y, &w, &h);
	    if (flags & WidthValue)
            conf_set_int(conf, CONF_width, w);
        if (flags & HeightValue)
            conf_set_int(conf, CONF_height, h);

            if (flags & (XValue | YValue)) {
                inst->xpos = x;
                inst->ypos = y;
//.........这里部分代码省略.........
开发者ID:dsmorozov,项目名称:qputty-qt5,代码行数:101,代码来源:qtwin.cpp


示例12: conf_setdef_loglevels

static int conf_setdef_loglevels(void)
{
	return conf_set_str(&prefs_conf.loglevels,NULL,DEFAULT_LOG_LEVELS);
}
开发者ID:AleXoundOS,项目名称:pvpgn,代码行数:4,代码来源:prefs.cpp


示例13: conf_setdef_ladderdir

static int conf_setdef_ladderdir(void)
{
	return conf_set_str(&prefs_conf.ladderdir,NULL,D2CS_LADDER_DIR);
}
开发者ID:AleXoundOS,项目名称:pvpgn,代码行数:4,代码来源:prefs.cpp


示例14: conf_setdef_motd

static int conf_setdef_motd(void)
{
	return conf_set_str(&prefs_conf.motd,NULL,D2CS_MOTD);
}
开发者ID:AleXoundOS,项目名称:pvpgn,代码行数:4,代码来源:prefs.cpp


示例15: conf_set_motd

static int conf_set_motd(const char* valstr)
{
	return conf_set_str(&prefs_conf.motd,valstr,NULL);
}
开发者ID:AleXoundOS,项目名称:pvpgn,代码行数:4,代码来源:prefs.cpp


示例16: conf_setdef_newbiefile_assasin

static int conf_setdef_newbiefile_assasin(void)
{
	return conf_set_str(&prefs_conf.newbiefile_assasin, NULL, D2CS_CHARSAVE_NEWBIE);
}
开发者ID:AleXoundOS,项目名称:pvpgn,代码行数:4,代码来源:prefs.cpp


示例17: conf_set_newbiefile_assasin

static int conf_set_newbiefile_assasin(const char* valstr)
{
	return conf_set_str(&prefs_conf.newbiefile_assasin, valstr, NULL);
}
开发者ID:AleXoundOS,项目名称:pvpgn,代码行数:4,代码来源:prefs.cpp


示例18: conf_set_newbiefile_druid

static int conf_set_newbiefile_druid(const char* valstr)
{
	return conf_set_str(&prefs_conf.newbiefile_druid, valstr, NULL);
}
开发者ID:AleXoundOS,项目名称:pvpgn,代码行数:4,代码来源:prefs.cpp


示例19: conf_setdef_newbiefile_necromancer

static int conf_setdef_newbiefile_necromancer(void)
{
	return conf_set_str(&prefs_conf.newbiefile_necromancer, NULL, D2CS_CHARSAVE_NEWBIE);
}
开发者ID:AleXoundOS,项目名称:pvpgn,代码行数:4,代码来源:prefs.cpp


示例20: conf_setdef_realmname

static int conf_setdef_realmname(void)
{
	return conf_set_str(&prefs_conf.realmname,NULL,DEFAULT_REALM_NAME);
}
开发者ID:AleXoundOS,项目名称:pvpgn,代码行数:4,代码来源:prefs.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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