diff options
author | Preston Pan <ret2pop@gmail.com> | 2025-01-30 21:02:42 -0800 |
---|---|---|
committer | Preston Pan <ret2pop@gmail.com> | 2025-01-30 21:02:42 -0800 |
commit | 3780f207f924f14734cb839fd015bd883fe52ff1 (patch) | |
tree | de13568dbf97ffe477943854bcb3ea6001b46cf8 /src/common/stdobj.c | |
parent | ef9ab1fd141f4057d41f2d6ed8ab8d67c44894d5 (diff) |
Diffstat (limited to 'src/common/stdobj.c')
-rw-r--r-- | src/common/stdobj.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/stdobj.c b/src/common/stdobj.c new file mode 100644 index 0000000..c7657ed --- /dev/null +++ b/src/common/stdobj.c @@ -0,0 +1,12 @@ +#include "../include/stdobj.h" +#include "../include/better_string.h" +#include <stdbool.h> +#include <stdlib.h> + +bool array_in(array_t *a, string_t *s) { + for (int i = 0; i < a->size; i++) { + if (string_cmp(a->items[i], s)) + return true; + } + return false; +} |