pike.git / src / module.c

version» Context lines:

pike.git/src/module.c:37:      /* Define this to trace the initialization and cleanup of static modules. */   /* #define TRACE_MODULE */      #ifdef PIKE_EXTRA_DEBUG   #define TRACE_MAIN   #define TRACE_MODULE   #endif      #if defined(TRACE_MAIN) || defined(TRACE_MODULE) - #define TRACE(X) fprintf X + #define TRACE(...) fprintf(stderr, __VA_ARGS__)   #else /* !TRACE_MAIN */ - #define TRACE(X) + #define TRACE(...)   #endif /* TRACE_MAIN */      static void init_builtin_modules(void)   {    void init_iterators(void);      #ifdef DEBUG_MALLOC    /* Make some statically allocated structs known to dmalloc. These    * will still show up in the DO_PIKE_CLEANUP leak report if they    * leak, in spite of dmalloc_accept_leak. */    dmalloc_register (&empty_array, sizeof (empty_array),    DMALLOC_LOCATION());    dmalloc_accept_leak (&empty_array);    dmalloc_register (&weak_empty_array, sizeof (weak_empty_array),    DMALLOC_LOCATION());    dmalloc_accept_leak (&weak_empty_array);   #endif    -  TRACE((stderr, "Init cpp...\n")); +  TRACE("Init cpp...\n");    init_cpp();    -  TRACE((stderr, "Init memory counter...\n")); +  TRACE("Init memory counter...\n");    init_mc();    -  TRACE((stderr, "Init backend...\n")); +  TRACE("Init backend...\n");    init_backend();    -  TRACE((stderr, "Init iterators...\n")); +  TRACE("Init iterators...\n");    init_iterators();    -  TRACE((stderr, "Init searching...\n")); +  TRACE("Init searching...\n");    init_pike_searching();    -  TRACE((stderr, "Init error handling...\n")); +  TRACE("Init error handling...\n");    init_error();    -  TRACE((stderr, "Init threads...\n")); +  TRACE("Init threads...\n");    th_init();    -  TRACE((stderr, "Init operators...\n")); +  TRACE("Init operators...\n");    init_operators();    -  TRACE((stderr, "Init builtin...\n")); +  TRACE("Init builtin...\n");    init_builtin();    -  TRACE((stderr, "Init efuns...\n")); +  TRACE("Init efuns...\n");    init_builtin_efuns();    -  TRACE((stderr, "Init signal handling...\n")); +  TRACE("Init signal handling...\n");    init_signals();    -  TRACE((stderr, "Init dynamic loading...\n")); +  TRACE("Init dynamic loading...\n");    init_dynamic_load();    -  TRACE((stderr, "Init sprintf...\n")); +  TRACE("Init sprintf...\n");    init_sprintf();   }      static void exit_builtin_modules(void)   {   #ifdef DO_PIKE_CLEANUP    void exit_iterators(void);       /* Clear various global references. */   
pike.git/src/module.c:370:      /* The follwing are used to simulate dlopen() et al. */      const struct static_module *find_semidynamic_module(const char *name, int namelen)   {    unsigned int e;    for(e=0;e<NELEM(module_list);e++) {    if (module_list[e].semidynamic &&    !strncmp(module_list[e].name, name, namelen) &&    !module_list[e].name[namelen]) { -  TRACE((stderr, "Found semidynamic module #%d: \"%s\"...\n", -  e, module_list[e].name)); +  TRACE("Found semidynamic module #%d: \"%s\"...\n", +  e, module_list[e].name);    return module_list+e;    }    }    return NULL;   }      void *get_semidynamic_init_fun(const struct static_module *sm)   {    if (!sm) return NULL;    return sm->init;
pike.git/src/module.c:434:    start_new_program();    p = Pike_compiler->new_program;    }    if (module_list[e].semidynamic) continue;    if(SETJMP(recovery)) {    /* FIXME: We could loop here until we find p. */    free_program(end_program());    p = NULL;    call_handle_error();    } else { -  TRACE((stderr, "Initializing static module #%d: \"%s\"...\n", -  e, module_list[e].name)); +  TRACE("Initializing static module #%d: \"%s\"...\n", +  e, module_list[e].name);    module_list[e].init();    if (   #if 0    Pike_compiler->new_program->num_identifier_references   #else /* !0 */    1   #endif /* 0 */    ) {    debug_end_class(module_list[e].name,strlen(module_list[e].name),0);    p = NULL;
pike.git/src/module.c:515: Inside #if defined(DO_PIKE_CLEANUP)
   /* Unload dynamic modules before static ones. */    exit_dynamic_load();   #endif /* DO_PIKE_CLEANUP */       for(e=NELEM(module_list)-1;e>=0;e--)    {    if (module_list[e].semidynamic) continue;    if(SETJMP(recovery))    call_handle_error();    else { -  TRACE((stderr, "Exiting static module #%d: \"%s\"...\n", -  e, module_list[e].name)); +  TRACE("Exiting static module #%d: \"%s\"...\n", +  e, module_list[e].name);    module_list[e].exit();    }    UNSETJMP(recovery);    }   }