summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-11-26 10:49:39 -0500
committermidipix <writeonce@midipix.org>2016-11-10 23:35:27 -0500
commit949bb3ba304be9bd80cda27c37c2d0d0da6a67dd (patch)
tree0997564c1417fcbde8f29c692aa5889e79b6c6f1
parent2b7f36676ba14efc7a250a56a805493e8fddedde (diff)
downloadperk-949bb3ba304be9bd80cda27c37c2d0d0da6a67dd.tar.bz2
perk-949bb3ba304be9bd80cda27c37c2d0d0da6a67dd.tar.xz
move all output action- and formatting flags to a designated header.
-rw-r--r--include/perk/perk.h4
-rw-r--r--include/perk/perk_output.h18
-rw-r--r--src/driver/pe_driver_ctx.c1
-rw-r--r--src/perk.c1
4 files changed, 14 insertions, 10 deletions
diff --git a/include/perk/perk.h b/include/perk/perk.h
index fa23754..f34f7c1 100644
--- a/include/perk/perk.h
+++ b/include/perk/perk.h
@@ -8,7 +8,6 @@
#include "perk_consts.h"
#include "perk_structs.h"
#include "perk_meta.h"
-#include "perk_output.h"
#ifdef __cplusplus
extern "C" {
@@ -47,9 +46,6 @@ extern "C" {
/* unit action flags */
#define PERK_ACTION_MAP_READWRITE 0x0001
-/* unit (text) output & format flags */
-#define PERK_OUTPUT_EXPORT_SYMS 0x0001
-
struct pe_raw_image {
void * addr;
size_t size;
diff --git a/include/perk/perk_output.h b/include/perk/perk_output.h
index 36c6922..18ec373 100644
--- a/include/perk/perk_output.h
+++ b/include/perk/perk_output.h
@@ -1,12 +1,18 @@
#ifndef PERK_OUTPUT_H
#define PERK_OUTPUT_H
-#define PERK_OUTPUT_FORMAT_LIST 0x00000001
-#define PERK_OUTPUT_FORMAT_TABLE 0x00000002
-#define PERK_OUTPUT_FORMAT_READOBJ 0x00000004
-#define PERK_OUTPUT_FORMAT_OBJDUMP 0x00000008
+#include <stdint.h>
-#define PERK_OUTPUT_FIELD_NAME 0x00000100
-#define PERK_OUTPUT_FIELD_ALL 0x80000000
+#define PERK_PRETTY(x) ((uint64_t)x << 32)
+
+/* output actions */
+#define PERK_OUTPUT_EXPORT_SYMS 0x00000001
+
+
+/* pretty-printer flags */
+#define PERK_PRETTY_LIST PERK_PRETTY(0x00000001)
+#define PERK_PRETTY_TABLE PERK_PRETTY(0x00000002)
+#define PERK_PRETTY_READOBJ PERK_PRETTY(0x00000004)
+#define PERK_PRETTY_OBJDUMP PERK_PRETTY(0x00000008)
#endif
diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c
index 32bd190..a463e9a 100644
--- a/src/driver/pe_driver_ctx.c
+++ b/src/driver/pe_driver_ctx.c
@@ -1,6 +1,7 @@
#include <stdint.h>
#include <fcntl.h>
#include <perk/perk.h>
+#include <perk/perk_output.h>
#include "argv/argv.h"
enum app_tags {
diff --git a/src/perk.c b/src/perk.c
index 5023750..17872a2 100644
--- a/src/perk.c
+++ b/src/perk.c
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <perk/perk.h>
+#include <perk/perk_output.h>
#ifndef PERK_DRIVER_FLAGS
#define PERK_DRIVER_FLAGS PERK_DRIVER_VERBOSITY_ERRORS|PERK_DRIVER_VERBOSITY_USAGE