/** 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; } }
/** Initialize the BinReloc library (for applications). * * This function must be called before using any other BinReloc functions. * It attempts to locate the application's canonical filename. * * @note If you want to use BinReloc for a library, then you should call * gbr_init_lib() instead. * * @param error If BinReloc failed to initialize, then the error report will * be stored in this variable. Set to NULL if you don't want an * error report. See the #GbrInitError for a list of error * codes. * * @returns TRUE on success, FALSE if BinReloc failed to initialize. */ gboolean gbr_init(GError ** error) { GbrInitError errcode = 0; /* Locate the application's filename. */ exe = _br_find_exe(&errcode); if (exe != NULL) /* Success! */ return TRUE; else { /* Failed :-( */ set_gerror(error, errcode); return FALSE; } }
/* 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 applications). * * This function must be called before using any other BinReloc functions. * It attempts to locate the application's canonical filename. * * @note If you want to use BinReloc for a library, then you should call * _gimp_reloc_init_lib() instead. * @note Initialization failure is not fatal. BinReloc functions will just * fallback to the supplied default path. * * @param error If BinReloc failed to initialize, then the error report will * be stored in this variable. Set to NULL if you don't want an * error report. See the #GimpBinrelocInitError for a list of error * codes. * * @returns TRUE on success, FALSE if BinReloc failed to initialize. */ gboolean _gimp_reloc_init (GError **error) { GimpBinrelocInitError errcode; /* Shut up compiler warning about uninitialized variable. */ errcode = GIMP_RELOC_INIT_ERROR_NOMEM; /* Locate the application's filename. */ exe = _br_find_exe (&errcode); if (exe != NULL) /* Success! */ return TRUE; else { /* Failed :-( */ set_gerror (error, errcode); return FALSE; } }