chiark / gitweb /
old-style proto-parse thing, checkin before delete
authorian <ian>
Fri, 3 Jun 2005 23:13:54 +0000 (23:13 +0000)
committerian <ian>
Fri, 3 Jun 2005 23:13:54 +0000 (23:13 +0000)
hostside/pic-proto.c [new file with mode: 0644]
hostside/pic-proto.h

diff --git a/hostside/pic-proto.c b/hostside/pic-proto.c
new file mode 100644 (file)
index 0000000..0548662
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * arranges for the declarations of
+ *  enco_pic_WHATEVER
+ *  onrecv_pic_WHATEVER
+ * and the tables
+ */
+
+#ifndef PROTOCOL_H
+#define PROTOCOL_H
+
+#define HOST2PIC_0(n,o,a) HOST2PIC_1(n,o,a) 
+#define PIC2HOST_0(n,o,a) PIC2HOST_1(n,o,a)
+
+#if 0
+static void pe(PicInsn *out, );
+#define EP(objnum) { ep(out,o,a,objnum); }
+#define HOST2PIC_0(n,o,a) void enco_pic_##n(PicInsn *out)         EP(0)
+#define HOST2PIC_1(n,o,a) void enco_pic_##n(PicInsn *out, int oj) EP(oj)
+#define PIC2HOST_0(n,o,a) /**/
+#define PIC2HOST_1(n,o,a) /**/
+#include "proto-spec.h"
+#undef HOST2PIC_0
+#undef HOST2PIC_1
+#undef PIC2HOST_0
+#undef PIC2HOST_1
+#endif
+
+extern void enco_pic_polarity_begin(PicInsn *out);
+extern void enco_pic_polarity_setbit(PicInsn *out, int objnum);
+extern void on_pic_debug(int ch);
+
+const PicInsnInfo pic_command_infos[]= {
+#define HOST2PIC_1(n,o,a) { #n, o, a },
+#define PIC2HOST_1(n,o,a) /**/
+#undef PIC2HOST_1
+#include "proto-spec.h"
+#undef HOST2PIC_1
+#undef PIC2HOST_1
+};
+
+const PicInsnInfo pic_reply_infos[]= {
+#define HOST2PIC_1(n,o,a) /**/
+#define PIC2HOST_1(n,o,a) { #n, o, a },
+#undef PIC2HOST_1
+#include "proto-spec.h"
+#undef HOST2PIC_1
+#undef PIC2HOST_1
+};
+
+
+#undef HOST2PIC_1
+#undef HOST2PIC_0
+
+static void pe(PicInsn *out, );
+#define EP(objnum) { ep(out,o,a,objnum); }
+#define PIC2HOST_0(n,o,a) /**/
+#define PIC2HOST_1(n,o,a) /**/
+#include "proto-spec.h"
+#undef PIC2HOST_0
+
+#endif /*NMRA_H*/
index ed9252a285ada41eb8e1eb5fc2e2d742bb42e7b0..4774257c06366208e2f3ddf5a82e9c4403cb85f9 100644 (file)
@@ -5,8 +5,8 @@
  * and the tables
  */
 
-#ifndef PROTOCOL_H
-#define PROTOCOL_H
+#ifndef PIC_PROTO_H
+#define PIC_PROTO_H
 
 #define HOST2PIC_0(n,o,a) extern void enco_pic_##n(PicInsn *out);
 #define HOST2PIC_1(n,o,a) extern void enco_pic_##n(PicInsn *out, int objnum);
@@ -29,4 +29,6 @@ struct PicInsnInfo {
   int argbits;
 };
 
-#endif /*NMRA_H*/
+extern const PicInsnInfo pic_command_infos[], pic_reply_infos[];
+
+#endif /*PIC_PROTO_H*/