Add placeholders for encoders
authorbdemsky <bdemsky@uci.edu>
Fri, 16 Jun 2017 04:45:23 +0000 (21:45 -0700)
committerbdemsky <bdemsky@uci.edu>
Fri, 16 Jun 2017 04:46:32 +0000 (21:46 -0700)
src/Encoders/elementencoder.c [new file with mode: 0644]
src/Encoders/elementencoder.h [new file with mode: 0644]
src/Encoders/functionencoder.c [new file with mode: 0644]
src/Encoders/functionencoder.h [new file with mode: 0644]
src/Makefile
src/classlist.h

diff --git a/src/Encoders/elementencoder.c b/src/Encoders/elementencoder.c
new file mode 100644 (file)
index 0000000..407a478
--- /dev/null
@@ -0,0 +1,12 @@
+#include "elementencoder.h"
+
+ElementEncoder * allocElementEncoder(ElementEncoderType type, Element *element) {
+       ElementEncoder * this=(ElementEncoder *)ourmalloc(sizeof(ElementEncoder));
+       this->element=element;
+       this->type=type;
+       return this;
+}
+
+void deleteElementEncoder(ElementEncoder *this) {
+       ourfree(this);
+}
diff --git a/src/Encoders/elementencoder.h b/src/Encoders/elementencoder.h
new file mode 100644 (file)
index 0000000..5c03adb
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef ELEMENTENCODER_H
+#define ELEMENTENCODER_H
+#include "classlist.h"
+
+enum ElementEncoderType {
+       ONEHOT, UNARY, BINARY, ONEHOTBINARY
+};
+
+typedef enum ElementEncoderType ElementEncoderType;
+
+struct ElementEncoder {
+       ElementEncoderType type;
+       Element * element;
+};
+
+ElementEncoder * allocElementEncoder(ElementEncoderType type, Element *element);
+void deleteElementEncoder(ElementEncoder *this);
+#endif
diff --git a/src/Encoders/functionencoder.c b/src/Encoders/functionencoder.c
new file mode 100644 (file)
index 0000000..119623a
--- /dev/null
@@ -0,0 +1,12 @@
+#include "functionencoder.h"
+
+FunctionEncoder * allocFunctionEncoder(FunctionEncoderType type, Function *function) {
+       FunctionEncoder * this=(FunctionEncoder *)ourmalloc(sizeof(FunctionEncoder));
+       this->function=function;
+       this->type=type;
+       return this;
+}
+
+void deleteFunctionEncoder(FunctionEncoder *this) {
+       ourfree(this);
+}
diff --git a/src/Encoders/functionencoder.h b/src/Encoders/functionencoder.h
new file mode 100644 (file)
index 0000000..3473d95
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef FUNCTIONENCODER_H
+#define FUNCTIONENCODER_H
+#include "classlist.h"
+
+enum FunctionEncoderType {
+       ENUMERATEIMPLICATIONS
+};
+
+typedef enum FunctionEncoderType FunctionEncoderType;
+
+struct FunctionEncoder {
+       FunctionEncoderType type;
+       Function * function;
+};
+
+FunctionEncoder * allocFunctionEncoder(FunctionEncoderType type, Function *function);
+void deleteFunctionEncoder(FunctionEncoder *this);
+#endif
index 366cfd5..311e361 100644 (file)
@@ -65,6 +65,9 @@ tabbing:
        uncrustify -c C.cfg --no-backup *.c
        uncrustify -c C.cfg --no-backup *.h */*.h
 
+wc:
+       wc */*.c */*.h *.c *.h
+
 .PHONY: $(PHONY)
 
 # A 1-inch margin PDF generated by 'pandoc'
index c6a7cb7..ac07af9 100644 (file)
@@ -48,6 +48,12 @@ typedef struct Table Table;
 struct Order;
 typedef struct Order Order;
 
+struct ElementEncoder;
+typedef struct ElementEncoder ElementEncoder;
+
+struct FunctionEncoder;
+typedef struct FunctionEncoder FunctionEncoder;
+
 typedef unsigned int uint;
 typedef uint64_t VarType;
 #endif