feat: move source files into retoor_c directory and add build echo messages
- Add echo messages for both build targets to indicate which project is being compiled - Update isspam.c path to reflect new retoor_c/ subdirectory structure - Keep binary output location unchanged at project root
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
#ifndef RSTRING_LIST_H
|
||||
#define RSTRING_LIST_H
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
|
||||
typedef struct rstring_list_t {
|
||||
unsigned long long size;
|
||||
unsigned long long count;
|
||||
char **strings;
|
||||
} rstring_list_t;
|
||||
|
||||
rstring_list_t *rstring_list_new() {
|
||||
rstring_list_t *rsl = (rstring_list_t *)malloc(sizeof(rstring_list_t));
|
||||
memset(rsl, 0, sizeof(rstring_list_t));
|
||||
return rsl;
|
||||
}
|
||||
|
||||
void rstring_list_free(rstring_list_t *rsl) {
|
||||
for (unsigned long long i = 0; i < rsl->size; i++) {
|
||||
free(rsl->strings[i]);
|
||||
}
|
||||
if (rsl->strings)
|
||||
free(rsl->strings);
|
||||
free(rsl);
|
||||
}
|
||||
|
||||
void rstring_list_add(rstring_list_t *rsl, char *str) {
|
||||
if (rsl->count == rsl->size) {
|
||||
rsl->size++;
|
||||
rsl->strings = (char **)realloc(rsl->strings, sizeof(char *) * rsl->size);
|
||||
}
|
||||
rsl->strings[rsl->count] = strdup(str);
|
||||
rsl->count++;
|
||||
}
|
||||
bool rstring_list_contains(rstring_list_t *rsl, char *str) {
|
||||
for (unsigned long long i = 0; i < rsl->count; i++) {
|
||||
if (!strcmp(rsl->strings[i], str))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user