libgimpbase/Makefile.am libgimpbase/libgimpbase-docs.sgml do not generate
2005-12-14 Sven Neumann <sven@gimp.org> * libgimpbase/Makefile.am * libgimpbase/libgimpbase-docs.sgml * libgimpbase/libgimpbase-sections.txt: do not generate API docs for the private wire protocol API. * libgimp/libgimp-sections.txt: added new path API. * libgimpbase/tmpl/gimpprotocol.sgml * libgimpbase/tmpl/gimpwire.sgml: removed from CVS. * libgimp/tmpl/gimppaths.sgml * libgimpbase/tmpl/gimpenv.sgml: regenerated.
This commit is contained in:

committed by
Sven Neumann

parent
4ec5642b50
commit
493cd140f8
@ -5,6 +5,11 @@
|
|||||||
|
|
||||||
* libgimp/gimp.c (gimp_destroy_params): removed extern declaration.
|
* libgimp/gimp.c (gimp_destroy_params): removed extern declaration.
|
||||||
|
|
||||||
|
* libgimpbase/gimpenv.h: changed parameter name to match what's
|
||||||
|
used in gimpenv.c.
|
||||||
|
|
||||||
|
* libgimpbase/gimpreloc.c: changed comments to please gtk-doc.
|
||||||
|
|
||||||
2005-12-13 Sven Neumann <sven@gimp.org>
|
2005-12-13 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* libgimpbase/gimpwire.[ch]: let the private wire methods live in
|
* libgimpbase/gimpwire.[ch]: let the private wire methods live in
|
||||||
|
@ -1,3 +1,18 @@
|
|||||||
|
2005-12-14 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* libgimpbase/Makefile.am
|
||||||
|
* libgimpbase/libgimpbase-docs.sgml
|
||||||
|
* libgimpbase/libgimpbase-sections.txt: do not generate API docs
|
||||||
|
for the private wire protocol API.
|
||||||
|
|
||||||
|
* libgimp/libgimp-sections.txt: added new path API.
|
||||||
|
|
||||||
|
* libgimpbase/tmpl/gimpprotocol.sgml
|
||||||
|
* libgimpbase/tmpl/gimpwire.sgml: removed from CVS.
|
||||||
|
|
||||||
|
* libgimp/tmpl/gimppaths.sgml
|
||||||
|
* libgimpbase/tmpl/gimpenv.sgml: regenerated.
|
||||||
|
|
||||||
2005-11-06 Sven Neumann <sven@gimp.org>
|
2005-11-06 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* devel-docs/libgimpbase/Makefile.am: ignore gimpreloc.h.
|
* devel-docs/libgimpbase/Makefile.am: ignore gimpreloc.h.
|
||||||
|
@ -659,6 +659,8 @@ gimp_get_path_by_tattoo
|
|||||||
gimp_path_delete
|
gimp_path_delete
|
||||||
gimp_path_get_locked
|
gimp_path_get_locked
|
||||||
gimp_path_set_locked
|
gimp_path_set_locked
|
||||||
|
gimp_path_get_visible
|
||||||
|
gimp_path_set_visible
|
||||||
gimp_path_set_tattoo
|
gimp_path_set_tattoo
|
||||||
gimp_path_to_selection
|
gimp_path_to_selection
|
||||||
gimp_path_import
|
gimp_path_import
|
||||||
|
@ -144,6 +144,27 @@ Operations related to paths.
|
|||||||
@Returns:
|
@Returns:
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ##### FUNCTION gimp_path_get_visible ##### -->
|
||||||
|
<para>
|
||||||
|
|
||||||
|
</para>
|
||||||
|
|
||||||
|
@image_ID:
|
||||||
|
@name:
|
||||||
|
@Returns:
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ##### FUNCTION gimp_path_set_visible ##### -->
|
||||||
|
<para>
|
||||||
|
|
||||||
|
</para>
|
||||||
|
|
||||||
|
@image_ID:
|
||||||
|
@name:
|
||||||
|
@visible:
|
||||||
|
@Returns:
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gimp_path_set_tattoo ##### -->
|
<!-- ##### FUNCTION gimp_path_set_tattoo ##### -->
|
||||||
<para>
|
<para>
|
||||||
|
|
||||||
|
@ -29,7 +29,9 @@ CFILE_GLOB = $(DOC_SOURCE_DIR)/*.c
|
|||||||
IGNORE_HFILES = \
|
IGNORE_HFILES = \
|
||||||
gimpbase.h \
|
gimpbase.h \
|
||||||
gimpbase-private.h \
|
gimpbase-private.h \
|
||||||
|
gimpprotocol.h \
|
||||||
gimpreloc.h \
|
gimpreloc.h \
|
||||||
|
gimpwire.h \
|
||||||
gimpwin32-io.h
|
gimpwin32-io.h
|
||||||
|
|
||||||
# Images to copy into HTML directory
|
# Images to copy into HTML directory
|
||||||
|
@ -26,8 +26,6 @@
|
|||||||
<xi:include href="xml/gimpsignal.xml" />
|
<xi:include href="xml/gimpsignal.xml" />
|
||||||
<xi:include href="xml/gimpunit.xml" />
|
<xi:include href="xml/gimpunit.xml" />
|
||||||
<xi:include href="xml/gimputils.xml" />
|
<xi:include href="xml/gimputils.xml" />
|
||||||
<xi:include href="xml/gimpprotocol.xml" />
|
|
||||||
<xi:include href="xml/gimpwire.xml" />
|
|
||||||
</part>
|
</part>
|
||||||
|
|
||||||
<index>
|
<index>
|
||||||
|
@ -110,6 +110,7 @@ gimp_checks_get_shades
|
|||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gimpenv</FILE>
|
<FILE>gimpenv</FILE>
|
||||||
|
gimp_env_init
|
||||||
gimp_directory
|
gimp_directory
|
||||||
gimp_personal_rc_file
|
gimp_personal_rc_file
|
||||||
gimp_data_directory
|
gimp_data_directory
|
||||||
@ -180,35 +181,6 @@ gimp_pixpipe_params_parse
|
|||||||
gimp_pixpipe_params_build
|
gimp_pixpipe_params_build
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
|
||||||
<FILE>gimpprotocol</FILE>
|
|
||||||
GIMP_PROTOCOL_VERSION
|
|
||||||
GPConfig
|
|
||||||
GPTileReq
|
|
||||||
GPTileAck
|
|
||||||
GPTileData
|
|
||||||
GPParam
|
|
||||||
GPParamDef
|
|
||||||
GPProcRun
|
|
||||||
GPProcReturn
|
|
||||||
GPProcInstall
|
|
||||||
GPProcUninstall
|
|
||||||
gp_init
|
|
||||||
gp_has_init_write
|
|
||||||
gp_quit_write
|
|
||||||
gp_config_write
|
|
||||||
gp_tile_req_write
|
|
||||||
gp_tile_ack_write
|
|
||||||
gp_tile_data_write
|
|
||||||
gp_proc_run_write
|
|
||||||
gp_proc_return_write
|
|
||||||
gp_temp_proc_run_write
|
|
||||||
gp_temp_proc_return_write
|
|
||||||
gp_proc_install_write
|
|
||||||
gp_proc_uninstall_write
|
|
||||||
gp_extension_ack_write
|
|
||||||
</SECTION>
|
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gimpsignal</FILE>
|
<FILE>gimpsignal</FILE>
|
||||||
GimpSignalHandlerFunc
|
GimpSignalHandlerFunc
|
||||||
@ -258,38 +230,6 @@ gimp_flags_value_get_desc
|
|||||||
gimp_flags_value_get_help
|
gimp_flags_value_get_help
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
|
||||||
<FILE>gimpwire</FILE>
|
|
||||||
WireMessage
|
|
||||||
WireReadFunc
|
|
||||||
WireWriteFunc
|
|
||||||
WireDestroyFunc
|
|
||||||
WireIOFunc
|
|
||||||
WireFlushFunc
|
|
||||||
wire_register
|
|
||||||
wire_set_reader
|
|
||||||
wire_set_writer
|
|
||||||
wire_set_flusher
|
|
||||||
wire_read
|
|
||||||
wire_write
|
|
||||||
wire_flush
|
|
||||||
wire_error
|
|
||||||
wire_clear_error
|
|
||||||
wire_read_msg
|
|
||||||
wire_write_msg
|
|
||||||
wire_destroy
|
|
||||||
wire_read_int32
|
|
||||||
wire_read_int16
|
|
||||||
wire_read_int8
|
|
||||||
wire_read_double
|
|
||||||
wire_read_string
|
|
||||||
wire_write_int32
|
|
||||||
wire_write_int16
|
|
||||||
wire_write_int8
|
|
||||||
wire_write_double
|
|
||||||
wire_write_string
|
|
||||||
</SECTION>
|
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gimpversion</FILE>
|
<FILE>gimpversion</FILE>
|
||||||
GIMP_MAJOR_VERSION
|
GIMP_MAJOR_VERSION
|
||||||
|
@ -18,6 +18,16 @@ configuration files.
|
|||||||
<!-- ##### SECTION Stability_Level ##### -->
|
<!-- ##### SECTION Stability_Level ##### -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ##### FUNCTION gimp_env_init ##### -->
|
||||||
|
<para>
|
||||||
|
|
||||||
|
</para>
|
||||||
|
|
||||||
|
@plug_in:
|
||||||
|
<!-- # Unused Parameters # -->
|
||||||
|
@library:
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gimp_directory ##### -->
|
<!-- ##### FUNCTION gimp_directory ##### -->
|
||||||
<para>
|
<para>
|
||||||
|
|
||||||
|
@ -1,297 +0,0 @@
|
|||||||
<!-- ##### SECTION Title ##### -->
|
|
||||||
gimpprotocol
|
|
||||||
|
|
||||||
<!-- ##### SECTION Short_Description ##### -->
|
|
||||||
The communication protocol between GIMP and it's plug-ins.
|
|
||||||
|
|
||||||
<!-- ##### SECTION Long_Description ##### -->
|
|
||||||
<para>
|
|
||||||
The communication protocol between GIMP and it's plug-ins.
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<!-- ##### SECTION See_Also ##### -->
|
|
||||||
<para>
|
|
||||||
#libgimp-gimpwire
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<!-- ##### SECTION Stability_Level ##### -->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### MACRO GIMP_PROTOCOL_VERSION ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### STRUCT GPConfig ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@version:
|
|
||||||
@tile_width:
|
|
||||||
@tile_height:
|
|
||||||
@shm_ID:
|
|
||||||
@check_size:
|
|
||||||
@check_type:
|
|
||||||
@show_help_button:
|
|
||||||
@gimp_reserved_4:
|
|
||||||
@gimp_reserved_5:
|
|
||||||
@gimp_reserved_6:
|
|
||||||
@gimp_reserved_7:
|
|
||||||
@gimp_reserved_8:
|
|
||||||
@install_cmap:
|
|
||||||
@show_tool_tips:
|
|
||||||
@min_colors:
|
|
||||||
@gdisp_ID:
|
|
||||||
@app_name:
|
|
||||||
@wm_class:
|
|
||||||
@display_name:
|
|
||||||
@monitor_number:
|
|
||||||
|
|
||||||
<!-- ##### STRUCT GPTileReq ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@drawable_ID:
|
|
||||||
@tile_num:
|
|
||||||
@shadow:
|
|
||||||
|
|
||||||
<!-- ##### STRUCT GPTileAck ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### STRUCT GPTileData ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@drawable_ID:
|
|
||||||
@tile_num:
|
|
||||||
@shadow:
|
|
||||||
@bpp:
|
|
||||||
@width:
|
|
||||||
@height:
|
|
||||||
@use_shm:
|
|
||||||
@data:
|
|
||||||
|
|
||||||
<!-- ##### STRUCT GPParam ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@type:
|
|
||||||
@d_display:
|
|
||||||
@d_image:
|
|
||||||
@d_layer:
|
|
||||||
@d_channel:
|
|
||||||
@d_drawable:
|
|
||||||
@d_selection:
|
|
||||||
@d_boundary:
|
|
||||||
@d_path:
|
|
||||||
@d_status:
|
|
||||||
|
|
||||||
<!-- ##### STRUCT GPParamDef ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@type:
|
|
||||||
@name:
|
|
||||||
@description:
|
|
||||||
|
|
||||||
<!-- ##### STRUCT GPProcRun ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@name:
|
|
||||||
@nparams:
|
|
||||||
@params:
|
|
||||||
|
|
||||||
<!-- ##### STRUCT GPProcReturn ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@name:
|
|
||||||
@nparams:
|
|
||||||
@params:
|
|
||||||
|
|
||||||
<!-- ##### STRUCT GPProcInstall ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@name:
|
|
||||||
@blurb:
|
|
||||||
@help:
|
|
||||||
@author:
|
|
||||||
@copyright:
|
|
||||||
@date:
|
|
||||||
@menu_path:
|
|
||||||
@image_types:
|
|
||||||
@type:
|
|
||||||
@nparams:
|
|
||||||
@nreturn_vals:
|
|
||||||
@params:
|
|
||||||
@return_vals:
|
|
||||||
|
|
||||||
<!-- ##### STRUCT GPProcUninstall ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@name:
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gp_init ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gp_has_init_write ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gp_quit_write ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gp_config_write ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@config:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gp_tile_req_write ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@tile_req:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gp_tile_ack_write ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gp_tile_data_write ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@tile_data:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gp_proc_run_write ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@proc_run:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gp_proc_return_write ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@proc_return:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gp_temp_proc_run_write ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@proc_run:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gp_temp_proc_return_write ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@proc_return:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gp_proc_install_write ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@proc_install:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gp_proc_uninstall_write ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@proc_uninstall:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION gp_extension_ack_write ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
@ -1,314 +0,0 @@
|
|||||||
<!-- ##### SECTION Title ##### -->
|
|
||||||
gimpwire
|
|
||||||
|
|
||||||
<!-- ##### SECTION Short_Description ##### -->
|
|
||||||
The lowlevel I/O protocol used for communication between GIMP and
|
|
||||||
it's plug-ins.
|
|
||||||
|
|
||||||
<!-- ##### SECTION Long_Description ##### -->
|
|
||||||
<para>
|
|
||||||
The lowlevel I/O protocol used for communication between GIMP and
|
|
||||||
it's plug-ins.
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<!-- ##### SECTION See_Also ##### -->
|
|
||||||
<para>
|
|
||||||
#libgimp-gimpprotocol
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<!-- ##### SECTION Stability_Level ##### -->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### STRUCT WireMessage ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@type:
|
|
||||||
@data:
|
|
||||||
|
|
||||||
<!-- ##### USER_FUNCTION WireReadFunc ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@msg:
|
|
||||||
@user_data:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### USER_FUNCTION WireWriteFunc ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@msg:
|
|
||||||
@user_data:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### USER_FUNCTION WireDestroyFunc ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@msg:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### USER_FUNCTION WireIOFunc ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@buf:
|
|
||||||
@count:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### USER_FUNCTION WireFlushFunc ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_register ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@type:
|
|
||||||
@read_func:
|
|
||||||
@write_func:
|
|
||||||
@destroy_func:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_set_reader ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@read_func:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_set_writer ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@write_func:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_set_flusher ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@flush_func:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_read ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@buf:
|
|
||||||
@count:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_write ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@buf:
|
|
||||||
@count:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_flush ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_error ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_clear_error ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_read_msg ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@msg:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_write_msg ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@msg:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_destroy ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@msg:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_read_int32 ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@data:
|
|
||||||
@count:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_read_int16 ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@data:
|
|
||||||
@count:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_read_int8 ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@data:
|
|
||||||
@count:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_read_double ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@data:
|
|
||||||
@count:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_read_string ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@data:
|
|
||||||
@count:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_write_int32 ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@data:
|
|
||||||
@count:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_write_int16 ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@data:
|
|
||||||
@count:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_write_int8 ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@data:
|
|
||||||
@count:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_write_double ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@data:
|
|
||||||
@count:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION wire_write_string ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@channel:
|
|
||||||
@data:
|
|
||||||
@count:
|
|
||||||
@user_data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
@ -48,7 +48,7 @@ gchar * gimp_path_get_user_writable_dir (GList *path);
|
|||||||
|
|
||||||
|
|
||||||
/* should be considered private, don't use! */
|
/* should be considered private, don't use! */
|
||||||
void gimp_env_init (gboolean library);
|
void gimp_env_init (gboolean plug_in);
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include "gimpreloc.h"
|
#include "gimpreloc.h"
|
||||||
|
|
||||||
|
|
||||||
/** @internal
|
/*
|
||||||
* Find the canonical filename of the executable. Returns the filename
|
* Find the canonical filename of the executable. Returns the filename
|
||||||
* (which must be freed) or NULL on error. If the parameter 'error' is
|
* (which must be freed) or NULL on error. If the parameter 'error' is
|
||||||
* not NULL, the error code will be stored there, if an error occured.
|
* not NULL, the error code will be stored there, if an error occured.
|
||||||
@ -37,138 +37,138 @@ static char *
|
|||||||
_br_find_exe (GimpBinrelocInitError *error)
|
_br_find_exe (GimpBinrelocInitError *error)
|
||||||
{
|
{
|
||||||
#ifndef ENABLE_BINRELOC
|
#ifndef ENABLE_BINRELOC
|
||||||
if (error)
|
if (error)
|
||||||
*error = GIMP_RELOC_INIT_ERROR_DISABLED;
|
*error = GIMP_RELOC_INIT_ERROR_DISABLED;
|
||||||
return NULL;
|
return NULL;
|
||||||
#else
|
#else
|
||||||
char *path, *path2, *line, *result;
|
char *path, *path2, *line, *result;
|
||||||
size_t buf_size;
|
size_t buf_size;
|
||||||
ssize_t size;
|
ssize_t size;
|
||||||
struct stat stat_buf;
|
struct stat stat_buf;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
/* Read from /proc/self/exe (symlink) */
|
/* Read from /proc/self/exe (symlink) */
|
||||||
if (sizeof (path) > SSIZE_MAX)
|
if (sizeof (path) > SSIZE_MAX)
|
||||||
buf_size = SSIZE_MAX - 1;
|
buf_size = SSIZE_MAX - 1;
|
||||||
else
|
else
|
||||||
buf_size = PATH_MAX - 1;
|
buf_size = PATH_MAX - 1;
|
||||||
path = g_try_new (char, buf_size);
|
path = g_try_new (char, buf_size);
|
||||||
if (path == NULL) {
|
if (path == NULL) {
|
||||||
/* Cannot allocate memory. */
|
/* Cannot allocate memory. */
|
||||||
if (error)
|
if (error)
|
||||||
*error = GIMP_RELOC_INIT_ERROR_NOMEM;
|
*error = GIMP_RELOC_INIT_ERROR_NOMEM;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
path2 = g_try_new (char, buf_size);
|
path2 = g_try_new (char, buf_size);
|
||||||
if (path2 == NULL) {
|
if (path2 == NULL) {
|
||||||
/* Cannot allocate memory. */
|
/* Cannot allocate memory. */
|
||||||
if (error)
|
if (error)
|
||||||
*error = GIMP_RELOC_INIT_ERROR_NOMEM;
|
*error = GIMP_RELOC_INIT_ERROR_NOMEM;
|
||||||
g_free (path);
|
g_free (path);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy (path2, "/proc/self/exe", buf_size - 1);
|
strncpy (path2, "/proc/self/exe", buf_size - 1);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
size = readlink (path2, path, buf_size - 1);
|
size = readlink (path2, path, buf_size - 1);
|
||||||
if (size == -1) {
|
if (size == -1) {
|
||||||
/* Error. */
|
/* Error. */
|
||||||
g_free (path2);
|
g_free (path2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* readlink() success. */
|
/* readlink() success. */
|
||||||
path[size] = '\0';
|
path[size] = '\0';
|
||||||
|
|
||||||
/* Check whether the symlink's target is also a symlink.
|
/* Check whether the symlink's target is also a symlink.
|
||||||
* We want to get the final target. */
|
* We want to get the final target. */
|
||||||
i = stat (path, &stat_buf);
|
i = stat (path, &stat_buf);
|
||||||
if (i == -1) {
|
if (i == -1) {
|
||||||
/* Error. */
|
/* Error. */
|
||||||
g_free (path2);
|
g_free (path2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* stat() success. */
|
/* stat() success. */
|
||||||
if (!S_ISLNK (stat_buf.st_mode)) {
|
if (!S_ISLNK (stat_buf.st_mode)) {
|
||||||
/* path is not a symlink. Done. */
|
/* path is not a symlink. Done. */
|
||||||
g_free (path2);
|
g_free (path2);
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* path is a symlink. Continue loop and resolve this. */
|
/* path is a symlink. Continue loop and resolve this. */
|
||||||
strncpy (path, path2, buf_size - 1);
|
strncpy (path, path2, buf_size - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* readlink() or stat() failed; this can happen when the program is
|
/* readlink() or stat() failed; this can happen when the program is
|
||||||
* running in Valgrind 2.2. Read from /proc/self/maps as fallback. */
|
* running in Valgrind 2.2. Read from /proc/self/maps as fallback. */
|
||||||
|
|
||||||
buf_size = PATH_MAX + 128;
|
buf_size = PATH_MAX + 128;
|
||||||
line = (char *) g_try_realloc (path, buf_size);
|
line = (char *) g_try_realloc (path, buf_size);
|
||||||
if (line == NULL) {
|
if (line == NULL) {
|
||||||
/* Cannot allocate memory. */
|
/* Cannot allocate memory. */
|
||||||
g_free (path);
|
g_free (path);
|
||||||
if (error)
|
if (error)
|
||||||
*error = GIMP_RELOC_INIT_ERROR_NOMEM;
|
*error = GIMP_RELOC_INIT_ERROR_NOMEM;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
f = g_fopen ("/proc/self/maps", "r");
|
f = g_fopen ("/proc/self/maps", "r");
|
||||||
if (f == NULL) {
|
if (f == NULL) {
|
||||||
g_free (line);
|
g_free (line);
|
||||||
if (error)
|
if (error)
|
||||||
*error = GIMP_RELOC_INIT_ERROR_OPEN_MAPS;
|
*error = GIMP_RELOC_INIT_ERROR_OPEN_MAPS;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The first entry should be the executable name. */
|
/* The first entry should be the executable name. */
|
||||||
result = fgets (line, (int) buf_size, f);
|
result = fgets (line, (int) buf_size, f);
|
||||||
if (result == NULL) {
|
if (result == NULL) {
|
||||||
fclose (f);
|
fclose (f);
|
||||||
g_free (line);
|
g_free (line);
|
||||||
if (error)
|
if (error)
|
||||||
*error = GIMP_RELOC_INIT_ERROR_READ_MAPS;
|
*error = GIMP_RELOC_INIT_ERROR_READ_MAPS;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get rid of newline character. */
|
/* Get rid of newline character. */
|
||||||
buf_size = strlen (line);
|
buf_size = strlen (line);
|
||||||
if (buf_size <= 0) {
|
if (buf_size <= 0) {
|
||||||
/* Huh? An empty string? */
|
/* Huh? An empty string? */
|
||||||
fclose (f);
|
fclose (f);
|
||||||
g_free (line);
|
g_free (line);
|
||||||
if (error)
|
if (error)
|
||||||
*error = GIMP_RELOC_INIT_ERROR_INVALID_MAPS;
|
*error = GIMP_RELOC_INIT_ERROR_INVALID_MAPS;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (line[buf_size - 1] == 10)
|
if (line[buf_size - 1] == 10)
|
||||||
line[buf_size - 1] = 0;
|
line[buf_size - 1] = 0;
|
||||||
|
|
||||||
/* Extract the filename; it is always an absolute path. */
|
/* Extract the filename; it is always an absolute path. */
|
||||||
path = strchr (line, '/');
|
path = strchr (line, '/');
|
||||||
|
|
||||||
/* Sanity check. */
|
/* Sanity check. */
|
||||||
if (strstr (line, " r-xp ") == NULL || path == NULL) {
|
if (strstr (line, " r-xp ") == NULL || path == NULL) {
|
||||||
fclose (f);
|
fclose (f);
|
||||||
g_free (line);
|
g_free (line);
|
||||||
if (error)
|
if (error)
|
||||||
*error = GIMP_RELOC_INIT_ERROR_INVALID_MAPS;
|
*error = GIMP_RELOC_INIT_ERROR_INVALID_MAPS;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
path = g_strdup (path);
|
path = g_strdup (path);
|
||||||
g_free (line);
|
g_free (line);
|
||||||
fclose (f);
|
fclose (f);
|
||||||
return path;
|
return path;
|
||||||
#endif /* ENABLE_BINRELOC */
|
#endif /* ENABLE_BINRELOC */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** @internal
|
/*
|
||||||
* Find the canonical filename of the executable which owns symbol.
|
* Find the canonical filename of the executable which owns symbol.
|
||||||
* Returns a filename which must be freed, or NULL on error.
|
* Returns a filename which must be freed, or NULL on error.
|
||||||
*/
|
*/
|
||||||
@ -176,102 +176,102 @@ static char *
|
|||||||
_br_find_exe_for_symbol (const void *symbol, GimpBinrelocInitError *error)
|
_br_find_exe_for_symbol (const void *symbol, GimpBinrelocInitError *error)
|
||||||
{
|
{
|
||||||
#ifndef ENABLE_BINRELOC
|
#ifndef ENABLE_BINRELOC
|
||||||
if (error)
|
if (error)
|
||||||
*error = GIMP_RELOC_INIT_ERROR_DISABLED;
|
*error = GIMP_RELOC_INIT_ERROR_DISABLED;
|
||||||
return (char *) NULL;
|
return (char *) NULL;
|
||||||
#else
|
#else
|
||||||
#define SIZE PATH_MAX + 100
|
#define SIZE PATH_MAX + 100
|
||||||
FILE *f;
|
FILE *f;
|
||||||
size_t address_string_len;
|
size_t address_string_len;
|
||||||
char *address_string, line[SIZE], *found;
|
char *address_string, line[SIZE], *found;
|
||||||
|
|
||||||
if (symbol == NULL)
|
if (symbol == NULL)
|
||||||
return (char *) NULL;
|
return (char *) NULL;
|
||||||
|
|
||||||
f = g_fopen ("/proc/self/maps", "r");
|
f = g_fopen ("/proc/self/maps", "r");
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
return (char *) NULL;
|
return (char *) NULL;
|
||||||
|
|
||||||
address_string_len = 4;
|
address_string_len = 4;
|
||||||
address_string = g_try_new (char, address_string_len);
|
address_string = g_try_new (char, address_string_len);
|
||||||
found = (char *) NULL;
|
found = (char *) NULL;
|
||||||
|
|
||||||
while (!feof (f)) {
|
while (!feof (f)) {
|
||||||
char *start_addr, *end_addr, *end_addr_end, *file;
|
char *start_addr, *end_addr, *end_addr_end, *file;
|
||||||
void *start_addr_p, *end_addr_p;
|
void *start_addr_p, *end_addr_p;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
if (fgets (line, SIZE, f) == NULL)
|
if (fgets (line, SIZE, f) == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Sanity check. */
|
/* Sanity check. */
|
||||||
if (strstr (line, " r-xp ") == NULL || strchr (line, '/') == NULL)
|
if (strstr (line, " r-xp ") == NULL || strchr (line, '/') == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Parse line. */
|
/* Parse line. */
|
||||||
start_addr = line;
|
start_addr = line;
|
||||||
end_addr = strchr (line, '-');
|
end_addr = strchr (line, '-');
|
||||||
file = strchr (line, '/');
|
file = strchr (line, '/');
|
||||||
|
|
||||||
/* More sanity check. */
|
/* More sanity check. */
|
||||||
if (!(file > end_addr && end_addr != NULL && end_addr[0] == '-'))
|
if (!(file > end_addr && end_addr != NULL && end_addr[0] == '-'))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
end_addr[0] = '\0';
|
end_addr[0] = '\0';
|
||||||
end_addr++;
|
end_addr++;
|
||||||
end_addr_end = strchr (end_addr, ' ');
|
end_addr_end = strchr (end_addr, ' ');
|
||||||
if (end_addr_end == NULL)
|
if (end_addr_end == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
end_addr_end[0] = '\0';
|
end_addr_end[0] = '\0';
|
||||||
len = strlen (file);
|
len = strlen (file);
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
continue;
|
continue;
|
||||||
if (file[len - 1] == '\n')
|
if (file[len - 1] == '\n')
|
||||||
file[len - 1] = '\0';
|
file[len - 1] = '\0';
|
||||||
|
|
||||||
/* Get rid of "(deleted)" from the filename. */
|
/* Get rid of "(deleted)" from the filename. */
|
||||||
len = strlen (file);
|
len = strlen (file);
|
||||||
if (len > 10 && strcmp (file + len - 10, " (deleted)") == 0)
|
if (len > 10 && strcmp (file + len - 10, " (deleted)") == 0)
|
||||||
file[len - 10] = '\0';
|
file[len - 10] = '\0';
|
||||||
|
|
||||||
/* I don't know whether this can happen but better safe than sorry. */
|
/* I don't know whether this can happen but better safe than sorry. */
|
||||||
len = strlen (start_addr);
|
len = strlen (start_addr);
|
||||||
if (len != strlen (end_addr))
|
if (len != strlen (end_addr))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
||||||
/* Transform the addresses into a string in the form of 0xdeadbeef,
|
/* Transform the addresses into a string in the form of 0xdeadbeef,
|
||||||
* then transform that into a pointer. */
|
* then transform that into a pointer. */
|
||||||
if (address_string_len < len + 3) {
|
if (address_string_len < len + 3) {
|
||||||
address_string_len = len + 3;
|
address_string_len = len + 3;
|
||||||
address_string = (char *) g_try_realloc (address_string, address_string_len);
|
address_string = (char *) g_try_realloc (address_string, address_string_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy (address_string, "0x", 2);
|
memcpy (address_string, "0x", 2);
|
||||||
memcpy (address_string + 2, start_addr, len);
|
memcpy (address_string + 2, start_addr, len);
|
||||||
address_string[2 + len] = '\0';
|
address_string[2 + len] = '\0';
|
||||||
sscanf (address_string, "%p", &start_addr_p);
|
sscanf (address_string, "%p", &start_addr_p);
|
||||||
|
|
||||||
memcpy (address_string, "0x", 2);
|
memcpy (address_string, "0x", 2);
|
||||||
memcpy (address_string + 2, end_addr, len);
|
memcpy (address_string + 2, end_addr, len);
|
||||||
address_string[2 + len] = '\0';
|
address_string[2 + len] = '\0';
|
||||||
sscanf (address_string, "%p", &end_addr_p);
|
sscanf (address_string, "%p", &end_addr_p);
|
||||||
|
|
||||||
|
|
||||||
if (symbol >= start_addr_p && symbol < end_addr_p) {
|
if (symbol >= start_addr_p && symbol < end_addr_p) {
|
||||||
found = file;
|
found = file;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (address_string);
|
g_free (address_string);
|
||||||
fclose (f);
|
fclose (f);
|
||||||
|
|
||||||
if (found == NULL)
|
if (found == NULL)
|
||||||
return (char *) NULL;
|
return (char *) NULL;
|
||||||
else
|
else
|
||||||
return g_strdup (found);
|
return g_strdup (found);
|
||||||
#endif /* ENABLE_BINRELOC */
|
#endif /* ENABLE_BINRELOC */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ static gchar *exe = NULL;
|
|||||||
static void set_gerror (GError **error, GimpBinrelocInitError errcode);
|
static void set_gerror (GError **error, GimpBinrelocInitError errcode);
|
||||||
|
|
||||||
|
|
||||||
/** Initialize the BinReloc library (for applications).
|
/* Initialize the BinReloc library (for applications).
|
||||||
*
|
*
|
||||||
* This function must be called before using any other BinReloc functions.
|
* This function must be called before using any other BinReloc functions.
|
||||||
* It attempts to locate the application's canonical filename.
|
* It attempts to locate the application's canonical filename.
|
||||||
@ -301,25 +301,25 @@ static void set_gerror (GError **error, GimpBinrelocInitError errcode);
|
|||||||
gboolean
|
gboolean
|
||||||
_gimp_reloc_init (GError **error)
|
_gimp_reloc_init (GError **error)
|
||||||
{
|
{
|
||||||
GimpBinrelocInitError errcode;
|
GimpBinrelocInitError errcode;
|
||||||
|
|
||||||
/* Shut up compiler warning about uninitialized variable. */
|
/* Shut up compiler warning about uninitialized variable. */
|
||||||
errcode = GIMP_RELOC_INIT_ERROR_NOMEM;
|
errcode = GIMP_RELOC_INIT_ERROR_NOMEM;
|
||||||
|
|
||||||
/* Locate the application's filename. */
|
/* Locate the application's filename. */
|
||||||
exe = _br_find_exe (&errcode);
|
exe = _br_find_exe (&errcode);
|
||||||
if (exe != NULL)
|
if (exe != NULL)
|
||||||
/* Success! */
|
/* Success! */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
else {
|
else {
|
||||||
/* Failed :-( */
|
/* Failed :-( */
|
||||||
set_gerror (error, errcode);
|
set_gerror (error, errcode);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Initialize the BinReloc library (for libraries).
|
/* Initialize the BinReloc library (for libraries).
|
||||||
*
|
*
|
||||||
* This function must be called before using any other BinReloc functions.
|
* This function must be called before using any other BinReloc functions.
|
||||||
* It attempts to locate the calling library's canonical filename.
|
* It attempts to locate the calling library's canonical filename.
|
||||||
@ -334,56 +334,56 @@ _gimp_reloc_init (GError **error)
|
|||||||
gboolean
|
gboolean
|
||||||
_gimp_reloc_init_lib (GError **error)
|
_gimp_reloc_init_lib (GError **error)
|
||||||
{
|
{
|
||||||
GimpBinrelocInitError errcode;
|
GimpBinrelocInitError errcode;
|
||||||
|
|
||||||
/* Shut up compiler warning about uninitialized variable. */
|
/* Shut up compiler warning about uninitialized variable. */
|
||||||
errcode = GIMP_RELOC_INIT_ERROR_NOMEM;
|
errcode = GIMP_RELOC_INIT_ERROR_NOMEM;
|
||||||
|
|
||||||
exe = _br_find_exe_for_symbol ((const void *) "", &errcode);
|
exe = _br_find_exe_for_symbol ((const void *) "", &errcode);
|
||||||
if (exe != NULL)
|
if (exe != NULL)
|
||||||
/* Success! */
|
/* Success! */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
else {
|
else {
|
||||||
/* Failed :-( */
|
/* Failed :-( */
|
||||||
set_gerror (error, errcode);
|
set_gerror (error, errcode);
|
||||||
return exe != NULL;
|
return exe != NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_gerror (GError **error, GimpBinrelocInitError errcode)
|
set_gerror (GError **error, GimpBinrelocInitError errcode)
|
||||||
{
|
{
|
||||||
gchar *error_message;
|
gchar *error_message;
|
||||||
|
|
||||||
if (error == NULL)
|
if (error == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (errcode) {
|
switch (errcode) {
|
||||||
case GIMP_RELOC_INIT_ERROR_NOMEM:
|
case GIMP_RELOC_INIT_ERROR_NOMEM:
|
||||||
error_message = "Cannot allocate memory.";
|
error_message = "Cannot allocate memory.";
|
||||||
break;
|
break;
|
||||||
case GIMP_RELOC_INIT_ERROR_OPEN_MAPS:
|
case GIMP_RELOC_INIT_ERROR_OPEN_MAPS:
|
||||||
error_message = "Unable to open /proc/self/maps for reading.";
|
error_message = "Unable to open /proc/self/maps for reading.";
|
||||||
break;
|
break;
|
||||||
case GIMP_RELOC_INIT_ERROR_READ_MAPS:
|
case GIMP_RELOC_INIT_ERROR_READ_MAPS:
|
||||||
error_message = "Unable to read from /proc/self/maps.";
|
error_message = "Unable to read from /proc/self/maps.";
|
||||||
break;
|
break;
|
||||||
case GIMP_RELOC_INIT_ERROR_INVALID_MAPS:
|
case GIMP_RELOC_INIT_ERROR_INVALID_MAPS:
|
||||||
error_message = "The file format of /proc/self/maps is invalid.";
|
error_message = "The file format of /proc/self/maps is invalid.";
|
||||||
break;
|
break;
|
||||||
case GIMP_RELOC_INIT_ERROR_DISABLED:
|
case GIMP_RELOC_INIT_ERROR_DISABLED:
|
||||||
error_message = "Binary relocation support is disabled.";
|
error_message = "Binary relocation support is disabled.";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error_message = "Unknown error.";
|
error_message = "Unknown error.";
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
g_set_error (error, g_quark_from_static_string ("GBinReloc"),
|
g_set_error (error, g_quark_from_static_string ("GBinReloc"),
|
||||||
errcode, "%s", error_message);
|
errcode, "%s", error_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Find the canonical filename of the current application.
|
/* Find the canonical filename of the current application.
|
||||||
*
|
*
|
||||||
* @param default_exe A default filename which will be used as fallback.
|
* @param default_exe A default filename which will be used as fallback.
|
||||||
* @returns A string containing the application's canonical filename,
|
* @returns A string containing the application's canonical filename,
|
||||||
@ -395,18 +395,18 @@ set_gerror (GError **error, GimpBinrelocInitError errcode)
|
|||||||
gchar *
|
gchar *
|
||||||
_gimp_reloc_find_exe (const gchar *default_exe)
|
_gimp_reloc_find_exe (const gchar *default_exe)
|
||||||
{
|
{
|
||||||
if (exe == NULL) {
|
if (exe == NULL) {
|
||||||
/* BinReloc is not initialized. */
|
/* BinReloc is not initialized. */
|
||||||
if (default_exe != NULL)
|
if (default_exe != NULL)
|
||||||
return g_strdup (default_exe);
|
return g_strdup (default_exe);
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return g_strdup (exe);
|
return g_strdup (exe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Locate the directory in which the current application is installed.
|
/* Locate the directory in which the current application is installed.
|
||||||
*
|
*
|
||||||
* The prefix is generated by the following pseudo-code evaluation:
|
* The prefix is generated by the following pseudo-code evaluation:
|
||||||
* \code
|
* \code
|
||||||
@ -423,19 +423,19 @@ _gimp_reloc_find_exe (const gchar *default_exe)
|
|||||||
gchar *
|
gchar *
|
||||||
_gimp_reloc_find_exe_dir (const gchar *default_dir)
|
_gimp_reloc_find_exe_dir (const gchar *default_dir)
|
||||||
{
|
{
|
||||||
if (exe == NULL) {
|
if (exe == NULL) {
|
||||||
/* BinReloc not initialized. */
|
/* BinReloc not initialized. */
|
||||||
if (default_dir != NULL)
|
if (default_dir != NULL)
|
||||||
return g_strdup (default_dir);
|
return g_strdup (default_dir);
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return g_path_get_dirname (exe);
|
return g_path_get_dirname (exe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Locate the prefix in which the current application is installed.
|
/* Locate the prefix in which the current application is installed.
|
||||||
*
|
*
|
||||||
* The prefix is generated by the following pseudo-code evaluation:
|
* The prefix is generated by the following pseudo-code evaluation:
|
||||||
* \code
|
* \code
|
||||||
@ -452,24 +452,24 @@ _gimp_reloc_find_exe_dir (const gchar *default_dir)
|
|||||||
gchar *
|
gchar *
|
||||||
_gimp_reloc_find_prefix (const gchar *default_prefix)
|
_gimp_reloc_find_prefix (const gchar *default_prefix)
|
||||||
{
|
{
|
||||||
gchar *dir1, *dir2;
|
gchar *dir1, *dir2;
|
||||||
|
|
||||||
if (exe == NULL) {
|
if (exe == NULL) {
|
||||||
/* BinReloc not initialized. */
|
/* BinReloc not initialized. */
|
||||||
if (default_prefix != NULL)
|
if (default_prefix != NULL)
|
||||||
return g_strdup (default_prefix);
|
return g_strdup (default_prefix);
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dir1 = g_path_get_dirname (exe);
|
dir1 = g_path_get_dirname (exe);
|
||||||
dir2 = g_path_get_dirname (dir1);
|
dir2 = g_path_get_dirname (dir1);
|
||||||
g_free (dir1);
|
g_free (dir1);
|
||||||
return dir2;
|
return dir2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Locate the application's binary folder.
|
/* Locate the application's binary folder.
|
||||||
*
|
*
|
||||||
* The path is generated by the following pseudo-code evaluation:
|
* The path is generated by the following pseudo-code evaluation:
|
||||||
* \code
|
* \code
|
||||||
@ -485,24 +485,24 @@ _gimp_reloc_find_prefix (const gchar *default_prefix)
|
|||||||
gchar *
|
gchar *
|
||||||
_gimp_reloc_find_bin_dir (const gchar *default_bin_dir)
|
_gimp_reloc_find_bin_dir (const gchar *default_bin_dir)
|
||||||
{
|
{
|
||||||
gchar *prefix, *dir;
|
gchar *prefix, *dir;
|
||||||
|
|
||||||
prefix = _gimp_reloc_find_prefix (NULL);
|
prefix = _gimp_reloc_find_prefix (NULL);
|
||||||
if (prefix == NULL) {
|
if (prefix == NULL) {
|
||||||
/* BinReloc not initialized. */
|
/* BinReloc not initialized. */
|
||||||
if (default_bin_dir != NULL)
|
if (default_bin_dir != NULL)
|
||||||
return g_strdup (default_bin_dir);
|
return g_strdup (default_bin_dir);
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = g_build_filename (prefix, "bin", NULL);
|
dir = g_build_filename (prefix, "bin", NULL);
|
||||||
g_free (prefix);
|
g_free (prefix);
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Locate the application's data folder.
|
/* Locate the application's data folder.
|
||||||
*
|
*
|
||||||
* The path is generated by the following pseudo-code evaluation:
|
* The path is generated by the following pseudo-code evaluation:
|
||||||
* \code
|
* \code
|
||||||
@ -519,49 +519,49 @@ _gimp_reloc_find_bin_dir (const gchar *default_bin_dir)
|
|||||||
gchar *
|
gchar *
|
||||||
_gimp_reloc_find_data_dir (const gchar *default_data_dir)
|
_gimp_reloc_find_data_dir (const gchar *default_data_dir)
|
||||||
{
|
{
|
||||||
gchar *prefix, *dir;
|
gchar *prefix, *dir;
|
||||||
|
|
||||||
prefix = _gimp_reloc_find_prefix (NULL);
|
prefix = _gimp_reloc_find_prefix (NULL);
|
||||||
if (prefix == NULL) {
|
if (prefix == NULL) {
|
||||||
/* BinReloc not initialized. */
|
/* BinReloc not initialized. */
|
||||||
if (default_data_dir != NULL)
|
if (default_data_dir != NULL)
|
||||||
return g_strdup (default_data_dir);
|
return g_strdup (default_data_dir);
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = g_build_filename (prefix, "share",
|
dir = g_build_filename (prefix, "share",
|
||||||
GIMP_PACKAGE,
|
GIMP_PACKAGE,
|
||||||
GIMP_DATA_VERSION,
|
GIMP_DATA_VERSION,
|
||||||
NULL);
|
NULL);
|
||||||
g_free (prefix);
|
g_free (prefix);
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
_gimp_reloc_find_plugin_dir (const gchar *default_plugin_dir)
|
_gimp_reloc_find_plugin_dir (const gchar *default_plugin_dir)
|
||||||
{
|
{
|
||||||
gchar *libdir, *dir;
|
gchar *libdir, *dir;
|
||||||
|
|
||||||
libdir = _gimp_reloc_find_lib_dir (NULL);
|
libdir = _gimp_reloc_find_lib_dir (NULL);
|
||||||
if (libdir == NULL) {
|
if (libdir == NULL) {
|
||||||
/* BinReloc not initialized. */
|
/* BinReloc not initialized. */
|
||||||
if (default_plugin_dir != NULL)
|
if (default_plugin_dir != NULL)
|
||||||
return g_strdup (default_plugin_dir);
|
return g_strdup (default_plugin_dir);
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = g_build_filename (libdir,
|
dir = g_build_filename (libdir,
|
||||||
GIMP_PACKAGE,
|
GIMP_PACKAGE,
|
||||||
GIMP_PLUGIN_VERSION,
|
GIMP_PLUGIN_VERSION,
|
||||||
NULL);
|
NULL);
|
||||||
g_free (libdir);
|
g_free (libdir);
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Locate the application's localization folder.
|
/* Locate the application's localization folder.
|
||||||
*
|
*
|
||||||
* The path is generated by the following pseudo-code evaluation:
|
* The path is generated by the following pseudo-code evaluation:
|
||||||
* \code
|
* \code
|
||||||
@ -577,24 +577,24 @@ _gimp_reloc_find_plugin_dir (const gchar *default_plugin_dir)
|
|||||||
gchar *
|
gchar *
|
||||||
_gimp_reloc_find_locale_dir (const gchar *default_locale_dir)
|
_gimp_reloc_find_locale_dir (const gchar *default_locale_dir)
|
||||||
{
|
{
|
||||||
gchar *data_dir, *dir;
|
gchar *data_dir, *dir;
|
||||||
|
|
||||||
data_dir = _gimp_reloc_find_data_dir (NULL);
|
data_dir = _gimp_reloc_find_data_dir (NULL);
|
||||||
if (data_dir == NULL) {
|
if (data_dir == NULL) {
|
||||||
/* BinReloc not initialized. */
|
/* BinReloc not initialized. */
|
||||||
if (default_locale_dir != NULL)
|
if (default_locale_dir != NULL)
|
||||||
return g_strdup (default_locale_dir);
|
return g_strdup (default_locale_dir);
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = g_build_filename (data_dir, "locale", NULL);
|
dir = g_build_filename (data_dir, "locale", NULL);
|
||||||
g_free (data_dir);
|
g_free (data_dir);
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Locate the application's library folder.
|
/* Locate the application's library folder.
|
||||||
*
|
*
|
||||||
* The path is generated by the following pseudo-code evaluation:
|
* The path is generated by the following pseudo-code evaluation:
|
||||||
* \code
|
* \code
|
||||||
@ -610,24 +610,24 @@ _gimp_reloc_find_locale_dir (const gchar *default_locale_dir)
|
|||||||
gchar *
|
gchar *
|
||||||
_gimp_reloc_find_lib_dir (const gchar *default_lib_dir)
|
_gimp_reloc_find_lib_dir (const gchar *default_lib_dir)
|
||||||
{
|
{
|
||||||
gchar *prefix, *dir;
|
gchar *prefix, *dir;
|
||||||
|
|
||||||
prefix = _gimp_reloc_find_prefix (NULL);
|
prefix = _gimp_reloc_find_prefix (NULL);
|
||||||
if (prefix == NULL) {
|
if (prefix == NULL) {
|
||||||
/* BinReloc not initialized. */
|
/* BinReloc not initialized. */
|
||||||
if (default_lib_dir != NULL)
|
if (default_lib_dir != NULL)
|
||||||
return g_strdup (default_lib_dir);
|
return g_strdup (default_lib_dir);
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = g_build_filename (prefix, "lib", NULL);
|
dir = g_build_filename (prefix, "lib", NULL);
|
||||||
g_free (prefix);
|
g_free (prefix);
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Locate the application's libexec folder.
|
/* Locate the application's libexec folder.
|
||||||
*
|
*
|
||||||
* The path is generated by the following pseudo-code evaluation:
|
* The path is generated by the following pseudo-code evaluation:
|
||||||
* \code
|
* \code
|
||||||
@ -643,24 +643,24 @@ _gimp_reloc_find_lib_dir (const gchar *default_lib_dir)
|
|||||||
gchar *
|
gchar *
|
||||||
_gimp_reloc_find_libexec_dir (const gchar *default_libexec_dir)
|
_gimp_reloc_find_libexec_dir (const gchar *default_libexec_dir)
|
||||||
{
|
{
|
||||||
gchar *prefix, *dir;
|
gchar *prefix, *dir;
|
||||||
|
|
||||||
prefix = _gimp_reloc_find_prefix (NULL);
|
prefix = _gimp_reloc_find_prefix (NULL);
|
||||||
if (prefix == NULL) {
|
if (prefix == NULL) {
|
||||||
/* BinReloc not initialized. */
|
/* BinReloc not initialized. */
|
||||||
if (default_libexec_dir != NULL)
|
if (default_libexec_dir != NULL)
|
||||||
return g_strdup (default_libexec_dir);
|
return g_strdup (default_libexec_dir);
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = g_build_filename (prefix, "libexec", NULL);
|
dir = g_build_filename (prefix, "libexec", NULL);
|
||||||
g_free (prefix);
|
g_free (prefix);
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Locate the application's configuration files folder.
|
/* Locate the application's configuration files folder.
|
||||||
*
|
*
|
||||||
* The path is generated by the following pseudo-code evaluation:
|
* The path is generated by the following pseudo-code evaluation:
|
||||||
* \code
|
* \code
|
||||||
@ -669,28 +669,29 @@ _gimp_reloc_find_libexec_dir (const gchar *default_libexec_dir)
|
|||||||
*
|
*
|
||||||
* @param default_etc_dir A default path which will used as fallback.
|
* @param default_etc_dir A default path which will used as fallback.
|
||||||
* @return A string containing the etc folder's path, which must be freed when
|
* @return A string containing the etc folder's path, which must be freed when
|
||||||
* no longer necessary. If BinReloc is not initialized, or if the initialization
|
* no longer necessary. If BinReloc is not initialized, or if the
|
||||||
* function failed, then a copy of default_etc_dir will be returned.
|
* initialization function failed, then a copy of default_etc_dir
|
||||||
* If default_etc_dir is NULL, then NULL will be returned.
|
* will be returned. If default_etc_dir is NULL, then NULL will be
|
||||||
|
* returned.
|
||||||
*/
|
*/
|
||||||
gchar *
|
gchar *
|
||||||
_gimp_reloc_find_etc_dir (const gchar *default_etc_dir)
|
_gimp_reloc_find_etc_dir (const gchar *default_etc_dir)
|
||||||
{
|
{
|
||||||
gchar *prefix, *dir;
|
gchar *prefix, *dir;
|
||||||
|
|
||||||
prefix = _gimp_reloc_find_prefix (NULL);
|
prefix = _gimp_reloc_find_prefix (NULL);
|
||||||
if (prefix == NULL) {
|
if (prefix == NULL) {
|
||||||
/* BinReloc not initialized. */
|
/* BinReloc not initialized. */
|
||||||
if (default_etc_dir != NULL)
|
if (default_etc_dir != NULL)
|
||||||
return g_strdup (default_etc_dir);
|
return g_strdup (default_etc_dir);
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = g_build_filename (prefix, "etc",
|
dir = g_build_filename (prefix, "etc",
|
||||||
GIMP_PACKAGE,
|
GIMP_PACKAGE,
|
||||||
GIMP_SYSCONF_VERSION,
|
GIMP_SYSCONF_VERSION,
|
||||||
NULL);
|
NULL);
|
||||||
g_free (prefix);
|
g_free (prefix);
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user