From a921e688ece81ac2699af3699535777ae090cabc Mon Sep 17 00:00:00 2001
From: Kia <kia@special-circumstanc.es>
Date: Thu, 14 Oct 2021 16:49:55 -0700
Subject: [PATCH] prepare to refactor

---
 gen_intrange.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/gen_intrange.c b/gen_intrange.c
index fb5511b..ae82fde 100644
--- a/gen_intrange.c
+++ b/gen_intrange.c
@@ -27,7 +27,8 @@ struct charset * new_charset(void) {
     return (struct charset *) calloc(sizeof(struct charset), 1);
 }
 
-void print_charset(struct charset *cs) {
+void print_charset(struct charset *cs, int depth) {
+    printf("current byte index = %d    ", depth);
     for (int i = 0; i<32; i++)
     	{
     		printf("%hhx ",cs->bitmap[i]);
@@ -36,8 +37,8 @@ void print_charset(struct charset *cs) {
 }
 
 
-void HCFS_ADD_CHARSET(struct charset *cs) {
-	print_charset(cs);
+void HCFS_ADD_CHARSET(struct charset *cs, int depth) {
+	print_charset(cs, depth);
 }
 
 void HCFS_BEGIN_CHOICE(void) {
@@ -59,10 +60,10 @@ void HCFS_END_SEQ(void) {
 	printf("END SEQ\n");
 }
 
-void HCFS_ADD_CHAR(uint8_t chr) {
+void HCFS_ADD_CHAR(uint8_t chr, int depth) {
 	struct charset *tcs = new_charset();
 	charset_set(tcs, chr, 1);
-	print_charset(tcs);
+	print_charset(tcs, depth);
 
 }
 
@@ -81,19 +82,20 @@ void HCFS_ADD_CHAR(uint8_t chr) {
 
 // we'll implement it first as just an array of arrays haha
 
-struct charset reorder_matchlines[8][8];
+struct charset matchlines[8][8];
 
 
 
 
 // branch on choices
-copy past stuff up to byte index as necessary
-do it without allocs first
+//copy past stuff up to byte index as necessary
+//do it without allocs first
 
 
 
 void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_byte_index) {
 	uint8_t current_byte_index = starting_byte_index;
+  uint8_t matchline_index = 0;
   // Possible FIXME: TallerThanMe
   if (1 == bytes) {
     struct charset *cs = new_charset();
-- 
GitLab