Exemplo n.º 1
0
void env_universal_init(wchar_t * p,
                        wchar_t *u,
                        void (*sf)(),
                        void (*cb)(fish_message_type_t type, const wchar_t *name, const wchar_t *val))
{
    if (! synchronizes_via_fishd())
    {
        external_callback = cb;
        env_universal_common_init(&callback);
        s_env_univeral_inited = true;
    }
    else
    {
        path=p;
        user=u;
        start_fishd=sf;
        external_callback = cb;

        env_universal_server.fd = get_socket();
        env_universal_common_init(&callback);
        env_universal_read_all();
        s_env_univeral_inited = true;
        if (env_universal_server.fd >= 0)
        {
            env_universal_barrier();
        }
    }
}
Exemplo n.º 2
0
/**
   Do all sorts of boring initialization.
*/
static void init()
{

	sock = get_socket();
	daemonize();	
	env_universal_common_init( &broadcast );
	
	load();	
}
Exemplo n.º 3
0
void env_universal_init( wchar_t * p, 
						 wchar_t *u, 
						 void (*sf)(),
						 void (*cb)( int type, const wchar_t *name, const wchar_t *val ))
{
	path=p;
	user=u;
	start_fishd=sf;	
	external_callback = cb;

	connection_init( &env_universal_server, -1 );
	
	env_universal_server.fd = get_socket(1);
	env_universal_common_init( &callback );
	env_universal_read_all();	
	init = 1;	
	if( env_universal_server.fd >= 0 )
	{
		env_universal_barrier();
	}
}