#include <stdio.h>
#include <malloc.h>
#include <ctype.h>
#include <string.h>
bool file_exists(const char* file)
{
FILE* f = fopen(file, "r");
if (!f) {
return false;
}
fclose(f);
return true;
}
int main()
{
char schedule_file[] = "single_node_boolean.sql single_node_char.sql single_node_name.sql single_node_varchar.sql";
char** tests = NULL;
tests = (char**)malloc(sizeof(char**));
char* pcTemp = NULL;
bool InsideWord = false;
int num_tests = 0;
for (pcTemp = schedule_file; *pcTemp != '\0'; pcTemp++) {
if (*pcTemp == ' ') {
*pcTemp = '\0';
InsideWord = false;
} else if (!InsideWord) {
tests[num_tests] = pcTemp;
num_tests++;
InsideWord = true;
}
}
int int_temp = 0;
while (int_temp < num_tests) {
file_exists(tests[int_temp]);
int_temp++;
}
}