diff options
Diffstat (limited to 'src/transform.c')
-rw-r--r-- | src/transform.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/transform.c b/src/transform.c new file mode 100644 index 0000000..7c50a5e --- /dev/null +++ b/src/transform.c @@ -0,0 +1,23 @@ +#include <stdlib.h> +#include <string.h> + +#include <kalmia.h> +#include <ezxml.h> +#include "transform.h" + + +int kai_parse_matrix(ka_matrix_t *m, ezxml_t tag) +{ + if (strcmp("matrix", ezxml_name(tag)) != 0) + return -1; + + char *str = ezxml_txt(tag); + char *end; + int i; + for (i=0; i<16; i++) { + (*m)[i] = strtod(str, &end); + str = end; + } + + return 0; +} |