Mercurial > hg > xemacs-beta
annotate src/sysdll.c @ 5492:e82f5b7010fe
Merge some stuff in man, fix up Makefile
-------------------- ChangeLog entries follow: --------------------
man/ChangeLog addition:
2010-02-19 Ben Wing <ben@xemacs.org>
* widget.texi:
* widget.texi (Top):
* widget.texi (Introduction):
* widget.texi (User Interface):
* widget.texi (Programming Example):
* widget.texi (Setting Up the Buffer):
* widget.texi (Basic Types):
* widget.texi (link):
* widget.texi (url-link):
* widget.texi (info-link):
* widget.texi (push-button):
* widget.texi (editable-field):
* widget.texi (text):
* widget.texi (menu-choice):
* widget.texi (radio-button-choice):
* widget.texi (item):
* widget.texi (choice-item):
* widget.texi (toggle):
* widget.texi (checkbox):
* widget.texi (checklist):
* widget.texi (editable-list):
* widget.texi (group):
* widget.texi (Sexp Types):
* widget.texi (constants):
* widget.texi (generic):
* widget.texi (atoms):
* widget.texi (composite):
* widget.texi (Widget Properties):
* widget.texi (Defining New Widgets):
* widget.texi (Widget Browser):
* widget.texi (Widget Minor Mode):
* widget.texi (Utilities):
* widget.texi (Widget Wishlist):
* widget.texi (Widget Internals):
* widget.texi (GNU Free Documentation License):
* widget.texi (Index):
Sync with FSF 23.1.92.
2010-02-19 Ben Wing <ben@xemacs.org>
* texinfo/fdl.texi: New file.
* texinfo/texinfo.texi:
* texinfo/texinfo.texi (Top):
* texinfo/texinfo.texi (Copying Conditions):
* texinfo/texinfo.texi (Overview):
* texinfo/texinfo.texi (Reporting Bugs):
* texinfo/texinfo.texi (Using Texinfo):
* texinfo/texinfo.texi (Output Formats):
* texinfo/texinfo.texi (Info Files):
* texinfo/texinfo.texi (Printed Books):
* texinfo/texinfo.texi (Formatting Commands):
* texinfo/texinfo.texi (Conventions):
* texinfo/texinfo.texi (Comments):
* texinfo/texinfo.texi (Minimum):
* texinfo/texinfo.texi (Six Parts):
* texinfo/texinfo.texi (Short Sample):
* texinfo/texinfo.texi (History):
* texinfo/texinfo.texi (Texinfo Mode):
* texinfo/texinfo.texi (Texinfo Mode Overview):
* texinfo/texinfo.texi (XEmacs Editing):
* texinfo/texinfo.texi (Inserting):
* texinfo/texinfo.texi (Showing the Structure):
* texinfo/texinfo.texi (Updating Nodes and Menus):
* texinfo/texinfo.texi (Updating Commands):
* texinfo/texinfo.texi (Updating Requirements):
* texinfo/texinfo.texi (Other Updating Commands):
* texinfo/texinfo.texi (Info Formatting):
* texinfo/texinfo.texi (Printing):
* texinfo/texinfo.texi (Texinfo Mode Summary):
* texinfo/texinfo.texi (Beginning a File):
* texinfo/texinfo.texi (Sample Beginning):
* texinfo/texinfo.texi (Texinfo File Header):
* texinfo/texinfo.texi (First Line):
* texinfo/texinfo.texi (Start of Header):
* texinfo/texinfo.texi (setfilename):
* texinfo/texinfo.texi (settitle):
* texinfo/texinfo.texi (End of Header):
* texinfo/texinfo.texi (Document Permissions):
* texinfo/texinfo.texi (copying):
* texinfo/texinfo.texi (insertcopying):
* texinfo/texinfo.texi (Titlepage & Copyright Page):
* texinfo/texinfo.texi (titlepage):
* texinfo/texinfo.texi (titlefont center sp):
* texinfo/texinfo.texi (title subtitle author):
* texinfo/texinfo.texi (Copyright):
* texinfo/texinfo.texi (end titlepage):
* texinfo/texinfo.texi (headings on off):
* texinfo/texinfo.texi (Contents):
* texinfo/texinfo.texi (The Top Node):
* texinfo/texinfo.texi (Top Node Example):
* texinfo/texinfo.texi (Master Menu Parts):
* texinfo/texinfo.texi (Global Document Commands):
* texinfo/texinfo.texi (documentdescription):
* texinfo/texinfo.texi (setchapternewpage):
* texinfo/texinfo.texi (paragraphindent):
* texinfo/texinfo.texi (firstparagraphindent):
* texinfo/texinfo.texi (exampleindent):
* texinfo/texinfo.texi (Software Copying Permissions):
* texinfo/texinfo.texi (Ending a File):
* texinfo/texinfo.texi (Printing Indices & Menus):
* texinfo/texinfo.texi (File End):
* texinfo/texinfo.texi (Structuring):
* texinfo/texinfo.texi (Tree Structuring):
* texinfo/texinfo.texi (Structuring Command Types):
* texinfo/texinfo.texi (makeinfo top):
* texinfo/texinfo.texi (chapter):
* texinfo/texinfo.texi (unnumbered & appendix):
* texinfo/texinfo.texi (majorheading & chapheading):
* texinfo/texinfo.texi (section):
* texinfo/texinfo.texi (unnumberedsec appendixsec heading):
* texinfo/texinfo.texi (subsection):
* texinfo/texinfo.texi (unnumberedsubsec appendixsubsec subheading):
* texinfo/texinfo.texi (subsubsection):
* texinfo/texinfo.texi (Raise/lower sections):
* texinfo/texinfo.texi (Nodes):
* texinfo/texinfo.texi (Two Paths):
* texinfo/texinfo.texi (Node Menu Illustration):
* texinfo/texinfo.texi (node):
* texinfo/texinfo.texi (Node Names):
* texinfo/texinfo.texi (Writing a Node):
* texinfo/texinfo.texi (Node Line Tips):
* texinfo/texinfo.texi (Node Line Requirements):
* texinfo/texinfo.texi (First Node):
* texinfo/texinfo.texi (makeinfo top command):
* texinfo/texinfo.texi (makeinfo Pointer Creation):
* texinfo/texinfo.texi (anchor):
* texinfo/texinfo.texi (Menus):
* texinfo/texinfo.texi (Menu Location):
* texinfo/texinfo.texi (Writing a Menu):
* texinfo/texinfo.texi (Menu Parts):
* texinfo/texinfo.texi (Less Cluttered Menu Entry):
* texinfo/texinfo.texi (Menu Example):
* texinfo/texinfo.texi (Other Info Files):
* texinfo/texinfo.texi (Cross References):
* texinfo/texinfo.texi (References):
* texinfo/texinfo.texi (Cross Reference Commands):
* texinfo/texinfo.texi (Cross Reference Parts):
* texinfo/texinfo.texi (xref):
* texinfo/texinfo.texi (Reference Syntax):
* texinfo/texinfo.texi (One Argument):
* texinfo/texinfo.texi (Two Arguments):
* texinfo/texinfo.texi (Three Arguments):
* texinfo/texinfo.texi (Four and Five Arguments):
* texinfo/texinfo.texi (Top Node Naming):
* texinfo/texinfo.texi (ref):
* texinfo/texinfo.texi (pxref):
* texinfo/texinfo.texi (inforef):
* texinfo/texinfo.texi (uref):
* texinfo/texinfo.texi (cite):
* texinfo/texinfo.texi (Marking Text):
* texinfo/texinfo.texi (Indicating):
* texinfo/texinfo.texi (Useful Highlighting):
* texinfo/texinfo.texi (code):
* texinfo/texinfo.texi (kbd):
* texinfo/texinfo.texi (key):
* texinfo/texinfo.texi (samp):
* texinfo/texinfo.texi (verb):
* texinfo/texinfo.texi (var):
* texinfo/texinfo.texi (env):
* texinfo/texinfo.texi (file):
* texinfo/texinfo.texi (command):
* texinfo/texinfo.texi (option):
* texinfo/texinfo.texi (dfn):
* texinfo/texinfo.texi (abbr):
* texinfo/texinfo.texi (acronym):
* texinfo/texinfo.texi (indicateurl):
* texinfo/texinfo.texi (email):
* texinfo/texinfo.texi (Emphasis):
* texinfo/texinfo.texi (emph & strong):
* texinfo/texinfo.texi (Smallcaps):
* texinfo/texinfo.texi (Fonts):
* texinfo/texinfo.texi (Quotations and Examples):
* texinfo/texinfo.texi (Block Enclosing Commands):
* texinfo/texinfo.texi (quotation):
* texinfo/texinfo.texi (example):
* texinfo/texinfo.texi (verbatim):
* texinfo/texinfo.texi (verbatiminclude):
* texinfo/texinfo.texi (lisp):
* texinfo/texinfo.texi (small):
* texinfo/texinfo.texi (display):
* texinfo/texinfo.texi (format):
* texinfo/texinfo.texi (exdent):
* texinfo/texinfo.texi (flushleft & flushright):
* texinfo/texinfo.texi (noindent):
* texinfo/texinfo.texi (indent):
* texinfo/texinfo.texi (cartouche):
* texinfo/texinfo.texi (Lists and Tables):
* texinfo/texinfo.texi (Introducing Lists):
* texinfo/texinfo.texi (itemize):
* texinfo/texinfo.texi (enumerate):
* texinfo/texinfo.texi (Two-column Tables):
* texinfo/texinfo.texi (table):
* texinfo/texinfo.texi (ftable vtable):
* texinfo/texinfo.texi (itemx):
* texinfo/texinfo.texi (Multi-column Tables):
* texinfo/texinfo.texi (Multitable Column Widths):
* texinfo/texinfo.texi (Multitable Rows):
* texinfo/texinfo.texi (Special Displays):
* texinfo/texinfo.texi (Floats):
* texinfo/texinfo.texi (float):
* texinfo/texinfo.texi (caption shortcaption):
* texinfo/texinfo.texi (listoffloats):
* texinfo/texinfo.texi (Images):
* texinfo/texinfo.texi (Image Syntax):
* texinfo/texinfo.texi (Image Scaling):
* texinfo/texinfo.texi (Footnotes):
* texinfo/texinfo.texi (Footnote Commands):
* texinfo/texinfo.texi (Footnote Styles):
* texinfo/texinfo.texi (Indices):
* texinfo/texinfo.texi (Index Entries):
* texinfo/texinfo.texi (Predefined Indices):
* texinfo/texinfo.texi (Indexing Commands):
* texinfo/texinfo.texi (Combining Indices):
* texinfo/texinfo.texi (syncodeindex):
* texinfo/texinfo.texi (synindex):
* texinfo/texinfo.texi (New Indices):
* texinfo/texinfo.texi (Insertions):
* texinfo/texinfo.texi (Atsign Braces Comma):
* texinfo/texinfo.texi (Inserting an Atsign):
* texinfo/texinfo.texi (Inserting Braces):
* texinfo/texinfo.texi (Inserting a Comma):
* texinfo/texinfo.texi (Inserting Quote Characters):
* texinfo/texinfo.texi (Inserting Space):
* texinfo/texinfo.texi (Not Ending a Sentence):
* texinfo/texinfo.texi (Ending a Sentence):
* texinfo/texinfo.texi (Multiple Spaces):
* texinfo/texinfo.texi (frenchspacing):
* texinfo/texinfo.texi (dmn):
* texinfo/texinfo.texi (Inserting Accents):
* texinfo/texinfo.texi (Inserting Quotation Marks):
* texinfo/texinfo.texi (Dots Bullets):
* texinfo/texinfo.texi (dots):
* texinfo/texinfo.texi (bullet):
* texinfo/texinfo.texi (TeX and copyright):
* texinfo/texinfo.texi (tex):
* texinfo/texinfo.texi (copyright symbol):
* texinfo/texinfo.texi (registered symbol):
* texinfo/texinfo.texi (euro):
* texinfo/texinfo.texi (pounds):
* texinfo/texinfo.texi (textdegree):
* texinfo/texinfo.texi (minus):
* texinfo/texinfo.texi (geq leq):
* texinfo/texinfo.texi (math):
* texinfo/texinfo.texi (Click Sequences):
* texinfo/texinfo.texi (Glyphs):
* texinfo/texinfo.texi (Glyphs Summary):
* texinfo/texinfo.texi (result):
* texinfo/texinfo.texi (expansion):
* texinfo/texinfo.texi (Print Glyph):
* texinfo/texinfo.texi (Error Glyph):
* texinfo/texinfo.texi (Equivalence):
* texinfo/texinfo.texi (Point Glyph):
* texinfo/texinfo.texi (Breaks):
* texinfo/texinfo.texi (Break Commands):
* texinfo/texinfo.texi (Line Breaks):
* texinfo/texinfo.texi (- and hyphenation):
* texinfo/texinfo.texi (allowcodebreaks):
* texinfo/texinfo.texi (w):
* texinfo/texinfo.texi (tie):
* texinfo/texinfo.texi (sp):
* texinfo/texinfo.texi (page):
* texinfo/texinfo.texi (group):
* texinfo/texinfo.texi (need):
* texinfo/texinfo.texi (Definition Commands):
* texinfo/texinfo.texi (Def Cmd Template):
* texinfo/texinfo.texi (Def Cmd Continuation Lines):
* texinfo/texinfo.texi (Optional Arguments):
* texinfo/texinfo.texi (deffnx):
* texinfo/texinfo.texi (Def Cmds in Detail):
* texinfo/texinfo.texi (Functions Commands):
* texinfo/texinfo.texi (Variables Commands):
* texinfo/texinfo.texi (Typed Functions):
* texinfo/texinfo.texi (Typed Variables):
* texinfo/texinfo.texi (Data Types):
* texinfo/texinfo.texi (Abstract Objects):
* texinfo/texinfo.texi (Object-Oriented Variables):
* texinfo/texinfo.texi (Object-Oriented Methods):
* texinfo/texinfo.texi (Defining Macros):
* texinfo/texinfo.texi (Invoking Macros):
* texinfo/texinfo.texi (Macro Details):
* texinfo/texinfo.texi (alias):
* texinfo/texinfo.texi (definfoenclose):
* texinfo/texinfo.texi (Hardcopy):
* texinfo/texinfo.texi (Use TeX):
* texinfo/texinfo.texi (Format with tex/texindex):
* texinfo/texinfo.texi (Format with texi2dvi):
* texinfo/texinfo.texi (Print with lpr):
* texinfo/texinfo.texi (Within XEmacs):
* texinfo/texinfo.texi (Texinfo Mode Printing):
* texinfo/texinfo.texi (Compile-Command):
* texinfo/texinfo.texi (Requirements Summary):
* texinfo/texinfo.texi (Preparing for TeX):
* texinfo/texinfo.texi (Overfull hboxes):
* texinfo/texinfo.texi (smallbook):
* texinfo/texinfo.texi (A4 Paper):
* texinfo/texinfo.texi (pagesizes):
* texinfo/texinfo.texi (Cropmarks and Magnification):
* texinfo/texinfo.texi (PDF Output):
* texinfo/texinfo.texi (Obtaining TeX):
* texinfo/texinfo.texi (Creating and Installing Info Files):
* texinfo/texinfo.texi (Creating an Info File):
* texinfo/texinfo.texi (makeinfo advantages):
* texinfo/texinfo.texi (Invoking makeinfo):
* texinfo/texinfo.texi (makeinfo options):
* texinfo/texinfo.texi (Pointer Validation):
* texinfo/texinfo.texi (makeinfo in XEmacs):
* texinfo/texinfo.texi (texinfo-format commands):
* texinfo/texinfo.texi (Batch Formatting):
* texinfo/texinfo.texi (Tag and Split Files):
* texinfo/texinfo.texi (Installing an Info File):
* texinfo/texinfo.texi (Directory File):
* texinfo/texinfo.texi (New Info File):
* texinfo/texinfo.texi (Other Info Directories):
* texinfo/texinfo.texi (Installing Dir Entries):
* texinfo/texinfo.texi (Invoking install-info):
* texinfo/texinfo.texi (Generating HTML):
* texinfo/texinfo.texi (HTML Translation):
* texinfo/texinfo.texi (HTML Splitting):
* texinfo/texinfo.texi (HTML CSS):
* texinfo/texinfo.texi (HTML Xref):
* texinfo/texinfo.texi (HTML Xref Link Basics):
* texinfo/texinfo.texi (HTML Xref Node Name Expansion):
* texinfo/texinfo.texi (HTML Xref Command Expansion):
* texinfo/texinfo.texi (HTML Xref 8-bit Character Expansion):
* texinfo/texinfo.texi (HTML Xref Mismatch):
* texinfo/texinfo.texi (Command List):
* texinfo/texinfo.texi (Command Syntax):
* texinfo/texinfo.texi (Tips):
* texinfo/texinfo.texi (Sample Texinfo Files):
* texinfo/texinfo.texi (Short Sample Texinfo File):
* texinfo/texinfo.texi (GNU Sample Texts):
* texinfo/texinfo.texi (Invoking sample):
* texinfo/texinfo.texi (GNU Free Documentation License):
* texinfo/texinfo.texi (Index):
* texinfo/texinfo.texi (Verbatim Copying License):
* texinfo/texinfo.texi (All-permissive Copying License):
* texinfo/texinfo.texi (Include Files):
* texinfo/texinfo.texi (Using Include Files):
* texinfo/texinfo.texi (texinfo-multiple-files-update):
* texinfo/texinfo.texi (Include Files Requirements):
* texinfo/texinfo.texi (Sample Include File):
* texinfo/texinfo.texi (Include Files Evolution):
* texinfo/texinfo.texi (Headings):
* texinfo/texinfo.texi (Headings Introduced):
* texinfo/texinfo.texi (Heading Format):
* texinfo/texinfo.texi (Heading Choice):
* texinfo/texinfo.texi (Custom Headings):
* texinfo/texinfo.texi (Catching Mistakes):
* texinfo/texinfo.texi (makeinfo Preferred):
* texinfo/texinfo.texi (Debugging with Info):
* texinfo/texinfo.texi (Debugging with TeX):
* texinfo/texinfo.texi (Using texinfo-show-structure):
* texinfo/texinfo.texi (Using occur):
* texinfo/texinfo.texi (Running Info-Validate):
* texinfo/texinfo.texi (Using Info-validate):
* texinfo/texinfo.texi (Unsplit):
* texinfo/texinfo.texi (Tagifying):
* texinfo/texinfo.texi (Splitting):
* texinfo/texinfo.texi (Refilling Paragraphs):
* texinfo/texinfo.texi (Command and Variable Index):
* texinfo/texinfo.texi (General Index):
* texinfo/version.texi: New file.
Sync with FSF 23.1.92. Make new directory to hold the files needed
to generate texinfo.info, since there are three such files now.
2010-02-19 Ben Wing <ben@xemacs.org>
* Makefile:
* Makefile (src_files1):
* Makefile (DIR):
* Makefile (texinfo-srcs):
* Makefile ($(INFODIR)/widget.info):
* Makefile ($(INFODIR)/texinfo.info):
* Makefile (.PHONY):
* Makefile (texinfo.dvi):
* Makefile (texinfo.pdf):
* Makefile ($(HTMLDIR)/widget.html):
* Makefile ($(HTMLDIR)/texinfo.html):
Incorporate texinfo.texi moving to a subdirectory texinfo/.
Do some tricks to reduce the amount of duplication while still
maintaining compatible with non-GNU make (at least, with
Solaris make).
* doclicense.texi: New file.
* info.texi:
* info.texi (Top):
* info.texi (Getting Started):
* info.texi (Help-Small-Screen):
* info.texi (Help):
* info.texi (Help-P):
* info.texi (Help-^L):
* info.texi (Help-Inv):
* info.texi (Help-]):
* info.texi (Help-M):
* info.texi (Help-FOO):
* info.texi (Help-Xref):
* info.texi (Help-Int):
* info.texi (Help-Q):
* info.texi (Advanced):
* info.texi (Search Text):
* info.texi (Search Index):
* info.texi (Go to node):
* info.texi (Choose menu subtopic):
* info.texi (Create Info buffer):
* info.texi (XEmacs Info Variables):
* info.texi (Expert Info):
* info.texi (Add):
* info.texi (Menus):
* info.texi (Cross-refs):
* info.texi (Help-Cross):
* info.texi (Tags):
* info.texi (Checking):
* info.texi (Index):
* texinfo.tex:
* texinfo.tex (paragraphindent{%):
* texinfo.tex (sectionheading will have):
* texinfo.tex (chapterzzz{#3}%):
* texinfo.tex (subsubsection = \numberedsubsubsec):
* texinfo.tex (subsubsection = \appendixsubsubsec):
* texinfo.tex (subsubsection = \unnumberedsubsubsec):
* texinfo.tex (sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%):
* texinfo.tex (sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%):
* texinfo.tex (sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%):
* texinfo.tex (sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%):
* texinfo.tex (sectionheading{#1}{subsec}{Yappendix}%):
* texinfo.tex (sectionheading{#1}{subsec}{Ynothing}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Ynumbered}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Yappendix}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Ynothing}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Yomitfromtoc}{}):
* texinfo.tex (sectionheading to do the printing.):
* texinfo.tex (sectionlevel}{#1}{#4}%):
* texinfo.tex (sectionheading, q.v.):
Sync with FSF 23.1.92.
| author | Ben Wing <ben@xemacs.org> |
|---|---|
| date | Fri, 19 Feb 2010 22:39:19 -0600 |
| parents | 4aebb0131297 |
| children | f283b08ff0c9 |
| rev | line source |
|---|---|
| 428 | 1 /* sysdll.c --- system dependent support for dynamic linked libraries |
| 2 Copyright (C) 1998 Free Software Foundation, Inc. | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
3 Copyright (C) 2010 Ben Wing. |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
4 |
| 428 | 5 Author: William Perry <wmperry@aventail.com> |
| 6 | |
| 7 This file is part of XEmacs. | |
| 8 | |
| 9 XEmacs is free software; you can redistribute it and/or modify it | |
| 10 under the terms of the GNU General Public License as published by the | |
| 11 Free Software Foundation; either version 2, or (at your option) any | |
| 12 later version. | |
| 13 | |
| 14 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
| 15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 17 for more details. | |
| 18 | |
| 19 You should have received a copy of the GNU General Public License | |
| 20 along with XEmacs; see the file COPYING. If not, write to the Free | |
| 21 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
| 22 02111-1307, USA. */ | |
| 23 | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
24 /* This file has been Mule-ized, Ben Wing, 1-26-10. */ |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
25 |
| 428 | 26 #ifdef HAVE_CONFIG_H |
| 27 #include <config.h> | |
| 28 #endif | |
| 29 | |
| 430 | 30 #include <stdlib.h> |
| 1272 | 31 #include "lisp.h" |
| 428 | 32 #include "sysdll.h" |
| 33 | |
| 1383 | 34 #ifdef DLSYM_NEEDS_UNDERSCORE |
| 35 #define MAYBE_PREPEND_UNDERSCORE(n) do { \ | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
36 Ibyte *buf = alloca_array (Ibyte, qxestrlen (n) + 2); \ |
| 1383 | 37 *buf = '_'; \ |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
38 qxestrcpy (buf + 1, n); \ |
| 1383 | 39 n = buf; \ |
| 40 } while (0) | |
| 41 #else | |
| 42 #define MAYBE_PREPEND_UNDERSCORE(n) | |
| 43 #endif | |
| 44 | |
| 428 | 45 /* This whole file is conditional upon HAVE_SHLIB */ |
| 46 #ifdef HAVE_SHLIB | |
| 47 | |
| 48 /* Thankfully, most systems follow the ELFish dlopen() method. | |
| 49 */ | |
| 452 | 50 #if defined(HAVE_DLOPEN) |
| 428 | 51 #include <dlfcn.h> |
| 52 | |
| 53 #ifndef RTLD_LAZY | |
| 1383 | 54 # ifdef DL_LAZY |
| 55 # define RTLD_LAZY DL_LAZY | |
| 56 # else | |
| 57 # define RTLD_LAZY 1 | |
| 58 # endif | |
| 428 | 59 #endif /* RTLD_LAZY isn't defined under FreeBSD - ick */ |
| 60 | |
| 863 | 61 #ifndef RTLD_NOW |
| 1383 | 62 # ifdef DL_NOW |
| 63 # define RTLD_NOW DL_NOW | |
| 64 # else | |
| 65 # define RTLD_NOW 2 | |
| 66 # endif | |
| 863 | 67 #endif |
| 68 | |
| 428 | 69 dll_handle |
| 1706 | 70 dll_open (Lisp_Object fname) |
| 428 | 71 { |
| 1706 | 72 Extbyte *soname; |
| 73 | |
| 74 if (NILP (fname)) | |
| 75 { | |
| 76 soname = NULL; | |
| 77 } | |
| 78 else | |
| 79 { | |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
80 soname = LISP_STRING_TO_EXTERNAL (fname, Qdll_filename_encoding); |
| 1706 | 81 } |
| 82 return (dll_handle) dlopen (soname, RTLD_NOW); | |
| 428 | 83 } |
| 84 | |
| 85 int | |
| 86 dll_close (dll_handle h) | |
| 87 { | |
| 442 | 88 return dlclose ((void *) h); |
| 428 | 89 } |
| 90 | |
| 91 dll_func | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
92 dll_function (dll_handle h, const Ibyte *n) |
| 428 | 93 { |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
94 Extbyte *next; |
| 1383 | 95 MAYBE_PREPEND_UNDERSCORE (n); |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
96 next = ITEXT_TO_EXTERNAL (n, Qdll_function_name_encoding); |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
97 return (dll_func) dlsym ((void *) h, next); |
| 428 | 98 } |
| 99 | |
| 100 dll_var | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
101 dll_variable (dll_handle h, const Ibyte *n) |
| 428 | 102 { |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
103 Extbyte *next; |
| 1383 | 104 MAYBE_PREPEND_UNDERSCORE (n); |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
105 next = ITEXT_TO_EXTERNAL (n, Qdll_variable_name_encoding); |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
106 return (dll_var)dlsym ((void *)h, next); |
| 428 | 107 } |
| 108 | |
| 1706 | 109 Lisp_Object |
| 1811 | 110 dll_error () |
| 428 | 111 { |
| 1706 | 112 const Extbyte *msg; |
| 428 | 113 #if defined(HAVE_DLERROR) || defined(dlerror) |
| 1706 | 114 msg = (const Extbyte *) dlerror (); |
| 428 | 115 #elif defined(HAVE__DLERROR) |
| 1706 | 116 msg = (const Extbyte *) _dlerror(); |
| 428 | 117 #else |
| 1706 | 118 msg = (const Extbyte *) "Shared library error"; |
| 428 | 119 #endif |
|
4953
304aebb79cd3
function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents:
4952
diff
changeset
|
120 return build_extstring (msg, Qerror_message_encoding); |
| 428 | 121 } |
| 122 | |
| 123 #elif defined(HAVE_SHL_LOAD) | |
| 124 /* This is the HP/UX version */ | |
| 125 #include <dl.h> | |
| 126 dll_handle | |
| 1706 | 127 dll_open (Lisp_Object fname) |
| 428 | 128 { |
| 1706 | 129 Extbyte *soname; |
| 428 | 130 |
| 1706 | 131 if (NILP (fname)) |
| 132 { | |
| 133 soname = NULL; | |
| 134 } | |
| 135 else | |
| 136 { | |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
137 soname = LISP_STRING_TO_EXTERNAL (fname, Qdll_filename_encoding); |
| 1706 | 138 } |
| 139 return (dll_handle) shl_load (soname, BIND_DEFERRED, 0L); | |
| 428 | 140 } |
| 141 | |
| 142 int | |
| 143 dll_close (dll_handle h) | |
| 144 { | |
| 442 | 145 return shl_unload ((shl_t) h); |
| 428 | 146 } |
| 147 | |
| 148 dll_func | |
| 1706 | 149 dll_function (dll_handle h, const CIbyte *n) |
| 428 | 150 { |
| 151 long handle = 0L; | |
| 152 | |
| 442 | 153 if (shl_findsym ((shl_t *) &h, n, TYPE_PROCEDURE, &handle)) |
| 428 | 154 return NULL; |
| 155 | |
| 442 | 156 return (dll_func) handle; |
| 428 | 157 } |
| 158 | |
| 159 dll_var | |
| 1706 | 160 dll_variable (dll_handle h, const CIbyte *n) |
| 428 | 161 { |
| 162 long handle = 0L; | |
| 163 | |
| 442 | 164 if (shl_findsym ((shl_t *) &h, n, TYPE_DATA, &handle)) |
| 428 | 165 return NULL; |
| 166 | |
| 442 | 167 return (dll_var) handle; |
| 428 | 168 } |
| 169 | |
| 1706 | 170 Lisp_Object |
| 1811 | 171 dll_error () |
| 428 | 172 { |
| 173 /* #### WTF?! Shouldn't this at least attempt to get strerror or | |
| 174 something? --hniksic */ | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
175 return build_ascstring ("Generic shared library error"); |
| 428 | 176 } |
| 177 | |
| 1632 | 178 #elif defined (WIN32_NATIVE) || defined (CYGWIN) |
| 442 | 179 |
| 1632 | 180 #include "syswindows.h" |
| 181 #include "sysfile.h" | |
| 442 | 182 |
| 428 | 183 dll_handle |
| 1706 | 184 dll_open (Lisp_Object fname) |
| 428 | 185 { |
| 1706 | 186 Extbyte *soname; |
| 187 | |
| 188 if (NILP (fname)) | |
| 189 { | |
| 190 soname = NULL; | |
| 191 } | |
| 192 else | |
| 193 { | |
|
4834
b3ea9c582280
Use new cygwin_conv_path API with Cygwin 1.7 for converting names between Win32 and POSIX, UTF-8-aware, with attendant changes elsewhere
Ben Wing <ben@xemacs.org>
parents:
3841
diff
changeset
|
194 LISP_LOCAL_FILE_FORMAT_TO_TSTR (fname, soname); |
| 1706 | 195 } |
| 196 return (dll_handle) qxeLoadLibrary (soname); | |
| 428 | 197 } |
| 198 | |
| 199 int | |
| 200 dll_close (dll_handle h) | |
| 201 { | |
| 1706 | 202 return FreeLibrary ((HMODULE) h); |
| 428 | 203 } |
| 204 | |
| 205 dll_func | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
206 dll_function (dll_handle h, const Ibyte *n) |
| 428 | 207 { |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
208 Extbyte *next = ITEXT_TO_EXTERNAL (n, Qmswindows_multibyte); |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
209 return (dll_func) GetProcAddress ((HINSTANCE) h, next); |
| 428 | 210 } |
| 211 | |
| 212 dll_func | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
213 dll_variable (dll_handle h, const Ibyte *n) |
| 428 | 214 { |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
215 Extbyte *next = ITEXT_TO_EXTERNAL (n, Qmswindows_multibyte); |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
216 return (dll_func) GetProcAddress ((HINSTANCE) h, next); |
| 428 | 217 } |
| 218 | |
| 1706 | 219 Lisp_Object |
| 1811 | 220 dll_error () |
| 428 | 221 { |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
222 Ascbyte err[32]; |
| 1706 | 223 snprintf (err, 32, "Windows DLL Error %lu", GetLastError ()); |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
224 return build_ascstring (err); |
| 428 | 225 } |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
226 #elif defined (HAVE_DYLD) |
| 1383 | 227 /* This section supports MacOSX dynamic libraries. Dynamically |
| 228 loadable libraries must be compiled as bundles, not dynamiclibs. | |
| 229 */ | |
| 230 | |
| 231 #include <mach-o/dyld.h> | |
| 232 | |
| 233 dll_handle | |
| 1706 | 234 dll_open (Lisp_Object fname) |
| 1383 | 235 { |
| 1706 | 236 Extbyte *soname; |
| 1383 | 237 NSObjectFileImage file; |
| 1418 | 238 NSModule out; |
| 1706 | 239 NSObjectFileImageReturnCode ret; |
| 240 | |
| 2855 | 241 /* |
| 242 * MacOS X dll support is for bundles, not the current executable, so return | |
| 243 * NULL is this case. However, dll_function() uses a special hack where a | |
| 244 * NULL handle can be used to find executable symbols. This satisfies the | |
| 245 * needs of ui-gtk.c but is not a general solution. | |
| 246 */ | |
| 1706 | 247 if (NILP (fname)) |
| 248 { | |
| 2855 | 249 return NULL; |
| 1706 | 250 } |
| 251 else | |
| 252 { | |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
253 soname = LISP_STRING_TO_EXTERNAL (fname, Qdll_filename_encoding); |
| 1706 | 254 } |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
255 ret = NSCreateObjectFileImageFromFile (soname, &file); |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
256 if (ret != NSObjectFileImageSuccess) |
| 1383 | 257 return NULL; |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
258 out = NSLinkModule (file, soname, |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
259 NSLINKMODULE_OPTION_BINDNOW | |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
260 NSLINKMODULE_OPTION_PRIVATE | |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
261 NSLINKMODULE_OPTION_RETURN_ON_ERROR); |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
262 return (dll_handle) out; |
| 1383 | 263 } |
| 264 | |
| 265 int | |
| 266 dll_close (dll_handle h) | |
| 267 { | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
268 return NSUnLinkModule ((NSModule) h, NSUNLINKMODULE_OPTION_NONE); |
| 1383 | 269 } |
| 270 | |
| 1851 | 271 /* Given an address, return the mach_header for the image containing it |
| 272 * or zero if the given address is not contained in any loaded images. | |
| 273 * | |
| 274 * Note: image_for_address(), my_find_image() and search_linked_libs() are | |
| 275 * based on code from the dlcompat library | |
| 276 * (http://www.opendarwin.org/projects/dlcompat). | |
| 277 */ | |
| 278 | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
279 static const struct mach_header * |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
280 image_for_address (void *address) |
| 1851 | 281 { |
| 282 unsigned long i; | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
283 unsigned long count = _dyld_image_count (); |
| 3841 | 284 const struct mach_header *mh = 0; |
| 1851 | 285 |
| 286 for (i = 0; i < count; i++) | |
| 287 { | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
288 unsigned long addr = (unsigned long) address - |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
289 _dyld_get_image_vmaddr_slide (i); |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
290 mh = _dyld_get_image_header (i); |
| 1851 | 291 |
| 292 if (mh) | |
| 293 { | |
| 294 struct load_command *lc = | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
295 (struct load_command *) ((Rawbyte *) mh + |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
296 sizeof(struct mach_header)); |
| 1851 | 297 unsigned long j; |
| 298 | |
| 299 for (j = 0; j < mh->ncmds; | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
300 j++, lc = (struct load_command *) ((Rawbyte *)lc + lc->cmdsize)) |
| 1851 | 301 { |
| 302 if (LC_SEGMENT == lc->cmd && | |
| 303 addr >= ((struct segment_command *)lc)->vmaddr && | |
| 304 addr < | |
| 305 ((struct segment_command *)lc)->vmaddr + | |
| 306 ((struct segment_command *)lc)->vmsize) | |
| 307 { | |
| 308 goto image_found; | |
| 309 } | |
| 310 } | |
| 311 } | |
| 312 | |
| 313 mh = 0; | |
| 314 } | |
| 315 | |
| 316 image_found: | |
| 317 return mh; | |
| 318 } | |
| 319 | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
320 static const struct mach_header * |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
321 my_find_image (const char *name) |
| 1851 | 322 { |
| 323 const struct mach_header *mh = (struct mach_header *) | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
324 NSAddImage (name, NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED | |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
325 NSADDIMAGE_OPTION_RETURN_ON_ERROR); |
| 1851 | 326 |
| 327 if (!mh) | |
| 328 { | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
329 int count = _dyld_image_count (); |
| 1851 | 330 int j; |
| 331 | |
| 332 for (j = 0; j < count; j++) | |
| 333 { | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
334 const char *id = _dyld_get_image_name (j); |
| 1851 | 335 |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
336 if (!strcmp (id, name)) |
| 1851 | 337 { |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
338 mh = _dyld_get_image_header (j); |
| 1851 | 339 break; |
| 340 } | |
| 341 } | |
| 342 } | |
| 343 | |
| 344 return mh; | |
| 345 } | |
| 346 | |
| 347 /* | |
| 348 * dyld adds libraries by first adding the directly dependant libraries in | |
| 349 * link order, and then adding the dependencies for those libraries, so we | |
| 350 * should do the same... but we don't bother adding the extra dependencies, if | |
| 351 * the symbols are neither in the loaded image nor any of it's direct | |
| 352 * dependencies, then it probably isn't there. | |
| 353 */ | |
| 354 static NSSymbol | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
355 search_linked_libs (const struct mach_header * mh, const Ibyte *symbol) |
| 1851 | 356 { |
| 2054 | 357 unsigned long n; |
| 1851 | 358 NSSymbol nssym = 0; |
| 359 | |
| 360 struct load_command *lc = | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
361 (struct load_command *) ((Rawbyte *) mh + sizeof (struct mach_header)); |
| 1851 | 362 |
| 363 for (n = 0; n < mh->ncmds; | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
364 n++, lc = (struct load_command *) ((Rawbyte *) lc + lc->cmdsize)) |
| 1851 | 365 { |
| 366 if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd)) | |
| 367 { | |
| 368 struct mach_header *wh; | |
| 369 | |
| 370 if ((wh = (struct mach_header *) | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
371 my_find_image((Rawbyte *) |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
372 (((struct dylib_command *) lc)-> |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
373 dylib.name.offset + (Rawbyte *) lc)))) |
| 1851 | 374 { |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
375 Extbyte *symext = |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
376 ITEXT_TO_EXTERNAL (symbol, Qdll_symbol_encoding); |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
377 if (NSIsSymbolNameDefinedInImage (wh, symext)) |
| 1851 | 378 { |
| 379 nssym = | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
380 NSLookupSymbolInImage |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
381 (wh, |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
382 symext, |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
383 NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
384 NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); |
| 1851 | 385 break; |
| 386 } | |
| 387 } | |
| 388 } | |
| 389 } | |
| 390 | |
| 391 return nssym; | |
| 392 } | |
| 393 | |
| 1383 | 394 dll_func |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
395 dll_function (dll_handle h, const Ibyte *n) |
| 1383 | 396 { |
| 1851 | 397 NSSymbol sym = 0; |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
398 Extbyte *next; |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
399 |
| 1383 | 400 MAYBE_PREPEND_UNDERSCORE (n); |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
401 next = ITEXT_TO_EXTERNAL (n, Qdll_function_name_encoding); |
| 1851 | 402 |
| 403 /* NULL means the program image and shared libraries, not bundles. */ | |
| 404 | |
| 405 if (h == NULL) | |
| 406 { | |
| 407 /* NOTE: This assumes that this function is included in the main program | |
| 408 and not in a shared library. */ | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
409 const struct mach_header* my_mh = |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
410 image_for_address ((void*) &dll_function); |
| 1851 | 411 |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
412 if (NSIsSymbolNameDefinedInImage (my_mh, next)) |
| 1851 | 413 { |
| 414 sym = | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
415 NSLookupSymbolInImage |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
416 (my_mh, |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
417 next, |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
418 NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
419 NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); |
| 1851 | 420 } |
| 421 | |
| 422 if (!sym) | |
| 423 { | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
424 sym = search_linked_libs (my_mh, n); |
| 1851 | 425 } |
| 426 } | |
| 427 else | |
| 428 { | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
429 sym = NSLookupSymbolInModule ((NSModule)h, next); |
| 1851 | 430 } |
| 431 | |
| 432 if (sym == 0) return 0; | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
433 return (dll_func) NSAddressOfSymbol (sym); |
| 1851 | 434 } |
| 1383 | 435 |
| 436 dll_var | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
437 dll_variable (dll_handle h, const Ibyte *n) |
| 1383 | 438 { |
| 439 NSSymbol sym; | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
440 Extbyte *next; |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
441 |
| 1383 | 442 MAYBE_PREPEND_UNDERSCORE (n); |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
443 next = ITEXT_TO_EXTERNAL (n, Qdll_variable_name_encoding); |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
444 |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
445 sym = NSLookupSymbolInModule ((NSModule) h, n); |
| 1383 | 446 if (sym == 0) return 0; |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
447 return (dll_var) NSAddressOfSymbol (sym); |
| 1383 | 448 } |
| 449 | |
| 1706 | 450 Lisp_Object |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
451 dll_error (void) |
| 1383 | 452 { |
| 453 NSLinkEditErrors c; | |
| 454 int errorNumber; | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
455 const Extbyte *fileNameWithError, *errorString; |
|
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
456 NSLinkEditError (&c, &errorNumber, &fileNameWithError, &errorString); |
|
4953
304aebb79cd3
function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents:
4952
diff
changeset
|
457 return build_extstring (errorString, Qerror_message_encoding); |
| 1383 | 458 } |
| 2078 | 459 #elif HAVE_LTDL |
| 460 /* Libtool's libltdl */ | |
| 461 #include <ltdl.h> | |
| 462 | |
| 463 dll_handle | |
| 464 dll_open (Lisp_Object fname) | |
| 465 { | |
| 466 Extbyte *soname; | |
| 467 | |
| 468 if (NILP (fname)) | |
| 469 { | |
| 470 soname = NULL; | |
| 471 } | |
| 472 else | |
| 473 { | |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
474 soname = LISP_STRING_TO_EXTERNAL (fname, Qdll_filename_encoding); |
| 2078 | 475 } |
| 476 return (dll_handle) lt_dlopen (soname); | |
| 477 } | |
| 478 | |
| 479 int | |
| 480 dll_close (dll_handle h) | |
| 481 { | |
| 482 return lt_dlclose ((lt_dlhandle) h); | |
| 483 } | |
| 484 | |
| 485 dll_func | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
486 dll_function (dll_handle h, const Ibyte *n) |
| 2078 | 487 { |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
488 Extbyte *next; |
| 2078 | 489 MAYBE_PREPEND_UNDERSCORE (n); |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
490 next = ITEXT_TO_EXTERNAL (n, Qdll_function_name_encoding); |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
491 return (dll_func) lt_dlsym ((lt_dlhandle) h, next); |
| 2078 | 492 } |
| 493 | |
| 494 dll_var | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
495 dll_variable (dll_handle h, const Ibyte *n) |
| 2078 | 496 { |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
497 Extbyte *next; |
| 2078 | 498 MAYBE_PREPEND_UNDERSCORE (n); |
|
4981
4aebb0131297
Cleanups/renaming of EXTERNAL_TO_C_STRING and friends
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
499 next = ITEXT_TO_EXTERNAL (n, Qdll_variable_name_encoding); |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
500 return (dll_var) lt_dlsym ((lt_dlhandle) h, next); |
| 2078 | 501 } |
| 502 | |
| 503 Lisp_Object | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
504 dll_error (void) |
| 2078 | 505 { |
|
4953
304aebb79cd3
function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents:
4952
diff
changeset
|
506 return build_extstring (lt_dlerror (), Qerror_message_encoding); |
| 2078 | 507 } |
| 428 | 508 #else |
| 1706 | 509 /* Catchall if we don't know about this system's method of dynamic loading */ |
| 428 | 510 dll_handle |
| 1706 | 511 dll_open (Lisp_Object fname) |
| 428 | 512 { |
| 513 return NULL; | |
| 514 } | |
| 515 | |
| 516 int | |
| 517 dll_close (dll_handle h) | |
| 518 { | |
| 519 return 0; | |
| 520 } | |
| 521 | |
| 522 dll_func | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
523 dll_function (dll_handle h, const Ibyte *n) |
| 428 | 524 { |
| 525 return NULL; | |
| 526 } | |
| 527 | |
| 528 dll_func | |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
529 dll_variable (dll_handle h, const Ibyte *n) |
| 428 | 530 { |
| 531 return NULL; | |
| 532 } | |
| 533 | |
| 1706 | 534 Lisp_Object |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
535 dll_error (void) |
| 428 | 536 { |
|
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4834
diff
changeset
|
537 return build_ascstring ("Shared libraries not implemented on this system"); |
| 428 | 538 } |
| 539 #endif /* System conditionals */ | |
| 540 | |
| 541 #endif /* HAVE_SHLIB */ |
