summaryrefslogtreecommitdiff
path: root/outform.h
diff options
context:
space:
mode:
Diffstat (limited to 'outform.h')
-rw-r--r--outform.h84
1 files changed, 75 insertions, 9 deletions
diff --git a/outform.h b/outform.h
index e23f3c79..2e7a32d0 100644
--- a/outform.h
+++ b/outform.h
@@ -20,6 +20,9 @@
* OF_UNIX -- ensure that 'aout', 'aoutb', 'coff', 'elf' are in.
* OF_OTHERS -- ensure that 'bin', 'as86' & 'rdf' are in.
* OF_ALL -- ensure that all formats are included.
+ * note that this doesn't include 'dbg', which is
+ * only really useful if you're doing development
+ * work on NASM. Define OF_DBG if you want this.
*
* OF_DEFAULT=of_name -- ensure that 'name' is the default format.
*
@@ -35,12 +38,6 @@
#include "nasm.h"
-#define MAX_OUTPUT_FORMATS 16
-
-struct ofmt *ofmt_find(char *);
-void ofmt_list(struct ofmt *, FILE *);
-void ofmt_register (struct ofmt *);
-
/* -------------- USER MODIFIABLE PART ---------------- */
/*
@@ -60,7 +57,7 @@ void ofmt_register (struct ofmt *);
/* ====configurable info begins here==== */
/* formats configurable:
- * bin,obj,elf,aout,aoutb,coff,win32,as86,rdf */
+ * bin,obj,elf,aout,aoutb,coff,win32,as86,rdf,rdf2 */
/* process options... */
@@ -95,8 +92,8 @@ void ofmt_register (struct ofmt *);
#ifndef OF_AS86
#define OF_AS86
#endif
-#ifndef OF_RDF
-#define OF_RDF
+#ifndef OF_RDF2
+#define OF_RDF2
#endif
#endif /* OF_ALL */
@@ -138,6 +135,9 @@ void ofmt_register (struct ofmt *);
#ifndef OF_RDF
#define OF_RDF
#endif
+#ifndef OF_RDF2
+#define OF_RDF2
+#endif
#endif
/* finally... override any format specifically specifed to be off */
@@ -168,9 +168,75 @@ void ofmt_register (struct ofmt *);
#ifdef OF_NO_RDF
#undef OF_RDF
#endif
+#ifdef OF_NO_RDF2
+#undef OF_RDF
+#endif
#ifndef OF_DEFAULT
#define OF_DEFAULT of_bin
#endif
+#ifdef BUILD_DRIVERS_ARRAY /* only if included from outform.c */
+
+/* pull in the externs for the different formats, then make the *drivers
+ * array based on the above defines */
+
+extern struct ofmt of_bin;
+extern struct ofmt of_aout;
+extern struct ofmt of_aoutb;
+extern struct ofmt of_coff;
+extern struct ofmt of_elf;
+extern struct ofmt of_as86;
+extern struct ofmt of_obj;
+extern struct ofmt of_win32;
+extern struct ofmt of_rdf;
+extern struct ofmt of_rdf2;
+extern struct ofmt of_dbg;
+
+struct ofmt *drivers[]={
+#ifdef OF_BIN
+ &of_bin,
+#endif
+#ifdef OF_AOUT
+ &of_aout,
+#endif
+#ifdef OF_AOUTB
+ &of_aoutb,
+#endif
+#ifdef OF_COFF
+ &of_coff,
+#endif
+#ifdef OF_ELF
+ &of_elf,
+#endif
+#ifdef OF_AS86
+ &of_as86,
+#endif
+#ifdef OF_OBJ
+ &of_obj,
+#endif
+#ifdef OF_WIN32
+ &of_win32,
+#endif
+#ifdef OF_RDF
+ &of_rdf,
+#endif
+#ifdef OF_RDF2
+ &of_rdf2,
+#endif
+#ifdef OF_DBG
+ &of_dbg,
+#endif
+
+ NULL
+};
+
+#endif /* BUILD_DRIVERS_ARRAY */
+
+struct ofmt *ofmt_find(char *);
+struct dfmt *dfmt_find(struct ofmt *, char *);
+void ofmt_list(struct ofmt *, FILE *);
+void dfmt_list(struct ofmt *ofmt, FILE *fp);
+struct ofmt *ofmt_register (efunc error);
+
#endif /* NASM_OUTFORM_H */