First stage of splitting up a source line complete. Next is tokenizing the list of string being generated.

This commit is contained in:
2021-12-30 15:21:09 -06:00
parent 4be3a4a7ea
commit 08acc6af22
5 changed files with 46 additions and 60 deletions
+4 -3
View File
@@ -1,7 +1,4 @@
#include "../includes/list.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
List* CreateList() {
List *new = malloc(sizeof(List));
@@ -13,6 +10,7 @@ List* CreateList() {
}
int AddListItem(char *value, List* list) {
if (list == NULL) return -1;
if (list->capacity < list->size + 1) {
list->root = realloc(list->root, sizeof(char*) * list->capacity * 2);
@@ -31,6 +29,8 @@ int AddListItem(char *value, List* list) {
}
void PrintList(List* list) {
if (list == NULL) return;
List *current = list;
printf("Size: %d; Capacity: %d\n", list->size, list->capacity);
@@ -41,6 +41,7 @@ void PrintList(List* list) {
}
void DestroyList(List* list) {
if (list == NULL) return;
for(int i = 0; i < list->size; i++) {
free(list->root[i]);