예제 #1
0
파일: fcode.c 프로젝트: andreiw/polaris
void
bquote(fcode_env_t *env)
{
	char stringbuff[256];
	int len, count;
	char *strptr;

	count = len = next_bytecode(env);
	if (env->state) {
		COMPILE_TOKEN(&quote_ptr);
		strptr = (char *)HERE;
		*strptr++ = len;
		while (count--)
			*strptr++ = next_bytecode(env);
		*strptr++ = 0;
		set_here(env, (uchar_t *)strptr, "bquote");
		token_roundup(env, "bquote");
	} else {
		strptr = stringbuff;
		while (count--)
			*strptr++ = next_bytecode(env);
		*strptr = 0;
		push_string(env, stringbuff, len);
	}
}
예제 #2
0
void
actions(fcode_env_t *env)
{
	int n;
	token_t *d;

	token_roundup(env, "actions");
	d = (token_t *)HERE;
	*d++ = (token_t)&do_default_action;
	n = (int)POP(DS);
	*d++ = n;
	env->num_actions = n;
	env->action_count = 0;
	env->action_ptr = d;
	d += n;
	set_here(env, (uchar_t *)d, "actions");
}
예제 #3
0
void
do_buffer_data(fcode_env_t *env, token_t *d, int instance)
{
	if (!*d) {	/* check if buffer not alloc'ed yet */
		token_t *buf;

		if (instance) {
			int n, off;

			n = TOKEN_ROUNDUP(d[1]);
			buf = alloc_instance_data(env, UINIT_DATA, n, &off);
			memset(buf, 0, d[1]);
		} else {
			buf = (token_t *)HERE;
			set_here(env, HERE + d[1], "do_buffer_data");
		}
		*d = (token_t)buf;
	}
	PUSH(DS, *d);
}
예제 #4
0
파일: fcode.c 프로젝트: andreiw/polaris
void
header(fcode_env_t *env, char *name, int len, flag_t flag)
{
	char *strptr;
	flag_t *fptr;
	acf_t dptr;
	extern void add_debug_acf(fcode_env_t *, acf_t);

	/* Now form the entry in the dictionary */
	token_roundup(env, "header");
	dptr = (acf_t)HERE;
	if (len) {
		int bytes = len+2+sizeof (flag_t);
		dptr = (acf_t)(TOKEN_ROUNDUP(HERE+bytes));
		fptr = LINK_TO_FLAGS(dptr);
		strptr = (char *)fptr - 1;
		*strptr-- = len;
		*strptr-- = 0;
		while (len)
			*strptr-- = name[--len];
	} else {
		dptr++;
		fptr = LINK_TO_FLAGS(dptr);
		flag |= FLAG_NONAME;
	}
	*fptr = flag;
	*dptr = *((acf_t)env->current);
	env->lastlink = dptr++;
	set_here(env, (uchar_t *)dptr, "header");

	if (name_is_debugged(env, name)) {
		log_message(MSG_INFO, "Turning debug on for %s\n", name);
		add_debug_acf(env, LINK_TO_ACF(env->lastlink));
	}
	debug_msg(DEBUG_HEADER, "Define: '%s' @ %p\n", name, HERE);
}