Beispiel #1
0
/** Initialize transfer list structures.
 *
 * @param[in] instance Memory place to use.
 * @param[in] name Name of the new list.
 * @return Error code
 *
 * Allocates memory for internal ed_t structure.
 */
int endpoint_list_init(endpoint_list_t *instance, const char *name)
{
	assert(instance);
	instance->name = name;
	instance->list_head = malloc32(sizeof(ed_t));
	if (!instance->list_head) {
		usb_log_error("Failed to allocate list head.\n");
		return ENOMEM;
	}
	instance->list_head_pa = addr_to_phys(instance->list_head);
	usb_log_debug2("Transfer list %s setup with ED: %p(0x%0" PRIx32 ")).\n",
	    name, instance->list_head, instance->list_head_pa);

	ed_init(instance->list_head, NULL, NULL);
	list_initialize(&instance->endpoint_list);
	fibril_mutex_initialize(&instance->guard);
	return EOK;
}
int main() {
	int x;

	tm_init();
	ed_init();
	void **params1;
	params1 = (void **) malloc(sizeof(int));
	params1[0] = (void *) 27;
	void **params2;
	params2 = (void **) malloc(sizeof(int));
	params2[0] = (void *) 99;
	event_dispatch(GUI_MAKE_CALL, params1, NULL);
	event_dispatch(GUI_MAKE_CALL, params2, NULL);
	scanf("%d", &x);
	ed_destroy();
	tm_destroy(0);
	free(params1);
	free(params2);
	pthread_exit(NULL);

}
Beispiel #3
0
Bool32 ed_cstr_string(CSTR_line ln)
{
CSTR_rast       eng, enge;
uchar           elen,ewrd[MAX_LEN_WORD+40];

eng = CSTR_GetFirstRaster(ln);
while(1)
    {
    eng = ed_next_word(eng);
    if( !eng )
        break;
    enge = ed_end_word(eng,ewrd,&elen);
    ed_init();
    ed_make_word(eng,enge);
    ed_save();
    // ed spell
    // ed conv ed back to CSTR
    break; // debug
    }
return  TRUE;
}
Beispiel #4
0
Datei: host.c Projekt: erukiti/ma
void	sys_init()
{
	char	*p,buf[LN_buf+1];
	char	t;
	time_t	e,s;

	ch.frug.called=0;
	ch.frug.monitor=1;
	ch.frug.esc=0;
	ch.fp=NULL;
	sys.rs=FALSE;
/*	ch.env=NULL;*/

/*	debug_start();*/
	ed_init();
	sion_init();
	nowvar=varinit(LN_str,MAX_var);
	sys.var=varinit(LN_str,MAX_var);
	sys.result=varinit(LN_result,MAX_var);

	strcpy(sys.home,".");
	op_system();
	if (sion_sr("config","system")==0)
		{
		 exit(1);
		}
	sion_read(sys.var);
	sion_sr("config","result");
	sion_read(sys.result);

	sion_close();

	sys.execute=atoi(getvar("execute",sys.var))+1;
	sys.logon  =atoi(getvar("logon",sys.var));
	sys.post   =atoi(getvar("post",sys.var));

	sys.t_logon=atoi(getvar("tdlogon",sys.var));
	sys.t_post =atoi(getvar("tdpost",sys.var));

	strjncpy(sys.netname,getvar("netname",sys.var),LN_title);
	strjncpy(sys.netid,getvar("netid",sys.var),LN_netid);
	strjncpy(sys.home ,getvar("home",sys.var),LN_dirs);
	strjncpy(sys.temp ,getvar("temp",sys.var),LN_dirs);
	pool.max=atoi(getvar("poolmax",sys.var));

	copyright();

	p=getvar("opentime",sys.var);
	tzset();	/* 時空関数がまだ現れていないので呼ぶ必要あり */

	if (p==NULL)
		{
		 sys.opentime=DT_daytime;
		 sys.starttime=0;
		}else
		{
		 p=pull(buf,p);
		 t=atoi(buf);
		 p=pull(buf,p);
		 s=(t*60+atoi(buf))*60;
		 p=pull(buf,p);
		 t=atoi(buf);
		 p=pull(buf,p);
		 e=(t*60+atoi(buf))*60;
/*dbprintf("s:%ld,e:%ld",s,e);*/
		 sys.opentime=e+(e<s?DT_daytime:0)-s;
		 sys.starttime=DT_daytime-s;
/*dbprintf("o:%ld,s:%ld",sys.opentime,sys.starttime);*/
		}

	stack_init();
	where_init();
	user_init();
	art_init();
	pool_init();

	sys.rs=rs_init();
/*	sys_log("●システム起動");*/
}