| 1 |
/* |
| 2 |
Copyright (c) 2018-2023, David Anderson |
| 3 |
All rights reserved. |
| 4 |
|
| 5 |
Redistribution and use in source and binary forms, with |
| 6 |
or without modification, are permitted provided that the |
| 7 |
following conditions are met: |
| 8 |
|
| 9 |
Redistributions of source code must retain the above |
| 10 |
copyright notice, this list of conditions and the following |
| 11 |
disclaimer. |
| 12 |
|
| 13 |
Redistributions in binary form must reproduce the above |
| 14 |
copyright notice, this list of conditions and the following |
| 15 |
disclaimer in the documentation and/or other materials |
| 16 |
provided with the distribution. |
| 17 |
|
| 18 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND |
| 19 |
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, |
| 20 |
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 21 |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 22 |
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR |
| 23 |
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 |
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 25 |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 26 |
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 27 |
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 28 |
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 29 |
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
| 30 |
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 |
|
| 32 |
*/ |
| 33 |
#ifndef DWARF_READING_H |
| 34 |
#define DWARF_READING_H |
| 35 |
|
| 36 |
#ifdef __cplusplus |
| 37 |
extern "C" { |
| 38 |
#endif /* __cplusplus */ |
| 39 |
|
| 40 |
#ifndef DW_DLV_OK |
| 41 |
/* DW_DLV_OK must match libdwarf.h */ |
| 42 |
/* DW_DLV_NO_ENTRY must match libdwarf.h */ |
| 43 |
#define DW_DLV_OK 0 |
| 44 |
#define DW_DLV_NO_ENTRY -1 |
| 45 |
#define DW_DLV_ERROR 1 |
| 46 |
#endif /* DW_DLV_OK */ |
| 47 |
|
| 48 |
#define ALIGN4 4 |
| 49 |
#define ALIGN8 8 |
| 50 |
|
| 51 |
#define PREFIX "\t" |
| 52 |
#define LUFMT "%lu" |
| 53 |
#define UFMT "%u" |
| 54 |
#define DFMT "%d" |
| 55 |
#define XFMT "0x%x" |
| 56 |
|
| 57 |
/* even if already seen, values must match, so no #ifdef needed. */ |
| 58 |
#define DW_DLV_NO_ENTRY -1 |
| 59 |
#define DW_DLV_OK 0 |
| 60 |
#define DW_DLV_ERROR 1 |
| 61 |
|
| 62 |
#define P printf |
| 63 |
#define F fflush(stdout) |
| 64 |
|
| 65 |
#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\ |
| 66 |
(f),(char *)(buf),(loc),(siz),(fsiz),(errc)); |
| 67 |
|
| 68 |
#ifdef __cplusplus |
| 69 |
} |
| 70 |
#endif /* __cplusplus */ |
| 71 |
|
| 72 |
#endif /* DWARF_READING_H */ |