vncserver.c
static int
load_functions(void) {
    char *loader = NULL;
    void *shlib;

    if (check_sharedlibs(LIBVNCSERVER) == 0) {
        loader = strdup(LIBVNCSERVER);
        if (loader == NULL)
            errx(EX_SOFTWARE, "not possible to load %s", LIBVNCSERVER);

        shlib = dlopen(loader, RTLD_NOW | RTLD_GLOBAL);
        if (!shlib) {
            goto free_lib;
        }

        get_screen = dlsym(shlib, "rfbGetScreen");
        start_vnc_server = dlsym(shlib, "rfbInitServerWithPthreadsAndZRLE");
        run_event_loop = dlsym(shlib, "rfbRunEventLoop");
        mark_rect_asmodified = dlsym(shlib, "rfbMarkRectAsModified");
        vnc_password_check = dlsym(shlib, "rfbCheckPasswordByList");

        if(!start_vnc_server) {
            WPRINTF(("[hyverem]: Failed to load rfbInitServerWithPthreadsAndZRLE\n"));
            goto free_lib;
        } else if (!run_event_loop) {
            WPRINTF(("[hyverem]: Failed to load rfbRunEventLoop\n"));
            goto free_lib;
        } else if (!mark_rect_asmodified) {
            WPRINTF(("[hyverem]: Failed to load rfbMarkRectAsModified\n"));
            goto free_lib;
        } else if (!vnc_password_check) {
            WPRINTF(("[hyverem]: Failed to load rfbCheckPasswordByList\n"));
            goto free_lib;
        }
        return (0);
    }
    return (1);
free_lib:
    dlclose(loader);
    free(loader);
    return (1);
}
/*
 * Load from LIBVNCSERVER shared library the functions that are necessary
 * to provide a minimum functionality for this library.
 */
Load from LIBVNCSERVER shared library the functions that are necessary
to provide a minimum functionality for this library.
Load from LIBVNCSERVER shared library the functions that are necessary to provide a minimum functionality for this library .
static int
load_functions(void) {
    char *loader = NULL;
    void *shlib;
    if (check_sharedlibs(LIBVNCSERVER) == 0) {
        loader = strdup(LIBVNCSERVER);
        if (loader == NULL)
            errx(EX_SOFTWARE, "not possible to load %s", LIBVNCSERVER);
        shlib = dlopen(loader, RTLD_NOW | RTLD_GLOBAL);
        if (!shlib) {
            goto free_lib;
        }
        get_screen = dlsym(shlib, "rfbGetScreen");
        start_vnc_server = dlsym(shlib, "rfbInitServerWithPthreadsAndZRLE");
        run_event_loop = dlsym(shlib, "rfbRunEventLoop");
        mark_rect_asmodified = dlsym(shlib, "rfbMarkRectAsModified");
        vnc_password_check = dlsym(shlib, "rfbCheckPasswordByList");
        if(!start_vnc_server) {
            WPRINTF(("[hyverem]: Failed to load rfbInitServerWithPthreadsAndZRLE\n"));
            goto free_lib;
        } else if (!run_event_loop) {
            WPRINTF(("[hyverem]: Failed to load rfbRunEventLoop\n"));
            goto free_lib;
        } else if (!mark_rect_asmodified) {
            WPRINTF(("[hyverem]: Failed to load rfbMarkRectAsModified\n"));
            goto free_lib;
        } else if (!vnc_password_check) {
            WPRINTF(("[hyverem]: Failed to load rfbCheckPasswordByList\n"));
            goto free_lib;
        }
        return (0);
    }
    return (1);
free_lib:
    dlclose(loader);
    free(loader);
    return (1);
}
static int load_functions ( void ) { char * loader = NULL ; void * shlib ; if ( check_sharedlibs ( LIBVNCSERVER ) == 0 ) { loader = strdup ( LIBVNCSERVER ) ; if ( loader == NULL ) errx ( EX_SOFTWARE , " " , LIBVNCSERVER ) ; shlib = dlopen ( loader , RTLD_NOW | RTLD_GLOBAL ) ; if ( ! shlib ) { goto free_lib ; } get_screen = dlsym ( shlib , " " ) ; start_vnc_server = dlsym ( shlib , " " ) ; run_event_loop = dlsym ( shlib , " " ) ; mark_rect_asmodified = dlsym ( shlib , " " ) ; vnc_password_check = dlsym ( shlib , " " ) ; if ( ! start_vnc_server ) { WPRINTF ( ( " \n " ) ) ; goto free_lib ; } else if ( ! run_event_loop ) { WPRINTF ( ( " \n " ) ) ; goto free_lib ; } else if ( ! mark_rect_asmodified ) { WPRINTF ( ( " \n " ) ) ; goto free_lib ; } else if ( ! vnc_password_check ) { WPRINTF ( ( " \n " ) ) ; goto free_lib ; } return ( 0 ) ; } return ( 1 ) ; free_lib : dlclose ( loader ) ; free ( loader ) ; return ( 1 ) ; }
Load from LIBVNCSERVER shared library the functions that are necessary
 to provide a minimum functionality for this library.
Load from LIBVNCSERVER shared library the functions that are necessary to provide a minimum functionality for this library .