Example #1
0
int
main ()
{
    int i;
    pthread_t * tid_srvs;
    names * nm;
    ircserver * srvs, * srv;

    nm = load_names ("configs.xml");
    srvs = load_servers ("configs.xml", nm);
    srv = srvs;
    
    load_lib ("/usr/lib/libbbot.so");
    load_module ("modules/pong.so");

    tid_srvs = (pthread_t *) alloca (servlen (srvs) * sizeof (pthread_t));
    for (i = 0; i < servlen (srvs); i++)
    {
        pthread_create (&tid_srvs[i], NULL, new_server, (void *) srv);
        srv = srv->next;
    }
    for (i = 0; i < servlen (srvs); i++)
        pthread_join (tid_srvs[i], NULL);

    return 0;
}
Example #2
0
	void algorithm_page_name::init()
	{
		config_ = new algorithm_config;
		loaded_ = false;

		load_names();
	}
Example #3
0
web_color web_color::from_string(const wchar_t* str)
{
    web_color result;

    if (str)
    {
        if (canParse(str))
        {
            result = parseRGB(str);
        }
        else
        {
            if (colorMap.empty())
            {
                load_names();
            }

            auto found = colorMap.find(str);

            if (found != colorMap.end())
            {
                result = found->second;
            }
        }
    }

    return result;
}
Example #4
0
bool web_color::is_color(const wchar_t* str)
{
    if (canParse(str))
    {
        return true;
    }
    
    if (colorMap.empty())
    {
        load_names();
    }

    return colorMap.find(str) != colorMap.end();
}