4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1998-2000 by Sun Microsystems, Inc.
24 * All rights reserved.
30 #pragma ident "%Z%%M% %I% %E% SMI"
41 #include <apptrace_impl.h>
48 * Extract the verbosity flag.
50 #define ABI_VFLAG(lib, symbol) \
51 __abi_ ## lib ## _ ## symbol ## _sym.a_vflag
54 * Extract the function pointer to the real ABI function.
56 #define ABI_REAL(lib, symbol) \
57 __abi_ ## lib ## _ ## symbol ## _sym.a_real
60 * Macro to create the part of a function call prior
62 * cast is a full cast expression for a _pointer_ to
63 * the ABI function being called.
65 * e.g. ABI_CALL_REAL(libc, getpid, (pid_t (*)(void))) ();
67 #define ABI_CALL_REAL(lib, sym, cast) \
68 (cast __abi_ ## lib ## _ ## sym ## _sym.a_real)
70 #define ABISTREAM __abi_outfile
71 #define ABIPUTS(x) (void) fputs((x), ABISTREAM)
74 * The following declarations and macros are needed for
75 * anybody needing the vprintf family of calls where they
76 * MUST come from the BASE link map instead of the auditing
79 #define ABI_VSNPRINTF __abi_real_vsnprintf
80 #define ABI_VSWPRINTF __abi_real_vswprintf
81 #define ABI_VWPRINTF __abi_real_vwprintf
82 #define ABI_VFPRINTF __abi_real_vfprintf
83 #define ABI_VFWPRINTF __abi_real_vfwprintf
84 #define ABI_VPRINTF __abi_real_vprintf
85 #define ABI_VSPRINTF __abi_real_vsprintf
86 #define ABI_ERRNO (*(__abi_real_errno()))
90 STAB_SUCCESS
= 0, /* All is well. */
91 STAB_FAIL
= -1, /* Parsing error. */
92 STAB_NA
= -2, /* Information is Not Applicable. */
93 STAB_NOMEM
= -3 /* Out of Memory! */
96 extern int (*ABI_VFPRINTF
)(FILE *, const char *, va_list);
97 extern int (*ABI_VFWPRINTF
)(FILE *, const wchar_t *, va_list);
98 extern int (*ABI_VPRINTF
)(const char *, va_list);
99 extern int (*ABI_VSNPRINTF
)(char *, size_t, const char *, va_list);
100 extern int (*ABI_VSPRINTF
)(char *, const char *, va_list);
101 extern int (*ABI_VSWPRINTF
)(wchar_t *, size_t, const wchar_t *, va_list);
102 extern int (*ABI_VWPRINTF
)(const wchar_t *, va_list);
103 extern int *(*__abi_real_errno
)(void);
105 extern void *abi_malloc(size_t);
106 extern void *abi_calloc(size_t, size_t);
107 extern void *abi_realloc(void *, size_t);
108 extern int abi_putc(int, FILE *);
109 extern int abi_fputs(const char *, FILE *);
110 extern void abi_free(void *);
112 /* From libstabspf */
113 extern stabsret_t
spf_load_stabs(const char *);
114 extern int spf_prtype(FILE *, char const *, int, void const *);
116 extern int abi_strpsz
; /* size constraint for string printing */
122 #endif /* _APPTRACE_H */