### File: mdcode.h
+ #include <stdio.h>
## exported types
## exported functions
#include <unistd.h>
#include <stdlib.h>
+ #include <stdio.h>
#include "mdcode.h"
The indents we insert will all be spaces. This might not work well
for `Makefiles`.
-##### client functions
+##### internal functions
- static void code_print(FILE *out, struct code_node *node,
- char *fname)
+ void code_node_print(FILE *out, struct code_node *node,
+ char *fname)
{
for (; node; node = node->next) {
char *c = node->code.txt;
}
}
+###### exported functions
+ void code_node_print(FILE *out, struct code_node *node, char *fname);
+
### Bringing it all together
We are just about ready for the `main` function of the tool which will
#include <errno.h>
#include <sys/mman.h>
#include <string.h>
- #include <stdio.h>
##### client functions
errs++;
continue;
}
- code_print(fl, s->code, argv[1]);
+ code_node_print(fl, s->code, argv[1]);
fclose(fl);
}
exit(!!errs);