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

C++ ABORT_MPI函数代码示例

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

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



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

示例1: mfn_holds

const char *
mfn_holds(MFUNARGS)
{
	dbref obj1 = mesg_dbref_raw(descr, player, what, perms, argv[0]);
	dbref obj2 = player;

	if (argc > 1)
		obj2 = mesg_dbref_local(descr, player, what, perms, argv[1], mesgtyp);

	if (obj1 == UNKNOWN || obj1 == AMBIGUOUS || obj1 == NOTHING || obj1 == HOME)
		ABORT_MPI("HOLDS", "Match failed (1).");
	if (obj1 == PERMDENIED)
		ABORT_MPI("HOLDS", "Permission Denied (1).");

	if (obj2 == UNKNOWN || obj2 == AMBIGUOUS || obj2 == NOTHING || obj2 == HOME)
		ABORT_MPI("HOLDS", "Match failed (2).");
	if (obj2 == PERMDENIED)
		ABORT_MPI("HOLDS", "Permission Denied (2).");

	if (obj2 == getloc(obj1)) {
		return "1";
	} else {
		return "0";
	}
}
开发者ID:rhencke,项目名称:fuzzball,代码行数:25,代码来源:mfuns.c


示例2: mfn_name

const char *
mfn_name(MFUNARGS)
{
    char *ptr;
    // dbref obj = mesg_dbref_proximity(player, what, perms, argv[0]);
    dbref obj = mesg_dbref_raw(player, what, perms, argv[0]);

    if (obj == UNKNOWN)
        ABORT_MPI("NAME","Match failed.");
    if (obj == NOTHING) {
        strcpy(buf, "#NOTHING#");
	return buf;
    }
    if (obj == AMBIGUOUS) {
        strcpy(buf, "#AMBIGUOUS#");
	return buf;
    }
    if (obj == HOME) {
        strcpy(buf, "#HOME#");
	return buf;
    }
    if (!(Typeof(obj) == TYPE_PLAYER) &&
        !mesg_proximity_perms(player, perms, obj))
        ABORT_MPI("NAME","Permission denied.");
    strcpy(buf, RNAME(obj));
    if (Typeof(obj) == TYPE_EXIT) {
        ptr = index(buf, ';');
        if (ptr) *ptr = '\0';
    }
    return buf;
}
开发者ID:TealWizard,项目名称:TinyMUCK-Tapestries,代码行数:31,代码来源:mfuns2.c


示例3: mfn_controls

const char *
mfn_controls(MFUNARGS)
{

dbref   obj;
    dbref   obj2;
    
    obj = mesg_dbref_raw(player, what, perms, argv[0]);
    if (obj == AMBIGUOUS || obj == NOTHING || obj == UNKNOWN)
	ABORT_MPI("CONTROLS","Match failed. (1)");
    if (obj == PERMDENIED)
	ABORT_MPI("CONTROLS","Permission denied. (1)");
    if (obj == HOME) obj = DBFETCH(player)->sp.player.home;
    if (argc > 1) {
	obj2 = mesg_dbref_raw(player, what, perms, argv[1]);
	if (obj2 == AMBIGUOUS || obj2 == NOTHING || obj2 == UNKNOWN)
	    ABORT_MPI("CONTROLS","Match failed. (2)");
	if (obj2 == PERMDENIED)
	    ABORT_MPI("CONTROLS","Permission denied. (2)");
	if (obj2 == HOME) obj2 = DBFETCH(player)->sp.player.home;
	if (Typeof(obj2) != TYPE_PLAYER) obj2 = OWNER(obj2);
    } else {
	obj2 = OWNER(perms);
    }
    if (controls(obj2, obj)) {
	return "1";
    } else {
	return "0";
    }
}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:30,代码来源:mfuns2.c


示例4: mfn_testlock

const char *
mfn_testlock(MFUNARGS)
{
    struct boolexp *lok;
    dbref who = player;
    dbref obj = mesg_dbref_local(player, what, perms, argv[0]);

    if (argc > 2)
	who = mesg_dbref_local(player, what, perms, argv[2]);
    if (who == AMBIGUOUS || who == UNKNOWN || who == NOTHING || who == HOME)
	ABORT_MPI("TESTLOCK","Match failed. (1)");
    if (who == PERMDENIED)
	ABORT_MPI("TESTLOCK","Permission denied. (1)");
    if (obj == AMBIGUOUS || obj == UNKNOWN || obj == NOTHING || obj == HOME)
	ABORT_MPI("TESTLOCK","Match failed. (2)");
    if (obj == PERMDENIED)
	ABORT_MPI("TESTLOCK","Permission denied. (2)");
    lok = get_property_lock(obj, argv[1]);
    if (argc > 3 && lok == TRUE_BOOLEXP)
	return (argv[3]);
    if (eval_boolexp(who, lok, obj)) {
	return "1";
    } else {
	return "0";
    }
}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:26,代码来源:mfuns2.c


示例5: mfn_lunion

const char *
mfn_lunion(MFUNARGS)
{
    int iter_limit = MAX_MFUN_LIST_LEN;
    char   *ptr, *ptr2, *p;
    int len;
    int outlen, nextlen;

    *buf = '\0';
    outlen = 0;
    ptr = argv[0];
    while (*ptr) {
	for (ptr2 = ptr; *ptr2 && *ptr2 != '\r'; ptr2++);
	if (*ptr2) *(ptr2++) = '\0';
	len = strlen(ptr);
	p = buf; 
	do {
	    if (string_prefix(p, ptr) && (!p[len] || p[len] == '\r'))
		break;
	    while (*p && *p != '\r') p++;
	    if (*p) p++;
	} while (*p);
	if (!*p) {
	    nextlen = strlen(ptr);
	    if (outlen + nextlen > BUFFER_LEN - 3)
		break;
	    if (outlen) strcat((buf+(outlen++)), "\r");
	    strcat((buf+outlen), ptr);
	    outlen += nextlen;
	}
	ptr = ptr2;
	if (!(--iter_limit))
	    ABORT_MPI("LUNION","Iteration limit exceeded");
    }
    ptr = argv[1];
    while (*ptr) {
	for (ptr2 = ptr; *ptr2 && *ptr2 != '\r'; ptr2++);
	if (*ptr2) *(ptr2++) = '\0';
	len = strlen(ptr);
	p = buf; 
	do {
	    if (string_prefix(p, ptr) && (!p[len] || p[len] == '\r'))
		break;
	    while (*p && *p != '\r') p++;
	    if (*p) p++;
	} while (*p);
	if (!*p) {
	    nextlen = strlen(ptr);
	    if (outlen + nextlen > BUFFER_LEN - 3)
		break;
	    if (outlen) strcat((buf+(outlen++)), "\r");
	    strcat((buf+outlen), ptr);
	    outlen += nextlen;
	}
	ptr = ptr2;
	if (!(--iter_limit))
	    ABORT_MPI("LUNION","Iteration limit exceeded");
    }
    return buf;
}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:60,代码来源:mfuns2.c


示例6: mfn_showlist

const char *
mfn_showlist(MFUNARGS)
{
    dbref obj;
    const char *m = NULL;
    int lines=0;

    if(argc > 1) {
	obj = mesg_dbref_mage(player, what, perms, argv[1]);
	if (obj == AMBIGUOUS || obj == UNKNOWN || obj == NOTHING || obj == HOME)
	    ABORT_MPI("SHOWLIST","Match failed");
	if (obj == PERMDENIED)
	    ABORT_MPI("SHOWLIST",NOPERM_MESG);
    } else obj = what;

    if (Prop_Hidden(argv[0]) && (Permlevel(perms) < tp_hidden_prop_mlevel))
	ABORT_MPI("SHOWLIST",NOPERM_MESG);
    while ( (lines < MAX_MFUN_LIST_LEN) && (!lines || (m && *m)) ) {
	sprintf(buf, "%s#/%d", argv[0], ++lines);
	m = safegetprop_strict(player, obj, perms, buf);
	if( m && *m ) {
	    notify_nolisten(player, m, 1);
	}
    }
    buf[0] = '\0';
    return buf;
}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:27,代码来源:mfuns2.c


示例7: mfn_func

const char *
mfn_func(MFUNARGS)
{
	char *funcname;
	char *ptr=NULL, *def;
	char namebuf[BUFFER_LEN];
	char argbuf[BUFFER_LEN];
	char defbuf[BUFFER_LEN];
	int i;

	funcname = MesgParse(argv[0], namebuf, sizeof(namebuf));
	CHECKRETURN(funcname, "FUNC", "name argument (1)");

	def = argv[argc - 1];
	for (i = 1; i < argc - 1; i++) {
		ptr = MesgParse(argv[i], argbuf, sizeof(argbuf));
		CHECKRETURN(ptr, "FUNC", "variable name argument");
		snprintf(defbuf, sizeof(defbuf), "{with:%.*s,{:%d},%.*s}", MAX_MFUN_NAME_LEN, ptr, i,
				(BUFFER_LEN - MAX_MFUN_NAME_LEN - 20), def);
	}
	i = new_mfunc(funcname, defbuf);
	if (i == 1)
		ABORT_MPI("FUNC", "Function Name too long.");
	if (i == 2)
		ABORT_MPI("FUNC", "Too many functions defined.");

	return "";
}
开发者ID:rhencke,项目名称:fuzzball,代码行数:28,代码来源:mfuns.c


示例8: mfn_center

const char *
mfn_center(MFUNARGS)
{
	/* {center:string,fieldwidth,padstr} */
	/* Center justify string to a fieldwidth, filling with padstr */

	char *ptr;
	char *fptr;
	int i, len, halflen;
	char *fillstr;

	len = (argc > 1) ? atoi(argv[1]) : 78;
	if (len > BUFFER_LEN - 1)
		ABORT_MPI("CENTER", "Fieldwidth too big.");
	halflen = len / 2;

	fillstr = (argc > 2) ? argv[2] : " ";
	if (!*fillstr)
		ABORT_MPI("CENTER", "Null pad string.");

	for (ptr = buf, fptr = fillstr, i = strlen(argv[0]) / 2; i < halflen; i++) {
		*ptr++ = *fptr++;
		if (!*fptr)
			fptr = fillstr;
	}
	strcpyn(ptr, buflen - (ptr - buf), argv[0]);
	for (i = strlen(buf), ptr = &buf[i], fptr = fillstr; i < len; i++) {
		*ptr++ = *fptr++;
		if (!*fptr)
			fptr = fillstr;
	}
	*ptr = '\0';
	return buf;
}
开发者ID:rhencke,项目名称:fuzzball,代码行数:34,代码来源:mfuns.c


示例9: mfn_with

const char *
mfn_with(MFUNARGS)
{
    char vbuf[BUFFER_LEN];
    char *ptr, *valptr;
    int v, cnt;

    ptr = MesgParse(argv[0], argv[0]);
    CHECKRETURN(ptr,"WITH","arg 1");
    v = new_mvar(ptr, vbuf);
    if (v == 1)
	ABORT_MPI("WITH","Variable name too long");
    if (v == 2)
	ABORT_MPI("WITH","Too many variables already defined");
    valptr = MesgParse(argv[1], argv[1]);
    CHECKRETURN(valptr,"WITH","arg 2");
    *buf = '\0';
    strcpy(vbuf, valptr);
    for (cnt = 2; cnt < argc; cnt++) {
	ptr = MesgParse(argv[cnt],argv[cnt]);
	if (!ptr) {
	    sprintf(buf, "%s %cWITH%c (%d)", get_mvar("how"),
		    MFUN_LEADCHAR, MFUN_ARGEND, cnt);
	    notify(player, buf);
	    return NULL;
	}
    }
    free_top_mvar();
    return ptr;
}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:30,代码来源:mfuns2.c


示例10: mfn_lexec

const char *
mfn_lexec(MFUNARGS)
{
	dbref trg = (dbref) 0, obj = what;
	char *pname;
	const char *ptr;
	int blessed = 0;

	pname = argv[0];
	if (argc == 2) {
		obj = mesg_dbref(descr, player, what, perms, argv[1], mesgtyp);
	}
	if (obj == PERMDENIED)
		ABORT_MPI("LEXEC", "Permission denied.");
	if (obj == UNKNOWN || obj == AMBIGUOUS || obj == NOTHING || obj == HOME)
		ABORT_MPI("LEXEC", "Match failed.");
	while (*pname == PROPDIR_DELIMITER)
		pname++;
	ptr = get_concat_list(player, what, perms, obj, (char *)pname, buf, BUFFER_LEN, 2, mesgtyp, &blessed);
	if (!ptr)
		ptr = "";
	trg = what;
	if (blessed) {
		mesgtyp |= MPI_ISBLESSED;
	} else {
		mesgtyp &= ~MPI_ISBLESSED;
	}
	if (Prop_ReadOnly(pname) || Prop_Private(pname) || Prop_SeeOnly(pname) || Prop_Hidden(pname))
		trg = obj;
	ptr = mesg_parse(descr, player, obj, trg, ptr, buf, BUFFER_LEN, mesgtyp);
	CHECKRETURN(ptr, "LEXEC", "listval");
	return ptr;
}
开发者ID:rhencke,项目名称:fuzzball,代码行数:33,代码来源:mfuns.c


示例11: mfn_fullname

const char *
mfn_fullname(MFUNARGS)
{
    dbref obj;
    
    obj = tp_compatible_mpi
    	? mesg_dbref_raw(player, what, perms, argv[0])
    	: mesg_dbref_local(player, what, perms, argv[0])
	;

    if (obj == UNKNOWN)
	ABORT_MPI("NAME","Match failed");
    if (obj == PERMDENIED)
	ABORT_MPI("NAME",NOPERM_MESG);
    if (obj == NOTHING) {
	strcpy(buf, "#NOTHING#");
	return buf;
    }
    if (obj == AMBIGUOUS) {
	strcpy(buf, "#AMBIGUOUS#");
	return buf;
    }
    if (obj == HOME) {
	strcpy(buf, "#HOME#");
	return buf;
    }
    strcpy(buf, RNAME(obj));
    return buf;
}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:29,代码来源:mfuns2.c


示例12: mfn_name

const char *
mfn_name(MFUNARGS)
{
    char *ptr;
    dbref obj;

    obj = tp_compatible_mpi
    	? mesg_dbref_raw(player, what, perms, argv[0])
    	: mesg_dbref_local(player, what, perms, argv[0])
	;

    if (obj == UNKNOWN)
	ABORT_MPI("NAME","Match failed");
    if (obj == PERMDENIED)
	ABORT_MPI("NAME",NOPERM_MESG);
    if (obj == NOTHING) {
	strcpy(buf, "#NOTHING#");
	return buf;
    }
    if (obj == AMBIGUOUS) {
	strcpy(buf, "#AMBIGUOUS#");
	return buf;
    }
    if (obj == HOME) {
	strcpy(buf, "#HOME#");
	return buf;
    }
    strcpy(buf, RNAME(obj));
    if (Typeof(obj) == TYPE_EXIT) {
	ptr = index(buf, ';');
	if (ptr) *ptr = '\0';
    }
    return buf;
}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:34,代码来源:mfuns2.c


示例13: mfn_right

const char *
mfn_right(MFUNARGS)
{
	/* {right:string,fieldwidth,padstr} */
	/* Right justify string to a fieldwidth, filling with padstr */

	char *ptr;
	char *fptr;
	int i, len;
	char *fillstr;

	len = (argc > 1) ? atoi(argv[1]) : 78;
	if (len > BUFFER_LEN - 1)
		ABORT_MPI("RIGHT", "Fieldwidth too big.");
	fillstr = (argc > 2) ? argv[2] : " ";
	if (!*fillstr)
		ABORT_MPI("RIGHT", "Null pad string.");
	for (ptr = buf, fptr = fillstr, i = strlen(argv[0]); i < len; i++) {
		*ptr++ = *fptr++;
		if (!*fptr)
			fptr = fillstr;
	}
	strcpyn(ptr, buflen - (ptr - buf), argv[0]);
	return buf;
}
开发者ID:rhencke,项目名称:fuzzball,代码行数:25,代码来源:mfuns.c


示例14: mfn_left

const char *
mfn_left(MFUNARGS)
{
	/* {left:string,fieldwidth,padstr} */
	/* Left justify string to a fieldwidth, filling with padstr */

	char *ptr;
	char *fptr;
	int i, len;
	char *fillstr;

	len = (argc > 1) ? atoi(argv[1]) : 78;
	if (len > BUFFER_LEN - 1)
		ABORT_MPI("LEFT", "Fieldwidth too big.");
	fillstr = (argc > 2) ? argv[2] : " ";
	if (!*fillstr)
		ABORT_MPI("LEFT", "Null pad string.");
	strcpyn(buf, buflen, argv[0]);
	for (i = strlen(argv[0]), ptr = &buf[i], fptr = fillstr; i < len; i++) {
		*ptr++ = *fptr++;
		if (!*fptr)
			fptr = fillstr;
	}
	*ptr = '\0';
	return buf;
}
开发者ID:rhencke,项目名称:fuzzball,代码行数:26,代码来源:mfuns.c


示例15: mfn_nearby

const char *
mfn_nearby(MFUNARGS)
{
	dbref obj;
	dbref obj2;

	obj = mesg_dbref_raw(descr, player, what, perms, argv[0]);
	if (obj == UNKNOWN || obj == AMBIGUOUS || obj == NOTHING)
		ABORT_MPI("NEARBY", "Match failed (arg1).");
	if (obj == PERMDENIED)
		ABORT_MPI("NEARBY", "Permission denied (arg1).");
	if (obj == HOME)
		obj = PLAYER_HOME(player);
	if (argc > 1) {
		obj2 = mesg_dbref_raw(descr, player, what, perms, argv[1]);
		if (obj2 == UNKNOWN || obj2 == AMBIGUOUS || obj2 == NOTHING)
			ABORT_MPI("NEARBY", "Match failed (arg2).");
		if (obj2 == PERMDENIED)
			ABORT_MPI("NEARBY", "Permission denied (arg2).");
		if (obj2 == HOME)
			obj2 = PLAYER_HOME(player);
	} else {
		obj2 = what;
	}
	if (!(mesgtyp & MPI_ISBLESSED) && !isneighbor(obj, what) && !isneighbor(obj2, what) &&
		!isneighbor(obj, player) && !isneighbor(obj2, player)
			) {
		ABORT_MPI("NEARBY", "Permission denied.  Neither object is local.");
	}
	if (isneighbor(obj, obj2)) {
		return "1";
	} else {
		return "0";
	}
}
开发者ID:rhencke,项目名称:fuzzball,代码行数:35,代码来源:mfuns.c


示例16: mfn_rand

const char *
mfn_rand(MFUNARGS)
{
	int num = 0;
	dbref trg = (dbref) 0, obj = what;
	const char *pname, *ptr;
	int blessed = 0;

	pname = argv[0];
	if (argc == 2) {
		obj = mesg_dbref(descr, player, what, perms, argv[1], mesgtyp);
	}
	if (obj == PERMDENIED)
		ABORT_MPI("RAND", "Permission denied.");
	if (obj == UNKNOWN || obj == AMBIGUOUS || obj == NOTHING || obj == HOME)
		ABORT_MPI("RAND", "Match failed.");
	num = get_list_count(what, obj, perms, (char *)pname, mesgtyp, &blessed);
	if (!num)
		ABORT_MPI("RAND", "Failed list read.");
	ptr = get_list_item(what, obj, perms, (char *)pname, (((RANDOM() / 256) % num) + 1), mesgtyp, &blessed);
	if (!ptr)
		ABORT_MPI("RAND", "Failed list read.");
	trg = what;
	if (blessed) {
		mesgtyp |= MPI_ISBLESSED;
	} else {
		mesgtyp &= ~MPI_ISBLESSED;
	}
	if (Prop_ReadOnly(ptr) || Prop_Private(ptr) || Prop_SeeOnly(ptr) || Prop_Hidden(ptr))
		trg = obj;
	ptr = mesg_parse(descr, player, obj, trg, ptr, buf, BUFFER_LEN, mesgtyp);
	CHECKRETURN(ptr, "RAND", "listval");
	return ptr;
}
开发者ID:rhencke,项目名称:fuzzball,代码行数:34,代码来源:mfuns.c


示例17: mfn_filter

const char *
mfn_filter(MFUNARGS)
{
    int iter_limit = MAX_MFUN_LIST_LEN;
    char buf2[BUFFER_LEN];
    char tmp[BUFFER_LEN];
    char   *ptr, *ptr2, *dptr;
    char *sepin = argv[3];
    char *sepbuf = argv[4];
    int seplen, v;

    ptr = MesgParse(argv[0],argv[0]);
    CHECKRETURN(ptr,"FILTER","arg 1");
    v = new_mvar(ptr, tmp);
    if (v == 1)
        ABORT_MPI("FILTER","Variable name too long.");
    if (v == 2)
        ABORT_MPI("FILTER","Too many variables already defined.");

    dptr = MesgParse(argv[1],argv[1]);
    CHECKRETURN(dptr,"FILTER","arg 2");
    if (argc > 3) {
        ptr = MesgParse(sepin,sepin);
        CHECKRETURN(ptr,"FILTER","arg 4");
        if (!*ptr)
            ABORT_MPI("FILTER","Can't use Null seperator string");
    } else {
        strcpy(sepin, "\r");
    }
    if (argc > 4) {
        ptr = MesgParse(sepbuf,sepbuf);
        CHECKRETURN(ptr,"FILTER","arg 5");
    } else {
        strcpy(sepbuf, sepin);
    }
    seplen = strlen(sepin);
    *buf = '\0';
    ptr = dptr;
    while (*ptr) {
        for (ptr2 = ptr; *ptr2 && strncmp(ptr2, sepin, seplen); ptr2++);
        if (*ptr2) {
            *ptr2 = '\0';
            ptr2 += seplen;
        }
        strcpy(tmp, ptr);
        dptr = MesgParse(argv[2],buf2);
        CHECKRETURN(dptr,"FILTER","arg 3");
        if (truestr(buf2)) {
            if (*buf) strcat(buf, sepbuf);
            strcat(buf, ptr);
        }
        ptr = ptr2;
        if (!(--iter_limit))
            ABORT_MPI("FILTER","Iteration limit exceeded");
    }
    free_top_mvar();
    return buf;
}
开发者ID:TealWizard,项目名称:TinyMUCK-Tapestries,代码行数:58,代码来源:mfuns2.c


示例18: mfn_muf

const char *
mfn_muf(MFUNARGS)
{
    char *ptr;
    struct inst *rv = NULL;
    dbref obj = mesg_dbref_raw(player, what, perms, argv[0]);

    if (obj == UNKNOWN)
	ABORT_MPI("MUF","Match failed");
    if (obj <= NOTHING || Typeof(obj) != TYPE_PROGRAM)
	ABORT_MPI("MUF","Bad program reference");
    if (!(FLAGS(obj) & LINK_OK) && !controls(perms,obj))
	ABORT_MPI("MUF",NOPERM_MESG);
    if ((mesgtyp & (MPI_ISLISTENER | MPI_ISLOCK)) && (MLevel(obj) < LM3))
	ABORT_MPI("MUF",NOPERM_MESG);

    if (++mpi_muf_call_levels > 18)
	ABORT_MPI("MUF","Too many call levels");

    strcpy(match_args, argv[1]);
    ptr = get_mvar("how");
    strcpy(match_cmdname, ptr);
    strcat(match_cmdname, "(MPI)");
    rv = interp(player, DBFETCH(player)->location,
		obj, perms, PREEMPT, STD_HARDUID, 1);

    mpi_muf_call_levels--;

    if (!rv) return "";
    switch(rv->type) {
	case PROG_STRING:
	    if (rv->data.string) {
		strcpy(buf, rv->data.string->data);
		CLEAR(rv);
		return buf;
	    } else {
		CLEAR(rv);
		return "";
	    }
	    break;
	case PROG_INTEGER:
	    sprintf(buf, "%d", rv->data.number);
	    CLEAR(rv);
	    return buf;
	    break;
	case PROG_OBJECT:
	    ptr = ref2str(rv->data.objref, buf);
	    CLEAR(rv);
	    return ptr;
	    break;
	default:
	    CLEAR(rv);
	    return "";
	    break;
    }

    return "";
}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:58,代码来源:mfuns2.c


示例19: mfn_commas

const char *
mfn_commas(MFUNARGS)
{
    int v, i, count;
    char *ptr;
    char buf2[BUFFER_LEN];
    char tmp[BUFFER_LEN];

    if (argc == 3)
	ABORT_MPI("COMMAS","Takes 1, 2, or 4 arguments");

    ptr = MesgParse(argv[0], argv[0]);
    CHECKRETURN(ptr,"COMMAS","arg 1");
    count = countlitems(argv[0], "\r");
    if (count == 0) return "";

    if (argc > 1) {
	ptr = MesgParse(argv[1], argv[1]);
	CHECKRETURN(ptr,"COMMAS","arg 2");
    } else {
	strcpy(argv[1], " and ");
    }

    if (argc > 2) {
	ptr = MesgParse(argv[2], buf2);
	CHECKRETURN(ptr,"COMMAS","arg 3");
	v = new_mvar(ptr, tmp);
	if (v == 1)
	    ABORT_MPI("COMMAS","Variable name too long");
	if (v == 2)
	    ABORT_MPI("COMMAS","Too many variables already defined");
    }

    *buf = '\0';
    for (i = 1; i <= count; i++) {
	ptr = getlitem(buf2, argv[0], "\r", i);
	if (argc > 2) {
	    strcpy(tmp, ptr);
	    ptr = MesgParse(argv[3], buf2);
	    CHECKRETURN(ptr,"COMMAS","arg 3");
	}
	strcat(buf, ptr);
	switch (count - i) {
	  case 0:
	    if (argc > 2) free_top_mvar();
	    return buf;
	    break;
	  case 1:
	    strcat(buf, argv[1]);
	    break;
	  default:
	    strcat(buf, ", ");
	    break;
	}
    }
    if (argc > 2) free_top_mvar();
    return buf;
}
开发者ID:GlowMUCK,项目名称:GlowMUCK,代码行数:58,代码来源:mfuns2.c


示例20: mfn_flags

const char *
mfn_flags(MFUNARGS)
{
	dbref obj = mesg_dbref_local(descr, player, what, perms, argv[0], mesgtyp);

	if (obj == UNKNOWN || obj == AMBIGUOUS || obj == NOTHING || obj == HOME)
		ABORT_MPI("FLAGS", "Match failed.");
	if (obj == PERMDENIED)
		ABORT_MPI("FLAGS", "Permission denied.");
	return unparse_flags(obj);
}
开发者ID:rhencke,项目名称:fuzzball,代码行数:11,代码来源:mfuns.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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