2006-09-18 15:43:50 -05:00
|
|
|
/*
|
|
|
|
* BinReloc - a library for creating relocatable executables
|
|
|
|
* Written by: Hongli Lai <h.lai@chello.nl>
|
|
|
|
* http://autopackage.org/
|
|
|
|
*
|
|
|
|
* This source code is public domain. You can relicense this code
|
|
|
|
* under whatever license you want.
|
|
|
|
*
|
|
|
|
* See http://autopackage.org/docs/binreloc/ for
|
|
|
|
* more information and how to use this.
|
|
|
|
*/
|
2015-09-29 14:08:48 -05:00
|
|
|
/********************************************************************\
|
|
|
|
* This program is free software; you can redistribute it and/or *
|
|
|
|
* modify it under the terms of the GNU General Public License as *
|
|
|
|
* published by the Free Software Foundation; either version 2 of *
|
|
|
|
* the License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License*
|
|
|
|
* along with this program; if not, contact: *
|
|
|
|
* *
|
|
|
|
* Free Software Foundation Voice: +1-617-542-5942 *
|
|
|
|
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
|
|
|
|
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
|
|
|
* *
|
|
|
|
\********************************************************************/
|
|
|
|
|
2006-09-18 15:43:50 -05:00
|
|
|
|
|
|
|
#ifndef __BINRELOC_H__
|
|
|
|
#define __BINRELOC_H__
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
2010-03-27 17:08:17 -05:00
|
|
|
/** These error codes can be returned by gnc_gbr_init(). */
|
2010-02-17 23:31:54 -06:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
/** Cannot allocate memory. */
|
2010-03-20 19:40:24 -05:00
|
|
|
GNC_GBR_INIT_ERROR_NOMEM,
|
2010-02-17 23:31:54 -06:00
|
|
|
/** Unable to open /proc/self/maps; see errno for details. */
|
2010-03-20 19:40:24 -05:00
|
|
|
GNC_GBR_INIT_ERROR_OPEN_MAPS,
|
2010-02-17 23:31:54 -06:00
|
|
|
/** Unable to read from /proc/self/maps; see errno for details. */
|
2010-03-20 19:40:24 -05:00
|
|
|
GNC_GBR_INIT_ERROR_READ_MAPS,
|
2010-02-17 23:31:54 -06:00
|
|
|
/** The file format of /proc/self/maps is invalid; kernel bug? */
|
2010-03-20 19:40:24 -05:00
|
|
|
GNC_GBR_INIT_ERROR_INVALID_MAPS,
|
2010-02-17 23:31:54 -06:00
|
|
|
/** BinReloc determined that gnucash is not running from a bundle */
|
2010-03-20 19:40:24 -05:00
|
|
|
GNC_GBR_INIT_ERROR_MAC_NOT_BUNDLE,
|
2010-02-17 23:31:54 -06:00
|
|
|
/** Binreloc determined that the bundle is not an app bundle */
|
2010-03-20 19:40:24 -05:00
|
|
|
GNC_GBR_INIT_ERROR_MAC_NOT_APP_BUNDLE,
|
2010-02-17 23:31:54 -06:00
|
|
|
/** BinReloc is disabled (the ENABLE_BINRELOC macro is not defined). */
|
2010-03-20 19:40:24 -05:00
|
|
|
GNC_GBR_INIT_ERROR_DISABLED
|
|
|
|
} Gnc_GbrInitError;
|
2006-09-18 15:43:50 -05:00
|
|
|
|
|
|
|
|
2010-03-20 19:40:24 -05:00
|
|
|
gboolean gnc_gbr_init (GError **error);
|
2006-09-18 15:43:50 -05:00
|
|
|
|
2010-03-20 19:40:24 -05:00
|
|
|
gchar *gnc_gbr_find_exe (const gchar *default_exe);
|
|
|
|
gchar *gnc_gbr_find_exe_dir (const gchar *default_dir);
|
|
|
|
gchar *gnc_gbr_find_prefix (const gchar *default_prefix);
|
|
|
|
gchar *gnc_gbr_find_bin_dir (const gchar *default_bin_dir);
|
|
|
|
gchar *gnc_gbr_find_sbin_dir (const gchar *default_sbin_dir);
|
|
|
|
gchar *gnc_gbr_find_data_dir (const gchar *default_data_dir);
|
|
|
|
gchar *gnc_gbr_find_lib_dir (const gchar *default_lib_dir);
|
|
|
|
gchar *gnc_gbr_find_libexec_dir (const gchar *default_libexec_dir);
|
|
|
|
gchar *gnc_gbr_find_etc_dir (const gchar *default_etc_dir);
|
2006-09-18 15:43:50 -05:00
|
|
|
|
2010-03-27 17:08:17 -05:00
|
|
|
/** Sets the executable path to the given value. This is useful if the
|
|
|
|
* binreloc lookup code will not be used, but instead the executable
|
|
|
|
* location is obtained from somewhere else (e.g. qt) but the gnucash
|
|
|
|
* code should nevertheless use this path internally. */
|
|
|
|
void gnc_gbr_set_exe (const gchar* default_exe);
|
|
|
|
|
2006-09-18 15:43:50 -05:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __BINRELOC_H__ */
|