File: rarc2.h

package info (click to toggle)
radare2 0.9.6-3.1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 17,496 kB
  • ctags: 45,959
  • sloc: ansic: 240,999; sh: 3,645; makefile: 2,520; python: 1,212; asm: 312; ruby: 214; awk: 209; perl: 188; lisp: 169; java: 23; xml: 17; php: 6
file content (63 lines) | stat: -rw-r--r-- 1,709 bytes parent folder | download | duplicates (3)
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
#ifndef _INCLUDE_RCC_H_
#define _INCLUDE_RCC_H_

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>

#include "config.h"

enum {
	NORMAL = 0,
	ALIAS,
	DATA,
	INLINE,
	SYSCALL,
	SYSCALLBODY,
	LAST
};

#define eprintf(x,y...) (fprintf(stderr,"\x1b[33m"x"\x1b[0m",##y),1)
#define FREE(x) free(x); x=NULL
#define IS_VAR(x) (x[0]=='.'||((x[0]=='*'||x[0]=='&')&&x[1]=='.'))
#define MAX 255

extern void rcc_puts(const char *str);
extern void rcc_printf(const char *fmt, ...);
extern void rcc_flush();
extern void rcc_init();
extern char *mk_var(char *out, const char *str, int delta);
extern int attsyntax;

/* emit */
typedef unsigned long long ut64;

struct emit_t {
	const char *arch;
	int size; /* in bytes.. 32bit arch is 4, 64bit is 8 .. */
	//const char *syscall_body;
	const char* (*regs)(int idx);
	void (*call)(const char *addr, int ptr);
	//void (*sc)(int num);
	void (*frame)(int sz);
	char* (*syscall)();
	void (*trap)();
	void (*frame_end)(int sz, int ctx);
	void (*comment)(const char *fmt, ...);
	void (*push_arg)(int xs, int num, const char *str);
	void (*set_string)(const char *dstvar, const char *str, int j);
	void (*equ)(const char *key, const char *value);
	void (*get_result)(const char *ocn);
	void (*restore_stack)(int size);
	void (*syscall_args)(int nargs);
	void (*get_var)(int type, char *out, int idx);
	void (*while_end)(const char *label);
	void (*load)(const char *str, int sz);
	void (*load_ptr)(const char *str);
	void (*branch)(char *b, char *g, char *e, char *n, int sz, const char *dst);
	void (*mathop)(int ch, int sz, int type, const char *eq, const char *p);
	void (*get_while_end)(char *out, const char *ctxpush, const char *label);
};

#endif