src/libmetha/worker.c
static M_CODE
lm_worker_call_crawler_init(worker_t *w)
{
    int x;

    if (w->crawler->init) {
        const char *init_name = w->crawler->init;
#ifdef DEBUG
        fprintf(stderr, "* worker:(%p) calling init function \"%s\"\n",
                w,
                w->crawler->init);
#endif

        if ((init_name = strchr(init_name, '/'))) {
            /* TODO: here we used to call javascript init functions, call module init functions? */
            init_name++;
        } else {
            LM_ERROR(w->m, "init function for crawler \"%s\" is not a javascript function\n",
                            w->crawler->name);
        }
    }

    __lm_worker_default_crawler_init(w->ue_h, w->argc, w->argv);
    return M_OK;
}
/** 
 * Call the initial crawlers init function
 **/
Call the initial crawlers init function
Call the initial crawlers init function
static M_CODE
lm_worker_call_crawler_init(worker_t *w)
{
    int x;
    if (w->crawler->init) {
        const char *init_name = w->crawler->init;
#ifdef DEBUG
        fprintf(stderr, "* worker:(%p) calling init function \"%s\"\n",
                w,
                w->crawler->init);
#endif
        if ((init_name = strchr(init_name, '/'))) {
            init_name++;
        } else {
            LM_ERROR(w->m, "init function for crawler \"%s\" is not a javascript function\n",
                            w->crawler->name);
        }
    }
    __lm_worker_default_crawler_init(w->ue_h, w->argc, w->argv);
    return M_OK;
}
static M_CODE lm_worker_call_crawler_init ( worker_t * w ) { int x ; if ( w -> crawler -> init ) { const char * init_name = w -> crawler -> init ; #ifdef DEBUG fprintf ( stderr , " \" \" \n " , w , w -> crawler -> init ) ; #endif if ( ( init_name = strchr ( init_name , ' ' ) ) ) { init_name ++ ; } else { LM_ERROR ( w -> m , " \" \" \n " , w -> crawler -> name ) ; } } __lm_worker_default_crawler_init ( w -> ue_h , w -> argc , w -> argv ) ; return M_OK ; }
Call the initial crawlers init function
Call the initial crawlers init function
/* TODO: here we used to call javascript init functions, call module init functions? */