at least strings and vectors of ints work, not much else though... contributions welcome
This commit is contained in:
@@ -1,21 +1,32 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <odweta/vector.h>
|
||||
#include <odweta/string.h>
|
||||
|
||||
int main() {
|
||||
string_t *s = string_from("test string");
|
||||
string_t *s2 = string_from("another test");
|
||||
vector_t *v = vector_new(INT);
|
||||
|
||||
vector_t *v = vector_new(STRING);
|
||||
|
||||
vector_push(v, s);
|
||||
vector_push(v, s2);
|
||||
vector_push(v, &(int){33});
|
||||
vector_push(v, &(int){35});
|
||||
vector_push(v, &(int){34});
|
||||
|
||||
vector_print(v);
|
||||
|
||||
string_cleanup(s);
|
||||
string_cleanup(s2);
|
||||
|
||||
vector_cleanup(v);
|
||||
|
||||
string_t *s = string_new();
|
||||
|
||||
string_println(s);
|
||||
|
||||
string_push_chars(s, "this is a test");
|
||||
|
||||
string_println(s);
|
||||
|
||||
compare_e cmp = string_compare(s, string_from("this is a test"));
|
||||
|
||||
printf("cmp -> %s\n", (cmp == EQUAL) ? "equal" : "not equal");
|
||||
|
||||
string_cleanup(s);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user