2016-09-21 23:54:18 +03:00
|
|
|
#ifndef COMPEL_PIEGEN_H__
|
|
|
|
#define COMPEL_PIEGEN_H__
|
2015-06-05 00:04:02 +03:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2016-04-29 22:47:00 +03:00
|
|
|
#include <elf.h>
|
2016-10-27 19:05:28 +03:00
|
|
|
|
|
|
|
#include "common/compiler.h"
|
2016-04-29 22:47:00 +03:00
|
|
|
|
2015-06-05 00:04:02 +03:00
|
|
|
typedef struct {
|
2021-07-19 07:39:51 +00:00
|
|
|
char *input_filename;
|
|
|
|
char *output_filename;
|
|
|
|
char *prefix;
|
|
|
|
FILE *fout;
|
2015-06-05 00:04:02 +03:00
|
|
|
} piegen_opt_t;
|
|
|
|
|
|
|
|
extern piegen_opt_t opts;
|
|
|
|
|
2021-07-19 07:39:51 +00:00
|
|
|
#define pr_out(fmt, ...) \
|
|
|
|
do { \
|
|
|
|
if (opts.fout) \
|
|
|
|
fprintf(opts.fout, fmt, ##__VA_ARGS__); \
|
|
|
|
} while (0)
|
2015-06-05 00:04:02 +03:00
|
|
|
|
2016-04-29 22:47:00 +03:00
|
|
|
extern int handle_binary(void *mem, size_t size);
|
|
|
|
|
2016-09-21 23:54:18 +03:00
|
|
|
#endif /* COMPEL_PIEGEN_H__ */
|