aboutsummaryrefslogtreecommitdiffstats
path: root/qm.h
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2020-11-19 17:51:05 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2020-11-19 17:51:05 +0000
commit12e75ea93823cee60843a967d5f38e53622c3125 (patch)
treedf90172ef97a6136438ccc463812ad7f08ceaee7 /qm.h
parent1b51acd8802543fdb53b490ff16b085eb89aba11 (diff)
downloadQuine-McCluskey-12e75ea93823cee60843a967d5f38e53622c3125.tar.gz
Quine-McCluskey-12e75ea93823cee60843a967d5f38e53622c3125.zip
added parsing from string into structs and added print func
Diffstat (limited to 'qm.h')
-rw-r--r--qm.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/qm.h b/qm.h
new file mode 100644
index 0000000..173dd4c
--- /dev/null
+++ b/qm.h
@@ -0,0 +1,27 @@
+#ifndef QM_C
+#define QM_C
+
+#include <string.h>
+
+typedef struct {
+ char var;
+ bool not_;
+} Variable;
+
+typedef struct {
+ unsigned int numVars;
+ Variable vars[26];
+} DNFTerm;
+
+typedef struct {
+ unsigned int numTerms;
+ DNFTerm terms[100];
+} DNF;
+
+unsigned int strcnt(const char* str, const char cnt);
+DNF parseDNFStr(const char* inpStr);
+DNFTerm parseDNFTerm(const char* termStr);
+void printForm(const DNF form);
+void printForm2(const DNF form);
+
+#endif \ No newline at end of file