예제 #1
0
파일: std.c 프로젝트: Shea690901/gurbalib
/*
 * NAME:	kfun->compile_object()
 * DESCRIPTION:	compile an object
 */
int kf_compile_object(frame *f, int nargs)
{
    char file[STRINGSZ];
    value *v;
    object *obj;
    string **strs;
    int i;

    v = &f->sp[nargs - 1];
    if (path_string(file, v->u.string->text, v->u.string->len) == (char *) NULL)
    {
	return 1;
    }
    obj = o_find(file, OACC_MODIFY);
    if (obj != (object *) NULL) {
	if (!(obj->flags & O_MASTER)) {
	    error("Cannot recompile cloned object");
	}
	if (O_UPGRADING(obj)) {
	    error("Object is already being upgraded");
	}
	if (O_INHERITED(obj)) {
	    error("Cannot recompile inherited object");
	}
    }
    if (--nargs != 0) {
	strs = ALLOCA(string*, nargs);
	for (i = nargs, v = f->sp; i > 0; --i) {
	    *strs++ = (v++)->u.string;
	}
	if (ec_push((ec_ftn) NULL)) {
	    AFREE(strs - nargs);
	    error((char *) NULL);
	}
    } else {
예제 #2
0
파일: std.c 프로젝트: Shea690901/gurbalib
/*
 * NAME:	kfun->old_compile_object()
 * DESCRIPTION:	compile an object
 */
int kf_old_compile_object(frame *f)
{
    char file[STRINGSZ];
    object *obj;

    if (path_string(file, f->sp->u.string->text,
		    f->sp->u.string->len) == (char *) NULL) {
	return 1;
    }
    obj = o_find(file, OACC_MODIFY);
    if (obj != (object *) NULL) {
	if (!(obj->flags & O_MASTER)) {
	    error("Cannot recompile cloned object");
	}
	if (O_UPGRADING(obj)) {
	    error("Object is already being upgraded");
	}
	if (O_INHERITED(obj)) {
	    error("Cannot recompile inherited object");
	}
    }
    obj = c_compile(f, file, obj, (string **) NULL, 0,
		    (OBJR(f->oindex)->flags & O_DRIVER) &&
		    strcmp(d_get_strconst(f->p_ctrl, f->func->inherit,
					  f->func->index)->text,
			   "inherit_program") == 0);
    str_del(f->sp->u.string);
    PUT_OBJVAL(f->sp, obj);

    return 0;
}
예제 #3
0
파일: std.cpp 프로젝트: RetroMud/dgd
/*
 * NAME:	kfun->compile_object()
 * DESCRIPTION:	compile an object
 */
int kf_compile_object(Frame *f, int nargs, kfunc *kf)
{
    char file[STRINGSZ];
    Value *v;
    Object *obj;
    String **strs;
    int i;
    bool iflag;

    UNREFERENCED_PARAMETER(kf);

    v = &f->sp[nargs - 1];
    if (path_string(file, v->u.string->text, v->u.string->len) == (char *) NULL)
    {
	return 1;
    }
    obj = o_find(file, OACC_MODIFY);
    if (obj != (Object *) NULL) {
	if (!(obj->flags & O_MASTER)) {
	    error("Cannot recompile cloned object");
	}
	if (O_UPGRADING(obj)) {
	    error("Object is already being upgraded");
	}
	if (O_INHERITED(obj)) {
	    error("Cannot recompile inherited object");
	}
    }
    if (--nargs != 0) {
	strs = ALLOCA(String*, nargs);
	for (i = nargs, v = f->sp; i > 0; --i) {
	    *strs++ = (v++)->u.string;
	}
    } else {
예제 #4
0
파일: options.c 프로젝트: jackdoe/dhcpd
u64 o_find_u64(u8 option_code,u8 *s,int avail) {
	struct tlv t;
	o_find(option_code,8,s,avail,&t);
	return *(u64 *)t.value;
}
예제 #5
0
파일: options.c 프로젝트: jackdoe/dhcpd
u32 o_find_u32(u8 option_code,u8 *s,int avail) {
	struct tlv t;
	o_find(option_code,4,s,avail,&t);
	return *(u32 *)t.value;
}
예제 #6
0
파일: options.c 프로젝트: jackdoe/dhcpd
u16 o_find_u16(u8 option_code,u8 *s,int avail) {
	struct tlv t;
	o_find(option_code,2,s,avail,&t);
	return *(u16 *)t.value;
}
예제 #7
0
파일: options.c 프로젝트: jackdoe/dhcpd
u8 o_find_u8(u8 option_code,u8 *s,int avail) {
	struct tlv t;
	o_find(option_code,1,s,avail,&t);
	return *(u8 *)t.value;
}