home *** CD-ROM | disk | FTP | other *** search
- /*
- pro_util.h
- $Revision: 1.7 $ $Date: 1993/10/18 22:31:24 $
- $Source: /cmplrs.src/v4.00/libdwarf/RCS/pro_util.h,v $
-
- Utility routines
-
- */
-
- /* leb 128 related routines */
-
- /* this currently encodes only unsigned numbers, need one for signed
- numbers too */
- char * _dwarf_pro_encode_leb128(Dwarf_Unsigned val, int *nbytes);
-
- char * _dwarf_pro_encode_signed_leb128 (Dwarf_Signed value, int *nbytes);
-
- void _dwarf_p_dealloc (Dwarf_P_Debug dbg, Dwarf_Small *ptr);
-
- #define IS_64BIT(dbg) ((dbg)->de_flags & DW_DLC_SIZE_64 ? 1 : 0)
-
- /* definition of sizes of types, given target machine */
- #define sizeof_sbyte(dbg) sizeof(Dwarf_Sbyte)
- #define sizeof_ubyte(dbg) sizeof(Dwarf_Ubyte)
- #define sizeof_uhalf(dbg) sizeof(Dwarf_Half)
- #define sizeof_uword(dbg) \
- (IS_64BIT(dbg) ? sizeof(Dwarf_Unsigned) : sizeof(Dwarf_Word))
- #define SIZEOF_UWORD(dbg) \
- (IS_64BIT(dbg) ? sizeof(Dwarf_Unsigned) : sizeof(Dwarf_Word))
- #define sizeof_sword(dbg) sizeof_uword(dbg)
-
- /* Computes amount of padding necessary to align n to a k-boundary. */
- /* Important: Assumes n, k both GREATER than zero. */
- #define PADDING(n, k) ( (k)-1 - ((n)-1)%(k) )
-