/usr/include/libr/r_types.h is in libradare2-dev 0.9.6-3.1+deb8u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | #ifndef _INCLUDE_R_TYPES_H_
#define _INCLUDE_R_TYPES_H_
// TODO: fix this to make it crosscompile-friendly: R_SYS_OSTYPE ?
/* operating system */
#undef __BSD__
#undef __KFBSD__
#undef __UNIX__
#undef __WINDOWS__
#ifdef __HAIKU__
# define __UNIX__ 1
#endif
#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
#define __KFBSD__ 1
#else
#define __KFBSD__ 0
#endif
#if defined(EMSCRIPTEN) || defined(__linux__) || defined(__APPLE__) || defined(__GNU__) || defined(__ANDROID__) || defined(__QNX__)
#define __BSD__ 0
#define __UNIX__ 1
#endif
#if __KFBSD__ || defined(__NetBSD__) || defined(__OpenBSD__)
#define __BSD__ 1
#define __UNIX__ 1
#endif
#if __WIN32__ || __CYGWIN__ || MINGW32
#define __addr_t_defined
#include <windows.h>
#include <winsock.h>
#undef USE_SOCKETS
#define __WINDOWS__ 1
#undef __UNIX__
#undef __BSD__
#endif
#include <r_userconf.h>
#include <r_types_base.h>
#undef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
#undef _GNU_SOURCE
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <sys/time.h>
#include <fcntl.h> /* for O_RDONLY */
#ifdef __cplusplus
extern "C" {
#endif
#ifndef GIT_TAP
#define GIT_TAP R2_VERSION
#endif
#define R_LIB_VERSION_HEADER(x) \
const char *x##_version();
#define R_LIB_VERSION(x) \
const char *x##_version() { return ""GIT_TAP; }
// TODO: FS or R_SYS_DIR ??
#undef FS
#if __WINDOWS__
#define FS "\\"
#define R_SYS_DIR "\\"
#define R_SYS_HOME "USERPROFILE"
#else
#define FS "/"
#define R_SYS_DIR "/"
#define R_SYS_HOME "HOME"
#endif
#define R2_HOMEDIR ".config/radare2"
#ifndef __packed
#define __packed __attribute__((__packed__))
#endif
#ifndef UNUSED
#ifdef __GNUC__
#define UNUSED __attribute__((__unused__))
#else
#define UNUSED
#endif
#endif
typedef void (*PrintfCallback)(const char *str, ...);
// TODO NOT USED. DEPREACATE
#if R_RTDEBUG
#define IFRTDBG if (getenv ("LIBR_DEBUG"))
#else
#define IFRTDBG if (0)
#endif
/* compile-time introspection helpers */
#define CTO(y,z) ((size_t) &((y*)0)->z)
#define CTA(x,y,z) (x+CTO(y,z))
#define CTI(x,y,z) (*((size_t*)(CTA(x,y,z))))
#define CTS(x,y,z,t,v) {t* _=(t*)CTA(x,y,z);*_=v;}
#ifdef R_API
#undef R_API
#endif
#if R_SWIG
#define R_API export
#elif R_INLINE
#define R_API inline
#else
#if defined(__GNUC__)
#define R_API __attribute__((visibility("default")))
#else
#define R_API
#endif
#endif
#define BITS2BYTES(x) ((x/8)+((x%8)?1:0))
#define ZERO_FILL(x) memset (&x, 0, sizeof (x))
#define R_NEWS0(x,y) (x*)memset (malloc(sizeof(x)*y), 0, sizeof(x)*y);
#define R_NEWS(x,y) (x*)malloc(sizeof(x)*y)
#define R_NEW(x) (x*)malloc(sizeof(x))
#define R_NEW0(x) (x*)calloc(1,sizeof(x))
// TODO: Make R_NEW_COPY be 1 arg, not two
#define R_NEW_COPY(x,y) x=(y*)malloc(sizeof(y));memcpy(x,y,sizeof(y))
#define IS_PRINTABLE(x) (x>=' '&&x<='~')
#define IS_WHITESPACE(x) (x==' '||x=='\t')
#define R_MEM_ALIGN(x) ((void *)(size_t)(((ut64)(size_t)x) & 0xfffffffffffff000LL))
#define R_PTR_ALIGN(v,t) \
((char *)(((size_t)(v) ) \
& ~(t - 1)))
#define R_PTR_ALIGN_NEXT(v,t) \
((char *)(((size_t)(v) + (t - 1)) \
& ~(t - 1)))
#define R_BIT_SET(x,y) (x[y>>4] |= (1<<(y&0xf)))
#define R_BIT_UNSET(x,y) (x[y>>4] &= ~(1<<(y&0xf)))
#define R_BIT_CHK(x,y) ((x[y>>4] & (1<<(y&0xf))))
#if __UNIX__
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#endif
#include <unistd.h>
/* TODO: Move outside */
#define _perror(str,file,line) \
{ char buf[128];snprintf(buf,sizeof(buf),"%s:%d %s",file,line,str);perror(buf); }
#define perror(x) _perror(x,__FILE__,__LINE__)
#define eprintf(x,y...) fprintf(stderr,x,##y)
#define R_ROUND(x,y) ((x)%(y))?(x)+((y)-((x)%(y))):(x)
#define R_DIM(x,y,z) (((x)<(y))?(y):((x)>(z))?(z):(x))
#define R_MAX(x,y) ((x)>(y))?x:y
#define R_MIN(x,y) ((x)>(y))?y:x
#define R_ABS(x) (((x)<0)?-(x):(x))
#define R_BTW(x,y,z) (((x)>=(y))&&((y)<=(z)))?y:x
#define R_FREE(x) { free(x); x = NULL; }
#if __WINDOWS__
#define HAVE_REGEXP 0
#else
#define HAVE_REGEXP 1
#endif
#if __WINDOWS__
#define PFMT64x "I64x"
#define PFMT64d "I64d"
#define PFMT64u "I64u"
#define PFMT64o "I64o"
#else
#define PFMT64x "llx"
#define PFMT64d "lld"
#define PFMT64u "llu"
#define PFMT64o "llo"
#endif
#ifndef O_BINARY
#define O_BINARY 0
#endif
#if __APPLE__
# if __i386__
# define R_SYS_BASE ((ut64)0x1000)
# elif __x86_64__
# define R_SYS_BASE ((ut64)0x100000000)
# else
# define R_SYS_BASE ((ut64)0x1000)
# endif
#elif __WINDOWS__
# define R_SYS_BASE ((ut64)0x01001000)
#else // linux, bsd, ...
# if __arm__
# define R_SYS_BASE ((ut64)0x4000)
# else
# define R_SYS_BASE ((ut64)0x8048000)
# endif
#endif
/* arch */
#if __i386__
#define R_SYS_ARCH "x86"
#define R_SYS_BITS R_SYS_BITS_32
#elif __x86_64__
#define R_SYS_ARCH "x86"
#define R_SYS_BITS (R_SYS_BITS_32 | R_SYS_BITS_64)
#elif __POWERPC__
#define R_SYS_ARCH "ppc"
#define R_SYS_BITS R_SYS_BITS_32
#elif __arm__
#define R_SYS_ARCH "arm"
#define R_SYS_BITS R_SYS_BITS_32
#elif __arc__
#define R_SYS_ARCH "arc"
#define R_SYS_BITS R_SYS_BITS_32
#elif __sparc__
#define R_SYS_ARCH "sparc"
#define R_SYS_BITS R_SYS_BITS_32
#elif __mips__
#define R_SYS_ARCH "mips"
#define R_SYS_BITS R_SYS_BITS_32
#else
#define R_SYS_ARCH "unknown"
#define R_SYS_BITS R_SYS_BITS_32
#endif
enum {
R_SYS_ARCH_NONE = 0,
R_SYS_ARCH_X86 = 0x1,
R_SYS_ARCH_ARM = 0x2,
R_SYS_ARCH_PPC = 0x4,
R_SYS_ARCH_M68K = 0x8,
R_SYS_ARCH_JAVA = 0x10,
R_SYS_ARCH_MIPS = 0x20,
R_SYS_ARCH_SPARC = 0x40,
R_SYS_ARCH_CSR = 0x80,
R_SYS_ARCH_MSIL = 0x100,
R_SYS_ARCH_OBJD = 0x200,
R_SYS_ARCH_BF = 0x400,
R_SYS_ARCH_SH = 0x800,
R_SYS_ARCH_AVR = 0x1000,
R_SYS_ARCH_DALVIK = 0x2000,
R_SYS_ARCH_Z80 = 0x4000,
R_SYS_ARCH_ARC = 0x8000,
R_SYS_ARCH_I8080 = 0x10000,
R_SYS_ARCH_RAR = 0x20000,
R_SYS_ARCH_8051 = 0x40000,
R_SYS_ARCH_C55PLUS = 0x80000,
};
/* os */
#if defined (__QNX__)
#define R_SYS_OS "qnx"
#elif defined (__APPLE__)
#define R_SYS_OS "darwin"
#elif defined (__linux__)
#define R_SYS_OS "linux"
#elif defined (__WIN32__) || defined (__CYGWIN__) || defined (MINGW32)
#define R_SYS_OS "windows"
#elif defined (__NetBSD__ )
#define R_SYS_OS "netbsd"
#elif defined (__OpenBSD__)
#define R_SYS_OS "openbsd"
#elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
#define R_SYS_OS "freebsd"
#else
#define R_SYS_OS "unknown"
#endif
/* endian */
#if LIL_ENDIAN
#define R_SYS_ENDIAN "little"
#else
#define R_SYS_ENDIAN "big"
#endif
#ifdef __cplusplus
}
#endif
#endif
// Usage: R_DEFINE_OBJECT(r_asm);
#if 0
#define R_DEFINE_OBJECT(type) \
R_API struct type##_t* type##_new() { \
return type##_init(R_NEW(struct type##_t)); \
} \
R_API struct type##_t* type##_free(struct type##_t *foo) { \
return (type##_deinit(foo), free(foo), NULL); \
}
#endif
|