diff options
author | Alan Modra <amodra@gmail.com> | 2023-04-30 20:42:30 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-05-03 15:00:05 +0930 |
commit | 717d4bd6d199fcf834f741489aaf3bd800f9769f (patch) | |
tree | 41ecfc03c6cd82e376d3b8bfe328842af6a7a250 /bfd/libbfd.c | |
parent | a41bd1c837f9b71b44dbb71c2d47814326cfaa8d (diff) | |
download | gdb-717d4bd6d199fcf834f741489aaf3bd800f9769f.zip gdb-717d4bd6d199fcf834f741489aaf3bd800f9769f.tar.gz gdb-717d4bd6d199fcf834f741489aaf3bd800f9769f.tar.bz2 |
Generated docs and include files
bfd/doc/chew.c extracts documentation from source code comments
annotated with keywords, and generates much of bfd.h and libbfd.h from
those same comments. The docs have suffered from people (me too)
adding things like CODE_FRAGMENT to the source to put code into bfd.h
without realising that CODE_FRAGMENT also puts @example around said
code into the docs. So we have random senseless things in the docs.
This patch fixes that problem (well, the senseless things from
CODE_FRAGMENT), moves most of the code out of bfd-in.h, and improves a
few chew.c features. libbfd.h now automatically gets ATTRIBUTE_HIDDEN
prototypes, and indentation in bfd.h and libbfd.h is better.
Diffstat (limited to 'bfd/libbfd.c')
-rw-r--r-- | bfd/libbfd.c | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/bfd/libbfd.c b/bfd/libbfd.c index 66ef324..7c75047 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -264,7 +264,7 @@ INTERNAL_FUNCTION bfd_malloc SYNOPSIS - extern void * bfd_malloc (bfd_size_type SIZE) ATTRIBUTE_HIDDEN; + void *bfd_malloc (bfd_size_type {*size*}); DESCRIPTION Returns a pointer to an allocated block of memory that is at least @@ -299,7 +299,7 @@ INTERNAL_FUNCTION bfd_realloc SYNOPSIS - extern void * bfd_realloc (void * MEM, bfd_size_type SIZE) ATTRIBUTE_HIDDEN; + void *bfd_realloc (void *{*mem*}, bfd_size_type {*size*}); DESCRIPTION Returns a pointer to an allocated block of memory that is at least @@ -349,7 +349,7 @@ INTERNAL_FUNCTION bfd_realloc_or_free SYNOPSIS - extern void * bfd_realloc_or_free (void * MEM, bfd_size_type SIZE) ATTRIBUTE_HIDDEN; + void *bfd_realloc_or_free (void *{*mem*}, bfd_size_type {*size*}); DESCRIPTION Returns a pointer to an allocated block of memory that is at least @@ -394,7 +394,7 @@ INTERNAL_FUNCTION bfd_zmalloc SYNOPSIS - extern void * bfd_zmalloc (bfd_size_type SIZE) ATTRIBUTE_HIDDEN; + void *bfd_zmalloc (bfd_size_type {*size*}); DESCRIPTION Returns a pointer to an allocated block of memory that is at least @@ -701,6 +701,35 @@ DESCRIPTION #define COERCE64(x) \ (((uint64_t) (x) ^ ((uint64_t) 1 << 63)) - ((uint64_t) 1 << 63)) +/* +FUNCTION + Byte swapping routines. + +SYNOPSIS + uint64_t bfd_getb64 (const void *); + uint64_t bfd_getl64 (const void *); + int64_t bfd_getb_signed_64 (const void *); + int64_t bfd_getl_signed_64 (const void *); + bfd_vma bfd_getb32 (const void *); + bfd_vma bfd_getl32 (const void *); + bfd_signed_vma bfd_getb_signed_32 (const void *); + bfd_signed_vma bfd_getl_signed_32 (const void *); + bfd_vma bfd_getb16 (const void *); + bfd_vma bfd_getl16 (const void *); + bfd_signed_vma bfd_getb_signed_16 (const void *); + bfd_signed_vma bfd_getl_signed_16 (const void *); + void bfd_putb64 (uint64_t, void *); + void bfd_putl64 (uint64_t, void *); + void bfd_putb32 (bfd_vma, void *); + void bfd_putl32 (bfd_vma, void *); + void bfd_putb24 (bfd_vma, void *); + void bfd_putl24 (bfd_vma, void *); + void bfd_putb16 (bfd_vma, void *); + void bfd_putl16 (bfd_vma, void *); + uint64_t bfd_get_bits (const void *, int, bool); + void bfd_put_bits (uint64_t, void *, int, bool); +*/ + bfd_vma bfd_getb16 (const void *p) { |