diff options
author | Preston Pan <preston@nullring.xyz> | 2023-01-06 20:48:56 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2023-01-06 20:48:56 -0800 |
commit | c620d528fb9d9efbac559002d23857623e71df05 (patch) | |
tree | d8d6ee788cc4688a3c4a4401906fe3ce25307855 /src/nxspp.c | |
parent | 0771dd0e1a143c17920d65d5de8d010aa433ce1c (diff) |
whoops, fixed concat. Include in the making
Diffstat (limited to 'src/nxspp.c')
-rw-r--r-- | src/nxspp.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nxspp.c b/src/nxspp.c new file mode 100644 index 0000000..7888cbb --- /dev/null +++ b/src/nxspp.c @@ -0,0 +1,24 @@ +#include "./include/nxspp.h" +#include "./include/macros.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +npp_t *init_npp(char *source) { + npp_t *n = malloc(sizeof(npp_t)); + if (n == NULL) + die("malloc on nxspp"); + n->source = source; + n->i = 0; + n->c = source[n->i]; + return n; +} + +char *nxspp_collect_id(char *source, int i) {} + +void npp_move(npp_t *p) { + if (p->c != '\0') { + p->i++; + p->c = p->source[p->i]; + } +} |