mirror of
https://github.com/Interlisp/maiko.git
synced 2026-01-26 03:51:32 +00:00
Maiko sources matching state as of 020102 prior to initial patching for Mac OSX
This commit is contained in:
7
include/README
Normal file
7
include/README
Normal file
@@ -0,0 +1,7 @@
|
||||
This directory contains header files that are generated by the build
|
||||
process itself. E.g., if DLD creates include files for outside use,
|
||||
they'd go here.
|
||||
|
||||
This directory is not CVS controlled, apart from this file.
|
||||
|
||||
21 April 2000
|
||||
141
include/ansidecl.h
Normal file
141
include/ansidecl.h
Normal file
@@ -0,0 +1,141 @@
|
||||
/* ANSI and traditional C compatability macros
|
||||
Copyright 1991, 1992 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* ANSI and traditional C compatibility macros
|
||||
|
||||
ANSI C is assumed if __STDC__ is #defined.
|
||||
|
||||
Macro ANSI C definition Traditional C definition
|
||||
----- ---- - ---------- ----------- - ----------
|
||||
PTR `void *' `char *'
|
||||
LONG_DOUBLE `long double' `double'
|
||||
VOLATILE `volatile' `'
|
||||
SIGNED `signed' `'
|
||||
PTRCONST `void *const' `char *'
|
||||
ANSI_PROTOTYPES 1 not defined
|
||||
|
||||
CONST is also defined, but is obsolete. Just use const.
|
||||
|
||||
DEFUN (name, arglist, args)
|
||||
|
||||
Defines function NAME.
|
||||
|
||||
ARGLIST lists the arguments, separated by commas and enclosed in
|
||||
parentheses. ARGLIST becomes the argument list in traditional C.
|
||||
|
||||
ARGS list the arguments with their types. It becomes a prototype in
|
||||
ANSI C, and the type declarations in traditional C. Arguments should
|
||||
be separated with `AND'. For functions with a variable number of
|
||||
arguments, the last thing listed should be `DOTS'.
|
||||
|
||||
DEFUN_VOID (name)
|
||||
|
||||
Defines a function NAME, which takes no arguments.
|
||||
|
||||
obsolete -- EXFUN (name, (prototype)) -- obsolete.
|
||||
|
||||
Replaced by PARAMS. Do not use; will disappear someday soon.
|
||||
Was used in external function declarations.
|
||||
In ANSI C it is `NAME PROTOTYPE' (so PROTOTYPE should be enclosed in
|
||||
parentheses). In traditional C it is `NAME()'.
|
||||
For a function that takes no arguments, PROTOTYPE should be `(void)'.
|
||||
|
||||
PARAMS ((args))
|
||||
|
||||
We could use the EXFUN macro to handle prototype declarations, but
|
||||
the name is misleading and the result is ugly. So we just define a
|
||||
simple macro to handle the parameter lists, as in:
|
||||
|
||||
static int foo PARAMS ((int, char));
|
||||
|
||||
This produces: `static int foo();' or `static int foo (int, char);'
|
||||
|
||||
EXFUN would have done it like this:
|
||||
|
||||
static int EXFUN (foo, (int, char));
|
||||
|
||||
but the function is not external...and it's hard to visually parse
|
||||
the function name out of the mess. EXFUN should be considered
|
||||
obsolete; new code should be written to use PARAMS.
|
||||
|
||||
For example:
|
||||
extern int printf PARAMS ((CONST char *format DOTS));
|
||||
int DEFUN(fprintf, (stream, format),
|
||||
FILE *stream AND CONST char *format DOTS) { ... }
|
||||
void DEFUN_VOID(abort) { ... }
|
||||
*/
|
||||
|
||||
#ifndef _ANSIDECL_H
|
||||
|
||||
#define _ANSIDECL_H 1
|
||||
|
||||
|
||||
/* Every source file includes this file,
|
||||
so they will all get the switch for lint. */
|
||||
/* LINTLIBRARY */
|
||||
|
||||
|
||||
#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4))
|
||||
/* All known AIX compilers implement these things (but don't always
|
||||
define __STDC__). The RISC/OS MIPS compiler defines these things
|
||||
in SVR4 mode, but does not define __STDC__. */
|
||||
|
||||
#define PTR void *
|
||||
#define PTRCONST void *CONST
|
||||
#define LONG_DOUBLE long double
|
||||
|
||||
#define AND ,
|
||||
#define NOARGS void
|
||||
#define CONST const
|
||||
#define VOLATILE volatile
|
||||
#define SIGNED signed
|
||||
#define DOTS , ...
|
||||
|
||||
#define EXFUN(name, proto) name proto
|
||||
#define DEFUN(name, arglist, args) name(args)
|
||||
#define DEFUN_VOID(name) name(void)
|
||||
|
||||
#define PROTO(type, name, arglist) type name arglist
|
||||
#define PARAMS(paramlist) paramlist
|
||||
#define ANSI_PROTOTYPES 1
|
||||
|
||||
#else /* Not ANSI C. */
|
||||
|
||||
#define PTR char *
|
||||
#define PTRCONST PTR
|
||||
#define LONG_DOUBLE double
|
||||
|
||||
#define AND ;
|
||||
#define NOARGS
|
||||
#define CONST
|
||||
#ifndef const /* some systems define it in header files for non-ansi mode */
|
||||
#define const
|
||||
#endif
|
||||
#define VOLATILE
|
||||
#define SIGNED
|
||||
#define DOTS
|
||||
|
||||
#define EXFUN(name, proto) name()
|
||||
#define DEFUN(name, arglist, args) name arglist args;
|
||||
#define DEFUN_VOID(name) name()
|
||||
#define PROTO(type, name, arglist) type name ()
|
||||
#define PARAMS(paramlist) ()
|
||||
|
||||
#endif /* ANSI C. */
|
||||
|
||||
#endif /* ansidecl.h */
|
||||
157
include/dld.h
Normal file
157
include/dld.h
Normal file
@@ -0,0 +1,157 @@
|
||||
/* dld.h -- dynamic link editor library interface header.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990 by W. Wilson Ho.
|
||||
This file is part of the GNU Dld Library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* Written by W. Wilson Ho <how@sgi.com> */
|
||||
|
||||
#include <ansidecl.h>
|
||||
|
||||
/* Error codes */
|
||||
|
||||
#define DLD_ENOFILE 1 /* Cannot open file. */
|
||||
#define DLD_EBADMAGIC 2 /* Bad magic number. */
|
||||
#define DLD_EBADHEADER 3 /* Failure reading header. */
|
||||
#define DLD_ENOTEXT 4 /* Premature end of file in text section. */
|
||||
#define DLD_ENOSYMBOLS 5 /* Premature EOF in symbol section. */
|
||||
#define DLD_ENOSTRINGS 6 /* Bad string table. */
|
||||
#define DLD_ENOTXTRELOC 7 /* Premature EOF in text relocation. */
|
||||
#define DLD_ENODATA 8 /* Premature EOF in data section. */
|
||||
#define DLD_ENODATRELOC 9 /* Premature EOF in data relocation. */
|
||||
#define DLD_EMULTDEFS 10 /* A symbol was multiply defined. */
|
||||
#define DLD_EBADLIBRARY 11 /* Malformed library archive. */
|
||||
#define DLD_EBADCOMMON 12 /* Common block not supported. */
|
||||
#define DLD_EBADOBJECT 13 /* Malformed input file
|
||||
(not relocatable or archive). */
|
||||
#define DLD_EBADRELOC 14 /* Bad relocation info. */
|
||||
#define DLD_ENOMEMORY 15 /* Virtual memory exhausted. */
|
||||
#define DLD_EUNDEFSYM 16 /* Undefined symbol. */
|
||||
|
||||
#define DLD_ELAST 16 /* Must equal largest errno. */
|
||||
|
||||
/* Most recent error code returned by dld. */
|
||||
extern int dld_errno;
|
||||
|
||||
/* The symbol name that was multiply defined. Valid only if DLD_ERRNO is
|
||||
DLD_EMULTDEFS. */
|
||||
extern char *dld_errname;
|
||||
|
||||
/* The number of undefined global symbols. */
|
||||
extern int dld_undefined_sym_count;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Initialize the dld routines. PROGNAME is the name of the currently
|
||||
running program, as given by argv[0]. If PROGNAME is not an
|
||||
absolute path, then dld_init will automatically invoke
|
||||
dld_find_program (PROGNAME). */
|
||||
extern int dld_init PARAMS ((CONST char *progname));
|
||||
|
||||
/* Dynamically load and link the object file named FILE into the
|
||||
current process. */
|
||||
extern int dld_link PARAMS ((CONST char *file));
|
||||
|
||||
/* Return the address of the identifier named ID. This function
|
||||
automatically prepends an underscore to the identifier, if C
|
||||
identifiers usually use them. */
|
||||
extern PTR dld_get_symbol PARAMS ((CONST char *id));
|
||||
|
||||
/* Return the address of the identifier named ID. Use this function
|
||||
to locate symbols defined by assembly routines, since it doesn't
|
||||
prepend and underscore to the symbol name. */
|
||||
extern PTR dld_get_bare_symbol PARAMS ((CONST char *id));
|
||||
|
||||
/* Return the address of the function named FUNC. */
|
||||
extern PTR dld_get_func PARAMS ((CONST char *func));
|
||||
|
||||
/* Unlink the module in the current process defined by the file FILE.
|
||||
If FORCE is nonzero, then the module is removed from memory even if
|
||||
it is referenced by other modules. */
|
||||
extern int dld_unlink_by_file PARAMS ((CONST char *file, int force));
|
||||
|
||||
/* Unlink the module in the current process that defines the symbol
|
||||
ID. If FORCE is nonzero, then the module is removed from memory
|
||||
even if it is referenced by other modules. */
|
||||
extern int dld_unlink_by_symbol PARAMS ((CONST char *id, int force));
|
||||
|
||||
/* Explicitly create a reference to the symbol named ID. */
|
||||
extern int dld_create_reference PARAMS ((CONST char *id));
|
||||
|
||||
/* Explicitly define the symbol named ID, of SIZE bytes. */
|
||||
extern int dld_define_sym PARAMS ((CONST char *id, int size));
|
||||
|
||||
/* Remove the explicitly defined symbol named ID. */
|
||||
extern int dld_remove_defined_symbol PARAMS ((CONST char *id));
|
||||
|
||||
/* Return an array that lists the undefined symbols in the current
|
||||
process, or NULL if there are none. The caller is responsible for
|
||||
freeing this array. */
|
||||
extern char **dld_list_undefined_sym PARAMS ((NOARGS));
|
||||
|
||||
/* Return true (nonzero) if the function named FUNC may be safely
|
||||
executed. */
|
||||
extern int dld_function_executable_p PARAMS ((CONST char *func));
|
||||
|
||||
/* Return the absolute name of the program named NAME. This function
|
||||
searches the directories in the PATH environment variable if PROG
|
||||
has no directory components. */
|
||||
extern char *dld_find_executable PARAMS ((CONST char *name));
|
||||
|
||||
/* Return the absolute name of the shared library named NAME. This
|
||||
function searches:
|
||||
a) in an absolute location, if NAME is an absolute path.
|
||||
b) relative to the current working directory, if NAME is a relative path.
|
||||
c) in the current directory
|
||||
d) if all the above fail, then look for a file named "libNAME.so"
|
||||
(depending on the system):
|
||||
i) in the directories named in the LIBPATH array, if it is non-NULL
|
||||
ii) in the directories named in the LD_LIBRARY_PATH (or equivalent)
|
||||
environment variable.
|
||||
|
||||
If all the above fails, then dld_find_library returns the NULL pointer.
|
||||
|
||||
See the dld documentation for a description of MAJOR, DELTA, and
|
||||
REVISION version numbers, or set them all to zero if the shared library
|
||||
was not built by libtool. */
|
||||
extern char *dld_find_library PARAMS ((CONST char *name, CONST char **libpath,
|
||||
int major, int delta, int revision));
|
||||
|
||||
/* Print MSG followed by a colon and dld_strerror (DLD_ERRNO). May be
|
||||
used as a simple way to report errors. */
|
||||
extern void dld_perror PARAMS ((CONST char *MSG));
|
||||
|
||||
/* Return the string corresponding to the error code CODE. */
|
||||
extern CONST char *dld_strerror PARAMS ((int code));
|
||||
|
||||
#if 0
|
||||
/* FIXME: these functions have been removed from dld due to legal problems. */
|
||||
|
||||
/* A replacement for dld_link that invokes g++ constructors. */
|
||||
extern void dyn_load PARAMS ((CONST char *name));
|
||||
|
||||
/* A replacement for dld_unlink that invoke g++ destructors. */
|
||||
extern void dyn_unload PARAMS ((CONST char *name));
|
||||
|
||||
/* A list of libraries to be loaded by dyn_load. */
|
||||
extern char *dyn_libraries[];
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user