Example #1
0
/** Initialize the BinReloc library (for libraries).
 *
 * This function must be called before using any other BinReloc functions.
 * It attempts to locate the calling library's canonical filename.
 *
 * @note The BinReloc source code MUST be included in your library, or this
 *       function won't work correctly.
 *
 * @returns TRUE on success, FALSE if a filename cannot be found.
 */
gboolean gbr_init_lib(GError ** error)
{
    GbrInitError errcode = 0;

    exe = _br_find_exe_for_symbol((const void *) "", &errcode);
    if (exe != NULL)
	/* Success! */
	return TRUE;
    else {
	/* Failed :-( */
	set_gerror(error, errcode);
	return exe != NULL;
    }
}
Example #2
0
/* Initialize the BinReloc library (for libraries).
 *
 * This function must be called before using any other BinReloc functions.
 * It attempts to locate the calling library's canonical filename.
 *
 * @note The BinReloc source code MUST be included in your library, or this
 *       function won't work correctly.
 * @note Initialization failure is not fatal. BinReloc functions will just
 *       fallback to the supplied default path.
 *
 * @returns TRUE on success, FALSE if a filename cannot be found.
 */
gboolean
_gimp_reloc_init_lib (GError **error)
{
        GimpBinrelocInitError errcode;

        /* Shut up compiler warning about uninitialized variable. */
        errcode = GIMP_RELOC_INIT_ERROR_NOMEM;

        exe = _br_find_exe_for_symbol ((const void *) "", &errcode);
        if (exe != NULL)
                /* Success! */
                return TRUE;
        else {
                /* Failed :-( */
                set_gerror (error, errcode);
                return exe != NULL;
        }
}
/** Initialize the BinReloc library (for libraries).
 *
 * This function must be called before using any other BinReloc functions.
 * It attempts to locate the calling library's canonical filename.
 *
 * @note The BinReloc source code MUST be included in your library, or this
 *       function won't work correctly.
 *
 * @param error  If BinReloc failed to initialize, then the error code will
 *               be stored in this variable. Set to NULL if you want to
 *               ignore this. See #BrInitError for a list of error codes.
 *
 * @returns 1 on success, 0 if a filename cannot be found.
 */
int
br_init_lib (BrInitError *error)
{
	exe = _br_find_exe_for_symbol ((const void *) "", error);
	return exe != NULL;
}