summaryrefslogtreecommitdiff
path: root/gnu/lib/libiberty/include
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2003-11-24 16:47:35 +0000
committerMarc Espie <espie@cvs.openbsd.org>2003-11-24 16:47:35 +0000
commitec5bb3116786c5d4fff565e52e3e138d6c8739f6 (patch)
treefc12376314b50972f5ef2291d9c2dfb4ed39c217 /gnu/lib/libiberty/include
parent3cd8d3035fd3f38ad91973ecc8eaadabf80c2b02 (diff)
OpenBSD changes: synch somewhere between binutils-2.10 and 2.11
Support for mkstemps in choose-temp.
Diffstat (limited to 'gnu/lib/libiberty/include')
-rw-r--r--gnu/lib/libiberty/include/demangle.h16
-rw-r--r--gnu/lib/libiberty/include/libiberty.h38
-rw-r--r--gnu/lib/libiberty/include/obstack.h18
-rw-r--r--gnu/lib/libiberty/include/splay-tree.h9
-rw-r--r--gnu/lib/libiberty/include/symcat.h4
5 files changed, 63 insertions, 22 deletions
diff --git a/gnu/lib/libiberty/include/demangle.h b/gnu/lib/libiberty/include/demangle.h
index 63fe5e2adf4..a6234119aff 100644
--- a/gnu/lib/libiberty/include/demangle.h
+++ b/gnu/lib/libiberty/include/demangle.h
@@ -78,6 +78,16 @@ extern enum demangling_styles
#define HP_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_HP)
#define EDG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_EDG)
+/* Provide information about the available demangle styles. This code is
+ pulled from gdb into libiberty because it is useful to binutils also. */
+
+extern struct demangler_engine
+{
+ const char *demangling_style_name;
+ enum demangling_styles demangling_style;
+ const char *demangling_style_doc;
+} libiberty_demanglers[];
+
extern char *
cplus_demangle PARAMS ((const char *mangled, int options));
@@ -92,4 +102,10 @@ cplus_mangle_opname PARAMS ((const char *opname, int options));
extern void
set_cplus_marker_for_demangling PARAMS ((int ch));
+extern enum demangling_styles
+cplus_demangle_set_style PARAMS ((enum demangling_styles style));
+
+extern enum demangling_styles
+cplus_demangle_name_to_style PARAMS ((const char *name));
+
#endif /* DEMANGLE_H */
diff --git a/gnu/lib/libiberty/include/libiberty.h b/gnu/lib/libiberty/include/libiberty.h
index cf313662ef4..05114a27b6c 100644
--- a/gnu/lib/libiberty/include/libiberty.h
+++ b/gnu/lib/libiberty/include/libiberty.h
@@ -51,14 +51,23 @@ extern char *concat PARAMS ((const char *, ...));
extern int fdmatch PARAMS ((int fd1, int fd2));
+/* Get the working directory. The result is cached, so don't call
+ chdir() between calls to getpwd(). */
+
+extern char * getpwd PARAMS ((void));
+
/* Get the amount of time the process has run, in microseconds. */
extern long get_run_time PARAMS ((void));
-/* Choose a temporary directory to use for scratch files. */
+/* Choose a temporary directory to use for scratch files, DEPRECATED */
extern char *choose_temp_base PARAMS ((void));
+/* Return a temporary file name or NULL if unable to create one. */
+
+extern char *make_temp_file PARAMS ((const char *));
+
/* Allocate memory filled with spaces. Allocates using malloc. */
extern const char *spaces PARAMS ((int count));
@@ -108,11 +117,7 @@ extern int xatexit PARAMS ((void (*fn) (void)));
/* Exit, calling all the functions registered with xatexit. */
-#ifndef __GNUC__
extern void xexit PARAMS ((int status));
-#else
-void xexit PARAMS ((int status)) __attribute__ ((noreturn));
-#endif
/* Set the program name used by xmalloc. */
@@ -125,13 +130,14 @@ extern void xmalloc_set_program_name PARAMS ((const char *));
#ifdef ANSI_PROTOTYPES
/* Get a definition for size_t. */
#include <stddef.h>
+/* Get a definition for va_list. */
+#include <stdarg.h>
#endif
extern PTR xmalloc PARAMS ((size_t));
-/* Reallocate memory without fail. This works like xmalloc.
-
- FIXME: We do not declare the parameter types for the same reason as
- xmalloc. */
+/* Reallocate memory without fail. This works like xmalloc. Note,
+ realloc type functions are not suitable for attribute malloc since
+ they may return the same address across multiple calls. */
extern PTR xrealloc PARAMS ((PTR, size_t));
@@ -144,6 +150,10 @@ extern PTR xcalloc PARAMS ((size_t, size_t));
extern char *xstrdup PARAMS ((const char *));
+/* Copy an existing memory buffer to a new memory buffer without fail. */
+
+extern PTR xmemdup PARAMS ((const PTR, size_t, size_t));
+
/* hex character manipulation routines */
#define _hex_array_size 256
@@ -172,6 +182,16 @@ extern int pexecute PARAMS ((const char *, char * const *, const char *,
extern int pwait PARAMS ((int, int *, int));
+/* Like sprintf but provides a pointer to malloc'd storage, which must
+ be freed by the caller. */
+
+extern int asprintf PARAMS ((char **, const char *, ...));
+
+/* Like vsprintf but provides a pointer to malloc'd storage, which
+ must be freed by the caller. */
+
+extern int vasprintf PARAMS ((char **, const char *, va_list));
+
#ifdef __cplusplus
}
#endif
diff --git a/gnu/lib/libiberty/include/obstack.h b/gnu/lib/libiberty/include/obstack.h
index 38e96777660..a20ab55967a 100644
--- a/gnu/lib/libiberty/include/obstack.h
+++ b/gnu/lib/libiberty/include/obstack.h
@@ -143,12 +143,16 @@ extern "C" {
#if defined _LIBC || defined HAVE_STRING_H
# include <string.h>
-# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+# if defined __STDC__ && __STDC__
+# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+# else
+# define _obstack_memcpy(To, From, N) memcpy ((To), (char *)(From), (N))
+# endif
#else
# ifdef memcpy
-# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+# define _obstack_memcpy(To, From, N) memcpy ((To), (char *)(From), (N))
# else
-# define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N))
+# define _obstack_memcpy(To, From, N) bcopy ((char *)(From), (To), (N))
# endif
#endif
@@ -385,7 +389,7 @@ __extension__ \
int __len = (length); \
if (__o->next_free + __len > __o->chunk_limit) \
_obstack_newchunk (__o, __len); \
- _obstack_memcpy (__o->next_free, (char *) (where), __len); \
+ _obstack_memcpy (__o->next_free, (where), __len); \
__o->next_free += __len; \
(void) 0; })
@@ -395,7 +399,7 @@ __extension__ \
int __len = (length); \
if (__o->next_free + __len + 1 > __o->chunk_limit) \
_obstack_newchunk (__o, __len + 1); \
- _obstack_memcpy (__o->next_free, (char *) (where), __len); \
+ _obstack_memcpy (__o->next_free, (where), __len); \
__o->next_free += __len; \
*(__o->next_free)++ = 0; \
(void) 0; })
@@ -510,14 +514,14 @@ __extension__ \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
- _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
+ _obstack_memcpy ((h)->next_free, (where), (h)->temp), \
(h)->next_free += (h)->temp)
# define obstack_grow0(h,where,length) \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \
- _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
+ _obstack_memcpy ((h)->next_free, (where), (h)->temp), \
(h)->next_free += (h)->temp, \
*((h)->next_free)++ = 0)
diff --git a/gnu/lib/libiberty/include/splay-tree.h b/gnu/lib/libiberty/include/splay-tree.h
index e828fe7e907..6d70c8d9075 100644
--- a/gnu/lib/libiberty/include/splay-tree.h
+++ b/gnu/lib/libiberty/include/splay-tree.h
@@ -44,7 +44,7 @@ typedef unsigned long int splay_tree_key;
typedef unsigned long int splay_tree_value;
/* Forward declaration for a node in the tree. */
-typedef struct splay_tree_node *splay_tree_node;
+typedef struct splay_tree_node_s *splay_tree_node;
/* The type of a function which compares two splay-tree keys. The
function should return values as for qsort. */
@@ -62,7 +62,7 @@ typedef void (*splay_tree_delete_value_fn) PARAMS((splay_tree_value));
typedef int (*splay_tree_foreach_fn) PARAMS((splay_tree_node, void*));
/* The nodes in the splay tree. */
-struct splay_tree_node
+struct splay_tree_node_s
{
/* The key. */
splay_tree_key key;
@@ -76,7 +76,7 @@ struct splay_tree_node
};
/* The splay tree itself. */
-typedef struct splay_tree
+typedef struct splay_tree_s
{
/* The root of the tree. */
splay_tree_node root;
@@ -95,7 +95,8 @@ extern splay_tree splay_tree_new PARAMS((splay_tree_compare_fn,
splay_tree_delete_key_fn,
splay_tree_delete_value_fn));
extern void splay_tree_delete PARAMS((splay_tree));
-extern void splay_tree_insert PARAMS((splay_tree,
+extern splay_tree_node splay_tree_insert
+ PARAMS((splay_tree,
splay_tree_key,
splay_tree_value));
extern splay_tree_node splay_tree_lookup
diff --git a/gnu/lib/libiberty/include/symcat.h b/gnu/lib/libiberty/include/symcat.h
index 01efada2618..3e27162b264 100644
--- a/gnu/lib/libiberty/include/symcat.h
+++ b/gnu/lib/libiberty/include/symcat.h
@@ -1,6 +1,6 @@
/* Symbol concatenation utilities.
- Copyright (C) 1998, Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000 Free Software Foundation, Inc.
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
@@ -28,7 +28,7 @@
#define CONCAT2(a,b) a/**/b
#define CONCAT3(a,b,c) a/**/b/**/c
#define CONCAT4(a,b,c,d) a/**/b/**/c/**/d
-#define STRINGX(s) "?"
+#define STRINGX(s) "s"
#endif
#define XCONCAT2(a,b) CONCAT2(a,b)