Exemplo n.º 1
0
static void *
fetch_symbol (XModuleType module, const char *under_symbol)
{
    void *result = NULL;
    const char *symbol = under_symbol + 1;
#if defined(hpux)
    int getsyms_cnt, i;
    struct shl_symbol *symbols;

    getsyms_cnt = shl_getsymbols(module, TYPE_PROCEDURE,
				 EXPORT_SYMBOLS, malloc, &symbols);

    for(i=0; i<getsyms_cnt; i++) {
        if(!strcmp(symbols[i].name, symbol)) {
	    result = symbols[i].value;
	    break;
         }
    }

    if(getsyms_cnt > 0) {
        free(symbols);
    }
#else
    result = dlsym (module, symbol);
    if (!result)
	result = dlsym (module, under_symbol);
#endif
    return result;
}
Exemplo n.º 2
0
Arquivo: XlcDL.c Projeto: iquiw/xsrc
static void *
fetch_symbol(
    XI18NObjectsList object,
    char *symbol)
{
    void *result = NULL;
#if defined(hpux)
    int getsyms_cnt, i;
    struct shl_symbol *symbols;
#endif

    if (symbol == NULL)
        return NULL;

#if defined(hpux)
    getsyms_cnt = shl_getsymbols(object->dl_module, TYPE_PROCEDURE,
                                 EXPORT_SYMBOLS, malloc, &symbols);

    for(i=0; i<getsyms_cnt; i++) {
        if(!strcmp(symbols[i].name, symbol)) {
            result = symbols[i].value;
            break;
        }
    }

    if(getsyms_cnt > 0) {
        free(symbols);
    }
#else
    result = try_both_dlsym(object->dl_module, symbol);
#endif

    return result;
}