diff options
author | HyungKyu Song <hk76.song@samsung.com> | 2013-02-16 00:52:26 +0900 |
---|---|---|
committer | HyungKyu Song <hk76.song@samsung.com> | 2013-02-16 00:52:26 +0900 |
commit | 7971aaeae56bd004926a9c8ad20ce9e51d3a65ff (patch) | |
tree | d444998270156668444cd7e9448998d4ca960db5 /glib-1.2.10/gmodule | |
parent | 5ec49d7969628ec586e19efdd894966519ed0733 (diff) | |
download | pkg-config-7971aaeae56bd004926a9c8ad20ce9e51d3a65ff.tar.gz pkg-config-7971aaeae56bd004926a9c8ad20ce9e51d3a65ff.tar.bz2 pkg-config-7971aaeae56bd004926a9c8ad20ce9e51d3a65ff.zip |
Diffstat (limited to 'glib-1.2.10/gmodule')
-rw-r--r-- | glib-1.2.10/gmodule/AUTHORS | 1 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/COPYING | 482 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/ChangeLog | 236 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/Makefile.am | 66 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/Makefile.in | 596 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/gmodule-dl.c | 158 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/gmodule-dld.c | 150 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/gmodule-win32.c | 120 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/gmodule.c | 418 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/gmodule.def | 9 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/gmodule.h | 100 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/gmoduleconf.h | 51 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/gmoduleconf.h.in | 51 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/gmoduleconf.h.win32 | 45 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/libgplugin_a.c | 82 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/libgplugin_b.c | 75 | ||||
-rw-r--r-- | glib-1.2.10/gmodule/testgmodule.c | 207 |
17 files changed, 2847 insertions, 0 deletions
diff --git a/glib-1.2.10/gmodule/AUTHORS b/glib-1.2.10/gmodule/AUTHORS new file mode 100644 index 0000000..3282695 --- /dev/null +++ b/glib-1.2.10/gmodule/AUTHORS @@ -0,0 +1 @@ +Tim Janik <timj@gtk.org> diff --git a/glib-1.2.10/gmodule/COPYING b/glib-1.2.10/gmodule/COPYING new file mode 100644 index 0000000..bf50f20 --- /dev/null +++ b/glib-1.2.10/gmodule/COPYING @@ -0,0 +1,482 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307 USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/glib-1.2.10/gmodule/ChangeLog b/glib-1.2.10/gmodule/ChangeLog new file mode 100644 index 0000000..d806882 --- /dev/null +++ b/glib-1.2.10/gmodule/ChangeLog @@ -0,0 +1,236 @@ +2001-03-07 Sebastian Wilhelmi <wilhelmi@ira.uka.de> + + * Makefile.am: Set G_LOG_DOMAIN to \"GModule\" instead of + g_log_domain_gmodule. + + * gmodule.c, gmodule.def, gmodule.h: Removed + g_log_domain_gmodule. This fixes Bug #51643 for good. + +Sat Feb 17 07:33:21 2001 Tim Janik <timj@gtk.org> + + * gmodule-dl.c: fix systems with broken RTLD_GLOBAL. + +2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de> + + * gmodule.h: include glib.h before doing extern "C". Makes some + C++ compiler happy. Reported by Denis Vakatov + <vakatov@peony.nlm.nih.gov>. + +Wed Mar 1 05:34:47 2000 Tim Janik <timj@gtk.org> + + * gmodule-beos.c (_g_module_symbol): do not return NULL symbols. + + * gmodule-os2.c: removed NetBSD specific defines. + (_g_module_self): set an error message for unsupported behaviour. + + * gmodule-beos.c: many coding style fixups. + (_g_module_open): + (_g_module_self): + (_g_module_close): + (_g_module_symbol): bunch of memory leaks plugged. + + * gmodule-dl.c: make sure the error message returned from dlerror() + is always != NULL, by using a wrapper function fetch_dlerror(). based + on a patch to fix _g_module_symbol() for NetBSD from Scott Presnell + <srp@zgi.com>. + + * gmodule-dld.c: minor indentation. + + * gmodule-win32.c: minor cleanups. + +Sat Feb 19 19:43:29 2000 Tim Janik <timj@gtk.org> + + * testgmodule.c (main): added test to check that not yet bound symbols + in shared libraries of the main module are retrievable, from David Gero. + + * gmodule-dld.c (_g_module_symbol): applied patch by David Gero + <dgero@nortelnetworks.com>, so lookups for module_self also return + library symbols on AIX. + +Sat May 1 10:24:02 PDT 1999 Manish Singh <yosh@gimp.org> + + * Makefile.am: use -avoid-version and -module for test plugins + +Fri Apr 23 09:03:48 1999 Tim Janik <timj@gtk.org> + + * gmodule.c (g_module_symbol): removed inline variable assignment. + s/CHECK_ERROR/SUPPORT_OR_RETURN/ to make the code more self descriptive. + +Wed Feb 10 12:06:30 1999 Tim Janik <timj@gtk.org> + + * gmodule.c (CHECK_ERROR): be more descriptive on unsupported systems. + +Wed Feb 10 07:56:33 1999 Tim Janik <timj@gtk.org> + + * gmodule.c (g_module_error): fixed errernerous code wrt to thread + specific error string allocation handling. + +Thu Jan 21 12:40:11 EST 1999 Jeff Garzik <jgarzik@pobox.com> + + * gmodule-dl.c (_g_module_build_path): + Add braces to eliminate an ambiguous else warning. + +1999-01-16 Tor Lillqvist <tml@iki.fi> + + * gmodule-dl.c gmodule-dld.c: In + _g_module_build_path, don't add the "lib" prefix and + ".so" or ".sl" suffix if already there. + + * gmodule-win32.c: Likewise for the ".dll" suffix. + +1998-12-10 Sebastian Wilhelmi <wilhelmi@ira.uka.de> + + * gmodule.c: Made it MT safe, the g_module_error() is now thread + specific. + +Fri Nov 20 14:43:44 1998 Tim Janik <timj@gtk.org> + + * gmodule.c (_g_module_build_path): added empty default imlementation + so gmodule.so compiles on systems that are not yet supported, fix from + Erik Bagfors <bagfors@hpc2n.umu.se>. + +1998-11-13 Nuno Ferreira <nmrf@rnl.ist.utl.pt> + + * Makefile.am (INCLUDES): The previous commit message is wrong + about the -I$(top_srcdir) being redundant. I put it back. + +Wed Nov 11 23:23:22 EST 1998 Jeff Garzik <jgarzik@pobox.com> + + * Makefile.am : INCLUDES is the right way to add to CFLAGS, not + DEFS. Also there are bugs with '+=' in makefiles. + Got rid of DEFS line by moving G_LOG_DOMAIN setting into INCLUDES. + Removed redundant -I from INCLUDES. + +Tue Oct 27 04:00:11 1998 Tim Janik <timj@gtk.org> + + * testgmodule.c (main): changed the #ifdef WIN32 test to NATIVE_WIN32, + this needs to be more constistent throughout the code, do we go for + NATIVE_WIN32 or WIN32? + + * gmodule.c (LibMain): special cased the #ifdef __LCC__ case for + NATIVE_WIN32, since lcc maybe used on other platforms as well. + * libgplugin_a.c (LibMain): + * libgplugin_b.c (LibMain): + likewise. not sure i like this special requirement for lcc in here. + + * gmodule-dl.c (_g_module_build_path): + feature empty "" directories and prepend the module name with "lib". + + * gmodule-dld.c (_g_module_build_path): + * gmodule-win32.c (_g_module_build_path): + feature empty "" directories. + + * we need some more magic in the _g_module_build_path variants + so we don't append/prepend lib and .so, .sl or .dll for those names + that already contain it. + + * applied patch from Tor Lillqvist for g_module_build_path() and + windows support. + +1998-10-20: Tor Lillqvist <tml@iki.fi> + + * gmodule/gmodule-win32.c: + New file. + + * gmodule/gmodule.c gmodule/gmodule.h: + Added the funcion g_module_build_path that builds the path to + a module file, decorating the name according to the system's + conventions. Added the Windows implementation. + + * gmodule/libgplugin_a.c gmodule/libgplugin_b.c: + Added LibMain for LCC-Win32. + + * gmodule/testgmodule.c: + Handle Windows dll names. + +1998-10-25 Raja R Harinath <harinath@cs.umn.edu> + + * gmodule.h: Remove `#pragma }'. + * gmoduleconf.h.in: Likewise. + +Wed Oct 21 19:58:27 1998 Tim Janik <timj@gtk.org> + + * gmodule.c (g_module_symbol): fixed a string pointer bug that could + cause garbage error messages from g_module_symbol() for systems that + NEED_USCORE. + +Mon Sep 21 01:54:48 1998 Tim Janik <timj@gtk.org> + + * gmodule.h: + * gmodule.c: renamed old _de_init functionality to _unload. + modules are now expected to export: + G_MODULE_EXPORT const gchar* g_module_check_init (GModule *module); + and + G_MODULE_EXPORT void g_module_unload (GModule *module); + returning a string other than NULL from g_module_check_init() will + prevent the module from being loaded. a call to g_module_make_resident() + from g_module_unload() will prevent the module from being unloaded and + still make it resident. + +Thu Sep 17 06:34:22 1998 Tim Janik <timj@gtk.org> + + * gmodule.h: + * gmodule.c: implemented g_module_make_resident() which can be + used to make modules resident. + fixed a buglet about the optional "g_module_de_init" function in + modules, which could get invoked twice on very obscure occasions. + +Tue Sep 15 14:57:30 1998 Owen Taylor <otaylor@redhat.com> + + * Makefile.am: Update to libtool-1.2b, + change library versioning scheme to drop LT_RELEASE + from the -l line, while keeping it in the soname. + +Thu Aug 20 07:08:16 1998 Tim Janik <timj@gtk.org> + + * gmodule.c: provide no operation implementation for the underlying + _g_module_* functions, so we at least compile on systems that have + neither of G_MODULE_IMPL_DL or G_MODULE_IMPL_DLD. + +Mon Aug 17 03:41:52 1998 Tim Janik <timj@gtk.org> + + * gmodule.h: + * gmodule.c (g_module_open): changed the return type for the + GModuleCheckInit function to be a string, describing the error + condition. + (g_module_symbol): show the failing symbol on error messages. + +Fri Aug 14 02:24:39 1998 Tim Janik <timj@gtk.org> + + * Makefile.am: feature the G_LOG_DOMAIN macro to set the log domain + to "GModule" upon compilation. we currently have to add this definition + to the DEFS variable. + * testgmodule.c: we need an ugly #undef G_LOG_DOMAIN at the start + of this file currently, since automake doesn't support per target + _CFLAGS yet. + +Mon Aug 10 03:35:57 1998 Tim Janik <timj@gtk.org> + + * gmodule.c: minor changes to internal interface. + * gmodule-dl.c: + * gmodule-dld.c: put some comments into the files, and provided + better error checking for shl_findsym(). whish i had a system to + test this stuff on. + +Mon Aug 10 02:18:31 1998 Tim Janik <timj@gtk.org> + + * Makefile.am (lib_LTLIBRARIES): for now, skip the dependency on + -lglib for libgmodule-1.1.la, libgplugin_a.la and libgplugin_b.la + since this clashes with inter-library-dependencies for not installed + libraries. glib-config takes care of this for the usuall case, but + there needs to be a better way... + +Sun Aug 9 15:57:38 1998 Tim Janik <timj@gtk.org> + + * testgmodule.c: test program for GModule. + * libgplugin_a.c: + * libgplugin_b.c: test plugins for testgmodule.c. + + * gmodule.h: + * gmodule.c: GModule library implementation, which is basically + a wrapper about system specifc dynamic loading facilities. + + +Sun Aug 9 10:31:05 1998 Tim Janik <timj@gtk.org> + + * ChangeLog start for gmodule. diff --git a/glib-1.2.10/gmodule/Makefile.am b/glib-1.2.10/gmodule/Makefile.am new file mode 100644 index 0000000..f1475c7 --- /dev/null +++ b/glib-1.2.10/gmodule/Makefile.am @@ -0,0 +1,66 @@ +## Process this file with automake to produce Makefile.in + +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gmodule \ + -DG_LOG_DOMAIN=\"GModule\" @GLIB_DEBUG_FLAGS@ + +EXTRA_DIST = \ + gmoduleconf.h.in \ + gmodule.def \ + gmodule-dl.c \ + gmodule-dld.c \ + gmodule-win32.c \ + gmoduleconf.h.win32 + +BUILT_SOURCES = gmoduleconf.h +gmoduleconf.h: gmoduleconf.h.in + +glibincludedir=$(includedir)/glib-1.2 +noinst_HEADERS = \ + gmodule.h + +libglib = $(top_builddir)/libglib.la # -lglib + +noinst_LTLIBRARIES = libgmodule.la libgplugin_a.la libgplugin_b.la + +libgmodule_la_SOURCES = gmodule.c +libgmodule_la_LDFLAGS = \ + @G_MODULE_LDFLAGS@ \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -release $(LT_RELEASE) \ + -export-dynamic + +libgmodule_la_LIBADD = @G_MODULE_LIBS@ # $(libglib) +# we should really depend on $(libglib) for libgmodule.la, but libtool has a +# problem with this ;( + +libgplugin_a_la_SOURCES = libgplugin_a.c +libgplugin_a_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module +libgplugin_a_la_LIBADD = @G_MODULE_LIBS@ # $(libglib) + +libgplugin_b_la_SOURCES = libgplugin_b.c +libgplugin_b_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module +libgplugin_b_la_LIBADD = @G_MODULE_LIBS@ # $(libglib) + +noinst_PROGRAMS = testgmodule +testgmodule_LDFLAGS = @G_MODULE_LDFLAGS@ +testgmodule_LDADD = libgmodule.la $(libglib) @G_MODULE_LIBS@ + +.PHONY: files release + +files: + @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \ + echo $$p; \ + done + +install-libLTLIBRARIES: libgmodule.la + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libdir) + @list='libgmodule.la'; for p in $$list; do \ + if test -f $$p; then \ + echo "$(LIBTOOL) --mode=install $(noinst_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \ + $(LIBTOOL) --mode=install $(noinst_DATA) $$p $(DESTDIR)$(libdir)/$$p; \ + else :; fi; \ + done + +release: + $(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"` diff --git a/glib-1.2.10/gmodule/Makefile.in b/glib-1.2.10/gmodule/Makefile.in new file mode 100644 index 0000000..3533dd8 --- /dev/null +++ b/glib-1.2.10/gmodule/Makefile.in @@ -0,0 +1,596 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = testgmodule$(EXEEXT) +subdir = gmodule +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/gmoduleconf.h.in AUTHORS \ + COPYING ChangeLog +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = gmoduleconf.h +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libgmodule_la_DEPENDENCIES = +am_libgmodule_la_OBJECTS = gmodule.lo +libgmodule_la_OBJECTS = $(am_libgmodule_la_OBJECTS) +libgmodule_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libgmodule_la_LDFLAGS) $(LDFLAGS) -o $@ +libgplugin_a_la_DEPENDENCIES = +am_libgplugin_a_la_OBJECTS = libgplugin_a.lo +libgplugin_a_la_OBJECTS = $(am_libgplugin_a_la_OBJECTS) +libgplugin_a_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libgplugin_a_la_LDFLAGS) $(LDFLAGS) -o $@ +libgplugin_b_la_DEPENDENCIES = +am_libgplugin_b_la_OBJECTS = libgplugin_b.lo +libgplugin_b_la_OBJECTS = $(am_libgplugin_b_la_OBJECTS) +libgplugin_b_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libgplugin_b_la_LDFLAGS) $(LDFLAGS) -o $@ +PROGRAMS = $(noinst_PROGRAMS) +testgmodule_SOURCES = testgmodule.c +testgmodule_OBJECTS = testgmodule.$(OBJEXT) +testgmodule_DEPENDENCIES = libgmodule.la $(libglib) +testgmodule_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(testgmodule_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libgmodule_la_SOURCES) $(libgplugin_a_la_SOURCES) \ + $(libgplugin_b_la_SOURCES) testgmodule.c +DIST_SOURCES = $(libgmodule_la_SOURCES) $(libgplugin_a_la_SOURCES) \ + $(libgplugin_b_la_SOURCES) testgmodule.c +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MEM_CHECK = @ENABLE_MEM_CHECK@ +ENABLE_MEM_PROFILE = @ENABLE_MEM_PROFILE@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLIB_BINARY_AGE = @GLIB_BINARY_AGE@ +GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@ +GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@ +GLIB_MAJOR_VERSION = @GLIB_MAJOR_VERSION@ +GLIB_MICRO_VERSION = @GLIB_MICRO_VERSION@ +GLIB_MINOR_VERSION = @GLIB_MINOR_VERSION@ +GLIB_VERSION = @GLIB_VERSION@ +GREP = @GREP@ +G_MODULE_BROKEN_RTLD_GLOBAL = @G_MODULE_BROKEN_RTLD_GLOBAL@ +G_MODULE_HAVE_DLERROR = @G_MODULE_HAVE_DLERROR@ +G_MODULE_IMPL = @G_MODULE_IMPL@ +G_MODULE_LDFLAGS = @G_MODULE_LDFLAGS@ +G_MODULE_LIBS = @G_MODULE_LIBS@ +G_MODULE_NEED_USCORE = @G_MODULE_NEED_USCORE@ +G_THREAD_CFLAGS = @G_THREAD_CFLAGS@ +G_THREAD_LIBS = @G_THREAD_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_RELEASE = @LT_RELEASE@ +LT_REVISION = @LT_REVISION@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gmodule \ + -DG_LOG_DOMAIN=\"GModule\" @GLIB_DEBUG_FLAGS@ + +EXTRA_DIST = \ + gmoduleconf.h.in \ + gmodule.def \ + gmodule-dl.c \ + gmodule-dld.c \ + gmodule-win32.c \ + gmoduleconf.h.win32 + +BUILT_SOURCES = gmoduleconf.h +glibincludedir = $(includedir)/glib-1.2 +noinst_HEADERS = \ + gmodule.h + +libglib = $(top_builddir)/libglib.la # -lglib +noinst_LTLIBRARIES = libgmodule.la libgplugin_a.la libgplugin_b.la +libgmodule_la_SOURCES = gmodule.c +libgmodule_la_LDFLAGS = \ + @G_MODULE_LDFLAGS@ \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -release $(LT_RELEASE) \ + -export-dynamic + +libgmodule_la_LIBADD = @G_MODULE_LIBS@ # $(libglib) +# we should really depend on $(libglib) for libgmodule.la, but libtool has a +# problem with this ;( +libgplugin_a_la_SOURCES = libgplugin_a.c +libgplugin_a_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module +libgplugin_a_la_LIBADD = @G_MODULE_LIBS@ # $(libglib) +libgplugin_b_la_SOURCES = libgplugin_b.c +libgplugin_b_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module +libgplugin_b_la_LIBADD = @G_MODULE_LIBS@ # $(libglib) +testgmodule_LDFLAGS = @G_MODULE_LDFLAGS@ +testgmodule_LDADD = libgmodule.la $(libglib) @G_MODULE_LIBS@ +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gmodule/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu gmodule/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +gmoduleconf.h: $(top_builddir)/config.status $(srcdir)/gmoduleconf.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libgmodule.la: $(libgmodule_la_OBJECTS) $(libgmodule_la_DEPENDENCIES) + $(libgmodule_la_LINK) $(libgmodule_la_OBJECTS) $(libgmodule_la_LIBADD) $(LIBS) +libgplugin_a.la: $(libgplugin_a_la_OBJECTS) $(libgplugin_a_la_DEPENDENCIES) + $(libgplugin_a_la_LINK) $(libgplugin_a_la_OBJECTS) $(libgplugin_a_la_LIBADD) $(LIBS) +libgplugin_b.la: $(libgplugin_b_la_OBJECTS) $(libgplugin_b_la_DEPENDENCIES) + $(libgplugin_b_la_LINK) $(libgplugin_b_la_OBJECTS) $(libgplugin_b_la_LIBADD) $(LIBS) + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +testgmodule$(EXEEXT): $(testgmodule_OBJECTS) $(testgmodule_DEPENDENCIES) + @rm -f testgmodule$(EXEEXT) + $(testgmodule_LINK) $(testgmodule_OBJECTS) $(testgmodule_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmodule.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgplugin_a.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgplugin_b.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testgmodule.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) +installdirs: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: all check install install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ + ctags distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + +gmoduleconf.h: gmoduleconf.h.in + +.PHONY: files release + +files: + @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \ + echo $$p; \ + done + +install-libLTLIBRARIES: libgmodule.la + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libdir) + @list='libgmodule.la'; for p in $$list; do \ + if test -f $$p; then \ + echo "$(LIBTOOL) --mode=install $(noinst_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \ + $(LIBTOOL) --mode=install $(noinst_DATA) $$p $(DESTDIR)$(libdir)/$$p; \ + else :; fi; \ + done + +release: + $(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"` + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/glib-1.2.10/gmodule/gmodule-dl.c b/glib-1.2.10/gmodule/gmodule-dl.c new file mode 100644 index 0000000..9b635a7 --- /dev/null +++ b/glib-1.2.10/gmodule/gmodule-dl.c @@ -0,0 +1,158 @@ +/* GMODULE - GLIB wrapper code for dynamic module loading + * Copyright (C) 1998, 2000 Tim Janik + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GLib Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GLib Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GLib at ftp://ftp.gtk.org/pub/gtk/. + */ + +/* + * MT safe + */ + +#include <dlfcn.h> + +/* Perl includes <nlist.h> and <link.h> instead of <dlfcn.h> on some systmes? */ + + +/* dlerror() is not implemented on all systems + */ +#ifndef G_MODULE_HAVE_DLERROR +# ifdef __NetBSD__ +# define dlerror() g_strerror (errno) +# else /* !__NetBSD__ */ +/* could we rely on errno's state here? */ +# define dlerror() "unknown dl-error" +# endif /* !__NetBSD__ */ +#endif /* G_MODULE_HAVE_DLERROR */ + +/* some flags are missing on some systems, so we provide + * harmless defaults. + * The Perl sources say, RTLD_LAZY needs to be defined as (1), + * at least for Solaris 1. + * + * Mandatory: + * RTLD_LAZY - resolve undefined symbols as code from the dynamic library + * is executed. + * RTLD_NOW - resolve all undefined symbols before dlopen returns, and fail + * if this cannot be done. + * Optionally: + * RTLD_GLOBAL - the external symbols defined in the library will be made + * available to subsequently loaded libraries. + */ +#ifndef RTLD_LAZY +#define RTLD_LAZY 1 +#endif /* RTLD_LAZY */ +#ifndef RTLD_NOW +#define RTLD_NOW 0 +#endif /* RTLD_NOW */ +/* some systems (OSF1 V5.0) have broken RTLD_GLOBAL linkage */ +#ifdef G_MODULE_BROKEN_RTLD_GLOBAL +#undef RTLD_GLOBAL +#endif /* G_MODULE_BROKEN_RTLD_GLOBAL */ +#ifndef RTLD_GLOBAL +#define RTLD_GLOBAL 0 +#endif /* RTLD_GLOBAL */ + + +/* --- functions --- */ +static gchar* +fetch_dlerror (void) +{ + gchar *msg = dlerror (); + + /* make sure we always return an error message != NULL */ + + return msg ? msg : "unknown dl-error"; +} + +static gpointer +_g_module_open (const gchar *file_name, + gboolean bind_lazy) +{ + gpointer handle; + + handle = dlopen (file_name, RTLD_GLOBAL | (bind_lazy ? RTLD_LAZY : RTLD_NOW)); + if (!handle) + g_module_set_error (fetch_dlerror ()); + + return handle; +} + +static gpointer +_g_module_self (void) +{ + gpointer handle; + + /* to query symbols from the program itself, special link options + * are required on some systems. + */ + + handle = dlopen (NULL, RTLD_GLOBAL | RTLD_LAZY); + if (!handle) + g_module_set_error (fetch_dlerror ()); + + return handle; +} + +static void +_g_module_close (gpointer handle, + gboolean is_unref) +{ + /* are there any systems out there that have dlopen()/dlclose() + * without a reference count implementation? + */ + is_unref |= 1; + + if (is_unref) + { + if (dlclose (handle) != 0) + g_module_set_error (fetch_dlerror ()); + } +} + +static gpointer +_g_module_symbol (gpointer handle, + const gchar *symbol_name) +{ + gpointer p; + + p = dlsym (handle, symbol_name); + if (!p) + g_module_set_error (fetch_dlerror ()); + + return p; +} + +static gchar* +_g_module_build_path (const gchar *directory, + const gchar *module_name) +{ + if (directory && *directory) { + if (strncmp (module_name, "lib", 3) == 0) + return g_strconcat (directory, "/", module_name, NULL); + else + return g_strconcat (directory, "/lib", module_name, ".so", NULL); + } else if (strncmp (module_name, "lib", 3) == 0) + return g_strdup (module_name); + else + return g_strconcat ("lib", module_name, ".so", NULL); +} diff --git a/glib-1.2.10/gmodule/gmodule-dld.c b/glib-1.2.10/gmodule/gmodule-dld.c new file mode 100644 index 0000000..1d1391a --- /dev/null +++ b/glib-1.2.10/gmodule/gmodule-dld.c @@ -0,0 +1,150 @@ +/* GMODULE - GLIB wrapper code for dynamic module loading + * Copyright (C) 1998, 2000 Tim Janik + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GLib Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GLib Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GLib at ftp://ftp.gtk.org/pub/gtk/. + */ + +/* + * MT safe + */ + +#include <dl.h> + + +/* some flags are missing on some systems, so we provide + * harmless defaults. + * + * Mandatory: + * BIND_IMMEDIATE - Resolve symbol references when the library is loaded. + * BIND_DEFERRED - Delay code symbol resolution until actual reference. + * + * Optionally: + * BIND_FIRST - Place the library at the head of the symbol search order. + * BIND_NONFATAL - The default BIND_IMMEDIATE behavior is to treat all unsatisfied + * symbols as fatal. This flag allows binding of unsatisfied code + * symbols to be deferred until use. + * [Perl: For certain libraries, like DCE, deferred binding often + * causes run time problems. Adding BIND_NONFATAL to BIND_IMMEDIATE + * still allows unresolved references in situations like this.] + * BIND_NOSTART - Do not call the initializer for the shared library when the + * library is loaded, nor on a future call to shl_unload(). + * BIND_VERBOSE - Print verbose messages concerning possible unsatisfied symbols. + * + * hp9000s700/hp9000s800: + * BIND_RESTRICTED - Restrict symbols visible by the library to those present at + * library load time. + * DYNAMIC_PATH - Allow the loader to dynamically search for the library specified + * by the path argument. + */ +#ifndef DYNAMIC_PATH +#define DYNAMIC_PATH 0 +#endif /* DYNAMIC_PATH */ +#ifndef BIND_RESTRICTED +#define BIND_RESTRICTED 0 +#endif /* BIND_RESTRICTED */ + +#define OPT_BIND_FLAGS (BIND_NONFATAL | BIND_VERBOSE) + + +/* --- functions --- */ +static gpointer +_g_module_open (const gchar *file_name, + gboolean bind_lazy) +{ + shl_t shl_handle; + + shl_handle = shl_load (file_name, + (bind_lazy ? BIND_DEFERRED : BIND_IMMEDIATE) | OPT_BIND_FLAGS, 0); + if (!shl_handle) + { + /* the hp-docs say we should better abort() if errno==ENOSYM ;( */ + g_module_set_error (g_strerror (errno)); + } + + return (gpointer) shl_handle; +} + +static gpointer +_g_module_self (void) +{ + shl_t shl_handle; + + shl_handle = PROG_HANDLE; + if (!shl_handle) + g_module_set_error (g_strerror (errno)); + + return shl_handle; +} + +static void +_g_module_close (gpointer handle, + gboolean is_unref) +{ + if (!is_unref) + { + if (shl_unload ((shl_t) handle) != 0) + g_module_set_error (g_strerror (errno)); + } +} + +static gpointer +_g_module_symbol (gpointer handle, + const gchar *symbol_name) +{ + gpointer p = NULL; + + /* should we restrict lookups to TYPE_PROCEDURE? + */ + if (handle == PROG_HANDLE) + { + /* PROG_HANDLE will only lookup symbols in the program itself, not honouring + * libraries. passing NULL as a handle will also try to lookup the symbol + * in currently loaded libraries. fix pointed out and supplied by: + * David Gero <dgero@nortelnetworks.com> + */ + handle = NULL; + } + if (shl_findsym ((shl_t*) &handle, symbol_name, TYPE_UNDEFINED, &p) != 0 || + handle == NULL || p == NULL) + { + /* the hp-docs say we should better abort() if errno==ENOSYM ;( */ + g_module_set_error (g_strerror (errno)); + } + + return p; +} + +static gchar* +_g_module_build_path (const gchar *directory, + const gchar *module_name) +{ + if (directory && *directory) + if (strncmp (module_name, "lib", 3) == 0) + return g_strconcat (directory, "/", module_name, NULL); + else + return g_strconcat (directory, "/lib", module_name, ".sl", NULL); + else if (strncmp (module_name, "lib", 3) == 0) + return g_strdup (module_name); + else + return g_strconcat ("lib", module_name, ".sl", NULL); +} diff --git a/glib-1.2.10/gmodule/gmodule-win32.c b/glib-1.2.10/gmodule/gmodule-win32.c new file mode 100644 index 0000000..8d021e1 --- /dev/null +++ b/glib-1.2.10/gmodule/gmodule-win32.c @@ -0,0 +1,120 @@ +/* GMODULE - GLIB wrapper code for dynamic module loading + * Copyright (C) 1998, 2000 Tim Janik + * + * WIN32 GMODULE implementation + * Copyright (C) 1998 Tor Lillqvist + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GLib Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GLib Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GLib at ftp://ftp.gtk.org/pub/gtk/. + */ + +/* + * MT safe + */ + +#include <stdio.h> +#include <windows.h> + +/* --- functions --- */ +static gpointer +_g_module_open (const gchar *file_name, + gboolean bind_lazy) +{ + HINSTANCE handle; + + handle = LoadLibrary (file_name); + if (!handle) + { + gchar error[100]; + + sprintf (error, "Error code %d", GetLastError ()); + g_module_set_error (error); + } + + return handle; +} + +static gpointer +_g_module_self (void) +{ + HMODULE handle; + + handle = GetModuleHandle (NULL); + if (!handle) + { + gchar error[100]; + + sprintf (error, "Error code %d", GetLastError ()); + g_module_set_error (error); + } + + return handle; +} + +static void +_g_module_close (gpointer handle, + gboolean is_unref) +{ + if (!FreeLibrary (handle)) + { + gchar error[100]; + + sprintf (error, "Error code %d", GetLastError ()); + g_module_set_error (error); + } +} + +static gpointer +_g_module_symbol (gpointer handle, + const gchar *symbol_name) +{ + gpointer p; + + p = GetProcAddress (handle, symbol_name); + if (!p) + { + gchar error[100]; + + sprintf (error, "Error code %d", GetLastError ()); + g_module_set_error (error); + } + + return p; +} + +static gchar* +_g_module_build_path (const gchar *directory, + const gchar *module_name) +{ + gint k; + + k = strlen (module_name); + if (directory && *directory) + if (k > 4 && g_strcasecmp (module_name + k - 4, ".dll") == 0) + return g_strconcat (directory, "\\", module_name, NULL); + else + return g_strconcat (directory, "\\", module_name, ".dll", NULL); + else if (k > 4 && g_strcasecmp (module_name + k - 4, ".dll") == 0) + return g_strdup (module_name); + else + return g_strconcat (module_name, ".dll", NULL); +} diff --git a/glib-1.2.10/gmodule/gmodule.c b/glib-1.2.10/gmodule/gmodule.c new file mode 100644 index 0000000..b2051b9 --- /dev/null +++ b/glib-1.2.10/gmodule/gmodule.c @@ -0,0 +1,418 @@ +/* GMODULE - GLIB wrapper code for dynamic module loading + * Copyright (C) 1998 Tim Janik + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GLib Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GLib Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GLib at ftp://ftp.gtk.org/pub/gtk/. + */ + +/* + * MT safe + */ + +#include "gmodule.h" +#include "gmoduleconf.h" +#include <errno.h> +#include <string.h> + + +/* We maintain a list of modules, so we can reference count them. + * That's needed because some platforms don't support refernce counts on + * modules e.g. the shl_* implementation of HP-UX + * (http://www.stat.umn.edu/~luke/xls/projects/dlbasics/dlbasics.html). + * Also, the module for the program itself is kept seperatedly for + * faster access and because it has special semantics. + */ + + +/* --- structures --- */ +struct _GModule +{ + gchar *file_name; + gpointer handle; + guint ref_count : 31; + guint is_resident : 1; + GModuleUnload unload; + GModule *next; +}; + + +/* --- prototypes --- */ +static gpointer _g_module_open (const gchar *file_name, + gboolean bind_lazy); +static void _g_module_close (gpointer handle, + gboolean is_unref); +static gpointer _g_module_self (void); +static gpointer _g_module_symbol (gpointer handle, + const gchar *symbol_name); +static gchar* _g_module_build_path (const gchar *directory, + const gchar *module_name); +static inline void g_module_set_error (const gchar *error); +static inline GModule* g_module_find_by_handle (gpointer handle); +static inline GModule* g_module_find_by_name (const gchar *name); + + +/* --- variables --- */ +G_LOCK_DEFINE_STATIC (GModule); +static GModule *modules = NULL; +static GModule *main_module = NULL; +static GStaticPrivate module_error_private = G_STATIC_PRIVATE_INIT; + + +/* --- inline functions --- */ +static inline GModule* +g_module_find_by_handle (gpointer handle) +{ + GModule *module; + GModule *retval = NULL; + + G_LOCK (GModule); + if (main_module && main_module->handle == handle) + retval = main_module; + else + for (module = modules; module; module = module->next) + if (handle == module->handle) + { + retval = module; + break; + } + G_UNLOCK (GModule); + + return retval; +} + +static inline GModule* +g_module_find_by_name (const gchar *name) +{ + GModule *module; + GModule *retval = NULL; + + G_LOCK (GModule); + for (module = modules; module; module = module->next) + if (strcmp (name, module->file_name) == 0) + { + retval = module; + break; + } + G_UNLOCK (GModule); + + return retval; +} + +static inline void +g_module_set_error (const gchar *error) +{ + g_static_private_set (&module_error_private, g_strdup (error), g_free); + errno = 0; +} + + +/* --- include platform specifc code --- */ +#define SUPPORT_OR_RETURN(rv) { g_module_set_error (NULL); } +#if (G_MODULE_IMPL == G_MODULE_IMPL_DL) +#include "gmodule-dl.c" +#elif (G_MODULE_IMPL == G_MODULE_IMPL_DLD) +#include "gmodule-dld.c" +#elif (G_MODULE_IMPL == G_MODULE_IMPL_WIN32) +#include "gmodule-win32.c" +#else +#undef SUPPORT_OR_RETURN +#define SUPPORT_OR_RETURN(rv) { g_module_set_error ("dynamic modules are " \ + "not supported by this system"); return rv; } +static gpointer +_g_module_open (const gchar *file_name, + gboolean bind_lazy) +{ + return NULL; +} +static void +_g_module_close (gpointer handle, + gboolean is_unref) +{ +} +static gpointer +_g_module_self (void) +{ + return NULL; +} +static gpointer +_g_module_symbol (gpointer handle, + const gchar *symbol_name) +{ + return NULL; +} +static gchar* +_g_module_build_path (const gchar *directory, + const gchar *module_name) +{ + return NULL; +} +#endif /* no implementation */ + +#if defined (NATIVE_WIN32) && defined (__LCC__) +int __stdcall +LibMain (void *hinstDll, + unsigned long dwReason, + void *reserved) +{ + return 1; +} +#endif /* NATIVE_WIN32 && __LCC__ */ + + +/* --- functions --- */ +gboolean +g_module_supported (void) +{ + SUPPORT_OR_RETURN (FALSE); + + return TRUE; +} + +GModule* +g_module_open (const gchar *file_name, + GModuleFlags flags) +{ + GModule *module; + gpointer handle; + + SUPPORT_OR_RETURN (NULL); + + if (!file_name) + { + G_LOCK (GModule); + if (!main_module) + { + handle = _g_module_self (); + if (handle) + { + main_module = g_new (GModule, 1); + main_module->file_name = NULL; + main_module->handle = handle; + main_module->ref_count = 1; + main_module->is_resident = TRUE; + main_module->unload = NULL; + main_module->next = NULL; + } + } + G_UNLOCK (GModule); + + return main_module; + } + + /* we first search the module list by name */ + module = g_module_find_by_name (file_name); + if (module) + { + module->ref_count++; + + return module; + } + + /* open the module */ + handle = _g_module_open (file_name, (flags & G_MODULE_BIND_LAZY) != 0); + if (handle) + { + gchar *saved_error; + GModuleCheckInit check_init; + const gchar *check_failed = NULL; + + /* search the module list by handle, since file names are not unique */ + module = g_module_find_by_handle (handle); + if (module) + { + _g_module_close (module->handle, TRUE); + module->ref_count++; + g_module_set_error (NULL); + + return module; + } + + saved_error = g_strdup (g_module_error ()); + g_module_set_error (NULL); + + module = g_new (GModule, 1); + module->file_name = g_strdup (file_name); + module->handle = handle; + module->ref_count = 1; + module->is_resident = FALSE; + module->unload = NULL; + G_LOCK (GModule); + module->next = modules; + modules = module; + G_UNLOCK (GModule); + + /* check initialization */ + if (g_module_symbol (module, "g_module_check_init", (gpointer) &check_init)) + check_failed = check_init (module); + + /* we don't call unload() if the initialization check failed. */ + if (!check_failed) + g_module_symbol (module, "g_module_unload", (gpointer) &module->unload); + + if (check_failed) + { + gchar *error; + + error = g_strconcat ("GModule initialization check failed: ", check_failed, NULL); + g_module_close (module); + module = NULL; + g_module_set_error (error); + g_free (error); + } + else + g_module_set_error (saved_error); + + g_free (saved_error); + } + + return module; +} + +gboolean +g_module_close (GModule *module) +{ + SUPPORT_OR_RETURN (FALSE); + + g_return_val_if_fail (module != NULL, FALSE); + g_return_val_if_fail (module->ref_count > 0, FALSE); + + module->ref_count--; + + if (!module->ref_count && !module->is_resident && module->unload) + { + GModuleUnload unload; + + unload = module->unload; + module->unload = NULL; + unload (module); + } + + if (!module->ref_count && !module->is_resident) + { + GModule *last; + GModule *node; + + last = NULL; + + G_LOCK (GModule); + node = modules; + while (node) + { + if (node == module) + { + if (last) + last->next = node->next; + else + modules = node->next; + break; + } + last = node; + node = last->next; + } + module->next = NULL; + G_UNLOCK (GModule); + + _g_module_close (module->handle, FALSE); + g_free (module->file_name); + + g_free (module); + } + + return g_module_error() == NULL; +} + +void +g_module_make_resident (GModule *module) +{ + g_return_if_fail (module != NULL); + + module->is_resident = TRUE; +} + +gchar* +g_module_error (void) +{ + return g_static_private_get (&module_error_private); +} + +gboolean +g_module_symbol (GModule *module, + const gchar *symbol_name, + gpointer *symbol) +{ + gchar *module_error; + + if (symbol) + *symbol = NULL; + SUPPORT_OR_RETURN (FALSE); + + g_return_val_if_fail (module != NULL, FALSE); + g_return_val_if_fail (symbol_name != NULL, FALSE); + g_return_val_if_fail (symbol != NULL, FALSE); + +#ifdef G_MODULE_NEED_USCORE + { + gchar *name; + + name = g_strconcat ("_", symbol_name, NULL); + *symbol = _g_module_symbol (module->handle, name); + g_free (name); + } +#else /* !G_MODULE_NEED_USCORE */ + *symbol = _g_module_symbol (module->handle, symbol_name); +#endif /* !G_MODULE_NEED_USCORE */ + + module_error = g_module_error (); + if (module_error) + { + gchar *error; + + error = g_strconcat ("`", symbol_name, "': ", module_error, NULL); + g_module_set_error (error); + g_free (error); + *symbol = NULL; + + return FALSE; + } + + return TRUE; +} + +gchar* +g_module_name (GModule *module) +{ + g_return_val_if_fail (module != NULL, NULL); + + if (module == main_module) + return "main"; + + return module->file_name; +} + +gchar* +g_module_build_path (const gchar *directory, + const gchar *module_name) +{ + g_return_val_if_fail (module_name != NULL, NULL); + + return _g_module_build_path (directory, module_name); +} diff --git a/glib-1.2.10/gmodule/gmodule.def b/glib-1.2.10/gmodule/gmodule.def new file mode 100644 index 0000000..11e0d5d --- /dev/null +++ b/glib-1.2.10/gmodule/gmodule.def @@ -0,0 +1,9 @@ +EXPORTS + g_module_build_path + g_module_close + g_module_error + g_module_make_resident + g_module_name + g_module_open + g_module_supported + g_module_symbol diff --git a/glib-1.2.10/gmodule/gmodule.h b/glib-1.2.10/gmodule/gmodule.h new file mode 100644 index 0000000..c9c8fa2 --- /dev/null +++ b/glib-1.2.10/gmodule/gmodule.h @@ -0,0 +1,100 @@ +/* GMODULE - GLIB wrapper code for dynamic module loading + * Copyright (C) 1998 Tim Janik + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GLib Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GLib Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GLib at ftp://ftp.gtk.org/pub/gtk/. + */ + +#ifndef __GMODULE_H__ +#define __GMODULE_H__ + +#include <glib.h> + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* exporting and importing functions, this is special cased + * to feature Windows dll stubs. + */ +#define G_MODULE_IMPORT extern +#ifdef NATIVE_WIN32 +# define G_MODULE_EXPORT __declspec(dllexport) +#else /* !NATIVE_WIN32 */ +# define G_MODULE_EXPORT +#endif /* !NATIVE_WIN32 */ + +typedef enum +{ + G_MODULE_BIND_LAZY = 1 << 0, + G_MODULE_BIND_MASK = 0x01 +} GModuleFlags; + +typedef struct _GModule GModule; +typedef const gchar* (*GModuleCheckInit) (GModule *module); +typedef void (*GModuleUnload) (GModule *module); + +/* return TRUE if dynamic module loading is supported */ +gboolean g_module_supported (void); + +/* open a module `file_name' and return handle, which is NULL on error */ +GModule* g_module_open (const gchar *file_name, + GModuleFlags flags); + +/* close a previously opened module, returns TRUE on success */ +gboolean g_module_close (GModule *module); + +/* make a module resident so g_module_close on it will be ignored */ +void g_module_make_resident (GModule *module); + +/* query the last module error as a string */ +gchar* g_module_error (void); + +/* retrive a symbol pointer from `module', returns TRUE on success */ +gboolean g_module_symbol (GModule *module, + const gchar *symbol_name, + gpointer *symbol); + +/* retrive the file name from an existing module */ +gchar* g_module_name (GModule *module); + + +/* Build the actual file name containing a module. `directory' is the + * directory where the module file is supposed to be, or NULL or empty + * in which case it should either be in the current directory or, on + * some operating systems, in some standard place, for instance on the + * PATH. Hence, to be absoultely sure to get the correct module, + * always pass in a directory. The file name consists of the directory, + * if supplied, and `module_name' suitably decorated accoring to + * the operating system's conventions (for instance lib*.so or *.dll). + * + * No checks are made that the file exists, or is of correct type. + */ +gchar* g_module_build_path (const gchar *directory, + const gchar *module_name); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __GMODULE_H__ */ diff --git a/glib-1.2.10/gmodule/gmoduleconf.h b/glib-1.2.10/gmodule/gmoduleconf.h new file mode 100644 index 0000000..1f9373d --- /dev/null +++ b/glib-1.2.10/gmodule/gmoduleconf.h @@ -0,0 +1,51 @@ +/* GMODULE - GLIB wrapper code for dynamic module loading + * Copyright (C) 1998 Tim Janik + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef __G_MODULE_CONF_H__ +#define __G_MODULE_CONF_H__ + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +#define G_MODULE_IMPL_NONE 0 +#define G_MODULE_IMPL_DL 1 +#define G_MODULE_IMPL_DLD 2 +#define G_MODULE_IMPL_WIN32 3 + +#define G_MODULE_IMPL G_MODULE_IMPL_DL +#undef G_MODULE_HAVE_DLERROR +#if (1) +#define G_MODULE_HAVE_DLERROR +#endif +#if (0) || defined (hp9000s300) || defined (__hp9000s300) || defined (__hp9000s300__) +#define G_MODULE_NEED_USCORE +#endif +#if (0) +#define G_MODULE_BROKEN_RTLD_GLOBAL +#endif + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __G_MODULE_CONF_H__ */ diff --git a/glib-1.2.10/gmodule/gmoduleconf.h.in b/glib-1.2.10/gmodule/gmoduleconf.h.in new file mode 100644 index 0000000..cad0816 --- /dev/null +++ b/glib-1.2.10/gmodule/gmoduleconf.h.in @@ -0,0 +1,51 @@ +/* GMODULE - GLIB wrapper code for dynamic module loading + * Copyright (C) 1998 Tim Janik + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef __G_MODULE_CONF_H__ +#define __G_MODULE_CONF_H__ + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +#define G_MODULE_IMPL_NONE 0 +#define G_MODULE_IMPL_DL 1 +#define G_MODULE_IMPL_DLD 2 +#define G_MODULE_IMPL_WIN32 3 + +#define G_MODULE_IMPL @G_MODULE_IMPL@ +#undef G_MODULE_HAVE_DLERROR +#if (@G_MODULE_HAVE_DLERROR@) +#define G_MODULE_HAVE_DLERROR +#endif +#if (@G_MODULE_NEED_USCORE@) || defined (hp9000s300) || defined (__hp9000s300) || defined (__hp9000s300__) +#define G_MODULE_NEED_USCORE +#endif +#if (@G_MODULE_BROKEN_RTLD_GLOBAL@) +#define G_MODULE_BROKEN_RTLD_GLOBAL +#endif + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __G_MODULE_CONF_H__ */ diff --git a/glib-1.2.10/gmodule/gmoduleconf.h.win32 b/glib-1.2.10/gmodule/gmoduleconf.h.win32 new file mode 100644 index 0000000..9d4fcf9 --- /dev/null +++ b/glib-1.2.10/gmodule/gmoduleconf.h.win32 @@ -0,0 +1,45 @@ +/* GMODULE - GLIB wrapper code for dynamic module loading + * Copyright (C) 1998 Tim Janik + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef __G_MODULE_CONF_H__ +#define __G_MODULE_CONF_H__ + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +#define G_MODULE_IMPL_NONE 0 +#define G_MODULE_IMPL_DL 1 +#define G_MODULE_IMPL_DLD 2 +#define G_MODULE_IMPL_WIN32 3 + +#define G_MODULE_IMPL G_MODULE_IMPL_WIN32 +#undef G_MODULE_HAVE_DLERROR + +#ifdef __LCC__ +#define G_MODULE_NEED_USCORE +#endif + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __G_MODULE_CONF_H__ */ diff --git a/glib-1.2.10/gmodule/libgplugin_a.c b/glib-1.2.10/gmodule/libgplugin_a.c new file mode 100644 index 0000000..3da2da4 --- /dev/null +++ b/glib-1.2.10/gmodule/libgplugin_a.c @@ -0,0 +1,82 @@ +/* libgplugin_a.c - test plugin for testgmodule + * Copyright (C) 1998 Tim Janik + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GLib Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GLib Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GLib at ftp://ftp.gtk.org/pub/gtk/. + */ + +#include <gmodule.h> +#include <stdlib.h> + +#if defined (NATIVE_WIN32) && defined (__LCC__) +int __stdcall +LibMain(void *hinstDll, + unsigned long dwReason, + void *reserved) +{ + return 1; +} +#endif /* NATIVE_WIN32 && __LCC__ */ + +G_MODULE_EXPORT void +gplugin_a_func (void) +{ + g_print ("GPluginA: Hello world\n"); +} + +G_MODULE_EXPORT void +gplugin_clash_func (void) +{ + g_print ("GPluginA: Hello plugin clash\n"); +} + +G_MODULE_EXPORT void +g_clash_func (void) +{ + g_print ("GPluginA: Hello global clash\n"); +} + +G_MODULE_EXPORT void +gplugin_say_boo_func (void) +{ + g_print ("GPluginA: BOOH!\n"); +} + +G_MODULE_EXPORT void +gplugin_a_module_func (GModule *module) +{ + void (*f) (void) = NULL; + gchar *string; + + string = "gplugin_say_boo_func"; + g_print ("GPluginA: retrive symbol `%s' from \"%s\"\n", + string, + g_basename (g_module_name (module))); + if (!g_module_symbol (module, string, (gpointer) &f)) + { + g_print ("error: %s\n", g_module_error ()); + exit (1); + } + + g_print ("GPluginA: call that function(%p): ", f); + f (); +} diff --git a/glib-1.2.10/gmodule/libgplugin_b.c b/glib-1.2.10/gmodule/libgplugin_b.c new file mode 100644 index 0000000..109e048 --- /dev/null +++ b/glib-1.2.10/gmodule/libgplugin_b.c @@ -0,0 +1,75 @@ +/* libgplugin_b.c - test plugin for testgmodule + * Copyright (C) 1998 Tim Janik + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GLib Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GLib Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GLib at ftp://ftp.gtk.org/pub/gtk/. + */ + +#include <gmodule.h> + +#if defined (NATIVE_WIN32) && defined (__LCC__) +int __stdcall +LibMain(void *hinstDll, + unsigned long dwReason, + void *reserved) +{ + return 1; +} +#endif /* NATIVE_WIN32 && __LCC__ */ + +G_MODULE_EXPORT const gchar* +g_module_check_init (GModule *module) +{ + g_print ("GPluginB: check-init\n"); + + return NULL; +} + +G_MODULE_EXPORT void +g_module_unload (GModule *module) +{ + g_print ("GPluginB: unloaded\n"); +} + +G_MODULE_EXPORT void +gplugin_b_func (void) +{ + g_print ("GPluginB: Hello world\n"); +} + +G_MODULE_EXPORT void +gplugin_clash_func (void) +{ + g_print ("GPluginB: Hello plugin clash\n"); +} + +G_MODULE_EXPORT void +g_clash_func (void) +{ + g_print ("GPluginB: Hello global clash\n"); +} + +G_MODULE_EXPORT void +gplugin_say_boo_func (void) +{ + g_print ("GPluginB: BOOH!\n"); +} diff --git a/glib-1.2.10/gmodule/testgmodule.c b/glib-1.2.10/gmodule/testgmodule.c new file mode 100644 index 0000000..09b7603 --- /dev/null +++ b/glib-1.2.10/gmodule/testgmodule.c @@ -0,0 +1,207 @@ +/* testgmodule.c - test program for GMODULE + * Copyright (C) 1998 Tim Janik + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GLib Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GLib Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GLib at ftp://ftp.gtk.org/pub/gtk/. + */ + +#undef G_LOG_DOMAIN +#include <gmodule.h> +#include "gmoduleconf.h" + + +G_MODULE_EXPORT void +g_clash_func (void) +{ + g_print ("GModule: Hello global clash\n"); +} + +typedef void (*SimpleFunc) (void); +typedef void (*GModuleFunc) (GModule *); + +static SimpleFunc plugin_clash_func = NULL; + +int +main (int arg, + char *argv[]) +{ + GModule *module_self, *module_a, *module_b; + gchar *string; + gchar *plugin_a, *plugin_b; + SimpleFunc f_a, f_b, f_self; + GModuleFunc gmod_f; + + string = g_get_current_dir (); + g_print ("testgmodule (%s):\n", string); + +#ifdef NATIVE_WIN32 + plugin_a = g_strconcat (string, "\\libgplugin_a.dll", NULL); + plugin_b = g_strconcat (string, "\\libgplugin_b.dll", NULL); +#elif (G_MODULE_IMPL == G_MODULE_IMPL_DLD) + plugin_a = g_strconcat (string, "/.libs/", "libgplugin_a.sl", NULL); + plugin_b = g_strconcat (string, "/.libs/", "libgplugin_b.sl", NULL); +#else /* G_MODULE_IMPL != G_MODULE_IMPL_DLD && !NATIVE_WIN32 */ + plugin_a = g_strconcat (string, "/.libs/", "libgplugin_a.so", NULL); + plugin_b = g_strconcat (string, "/.libs/", "libgplugin_b.so", NULL); +#endif /* G_MODULE_IMPL != G_MODULE_IMPL_DLD && !NATIVE_WIN32 */ + g_free (string); + + /* module handles + */ + g_print ("get main module handle\n"); + module_self = g_module_open (NULL, G_MODULE_BIND_LAZY); + if (!module_self) + { + g_print ("error: %s\n", g_module_error ()); + return 1; + } + g_print ("check that not yet bound symbols in shared libraries of main module are retrievable:\n"); + string = "g_module_close"; + g_print ("retrive symbol `%s' from \"%s\":\n", string, g_basename (g_module_name (module_self))); + if (!g_module_symbol (module_self, string, (gpointer) &f_self)) + { + g_print ("error: %s\n", g_module_error ()); + return 1; + } + g_print ("retrived symbol `%s' as %p\n", string, f_self); + g_print ("load plugin from \"%s\"\n", plugin_a); + module_a = g_module_open (plugin_a, G_MODULE_BIND_LAZY); + if (!module_a) + { + g_print ("error: %s\n", g_module_error ()); + return 1; + } + g_print ("load plugin from \"%s\"\n", plugin_b); + module_b = g_module_open (plugin_b, G_MODULE_BIND_LAZY); + if (!module_b) + { + g_print ("error: %s\n", g_module_error ()); + return 1; + } + + /* get plugin specific symbols and call them + */ + string = "gplugin_a_func"; + g_print ("retrive symbol `%s' from \"%s\"\n", string, g_basename (g_module_name (module_a))); + if (!g_module_symbol (module_a, string, (gpointer) &f_a)) + { + g_print ("error: %s\n", g_module_error ()); + return 1; + } + string = "gplugin_b_func"; + g_print ("retrive symbol `%s' from \"%s\"\n", string, g_basename (g_module_name (module_b))); + if (!g_module_symbol (module_b, string, (gpointer) &f_b)) + { + g_print ("error: %s\n", g_module_error ()); + return 1; + } + g_print ("call plugin function(%p) A: ", f_a); + f_a (); + g_print ("call plugin function(%p) B: ", f_b); + f_b (); + + /* get and call globally clashing functions + */ + string = "g_clash_func"; + g_print ("retrive symbol `%s' from \"%s\"\n", string, g_basename (g_module_name (module_self))); + if (!g_module_symbol (module_self, string, (gpointer) &f_self)) + { + g_print ("error: %s\n", g_module_error ()); + return 1; + } + g_print ("retrive symbol `%s' from \"%s\"\n", string, g_basename (g_module_name (module_a))); + if (!g_module_symbol (module_a, string, (gpointer) &f_a)) + { + g_print ("error: %s\n", g_module_error ()); + return 1; + } + g_print ("retrive symbol `%s' from \"%s\"\n", string, g_basename (g_module_name (module_b))); + if (!g_module_symbol (module_b, string, (gpointer) &f_b)) + { + g_print ("error: %s\n", g_module_error ()); + return 1; + } + g_print ("call plugin function(%p) self: ", f_self); + f_self (); + g_print ("call plugin function(%p) A: ", f_a); + f_a (); + g_print ("call plugin function(%p) B: ", f_b); + f_b (); + + /* get and call clashing plugin functions + */ + string = "gplugin_clash_func"; + g_print ("retrive symbol `%s' from \"%s\"\n", string, g_basename (g_module_name (module_self))); + if (!g_module_symbol (module_self, string, (gpointer) &f_self)) + f_self = NULL; + g_print ("retrived function `%s' from self: %p\n", string, f_self); + g_print ("retrive symbol `%s' from \"%s\"\n", string, g_basename (g_module_name (module_a))); + if (!g_module_symbol (module_a, string, (gpointer) &f_a)) + { + g_print ("error: %s\n", g_module_error ()); + return 1; + } + g_print ("retrive symbol `%s' from \"%s\"\n", string, g_basename (g_module_name (module_b))); + if (!g_module_symbol (module_b, string, (gpointer) &f_b)) + { + g_print ("error: %s\n", g_module_error ()); + return 1; + } + g_print ("call plugin function(%p) A: ", f_a); + plugin_clash_func = f_a; + plugin_clash_func (); + g_print ("call plugin function(%p) B: ", f_b); + plugin_clash_func = f_b; + plugin_clash_func (); + + /* call gmodule function form A + */ + string = "gplugin_a_module_func"; + g_print ("retrive symbol `%s' from \"%s\"\n", string, g_basename (g_module_name (module_a))); + if (!g_module_symbol (module_a, string, (gpointer) &gmod_f)) + { + g_print ("error: %s\n", g_module_error ()); + return 1; + } + g_print ("call plugin A's module function(%p):\n{\n", gmod_f); + gmod_f (module_b); + g_print ("}\n"); + + + /* unload plugins + */ + g_print ("unload plugin A:\n"); + if (!g_module_close (module_a)) + g_print ("error: %s\n", g_module_error ()); + g_print ("unload plugin B:\n"); + if (!g_module_close (module_b)) + g_print ("error: %s\n", g_module_error ()); + +#if 0 + g_log_set_fatal_mask ("GModule", G_LOG_FATAL_MASK|G_LOG_LEVEL_WARNING); + g_module_symbol (0, 0, 0); + g_warning("jahooo"); + g_on_error_query (".libs/testgmodule"); +#endif + + return 0; +} |