2. Top Level Files
2.1. C file
<<weewiki.c>>=
#include <stdlib.h>
#include <stdio.h>
#include <sqlite3.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>
#define ORGPARSE_IMPLEMENTATION
#include "orgparse.h"
#include "weewiki.h"
#include "weewiki_private.h"
#include "jan.h"
<<global_data>>
<<static_funcdefs>>
<<argparse>>
<<functions>>
int main(int argc, char *argv[])
{
if (argc == 1) {
argparse_print(stdout);
return 1;
}
return argparse_match_and_run(argc, argv);
}
2.2. Header Files
<<weewiki.h>>=
#ifndef WEEWIKI_H
#define WEEWIKI_H
#ifndef JANET_H_defined
#include <stdint.h>
typedef struct JanetTable JanetTable;
typedef struct Janet Janet;
int janet_dostring(JanetTable *env,
const uint8_t *bytes,
const char *sourcePath,
Janet *out);
int janet_dobytes(JanetTable *env,
const uint8_t *bytes,
int32_t len,
const char *sourcePath,
Janet *out);
#endif
<<typedefs>>
<<funcdefs>>
#endif
<<weewiki_private.h>>=
#ifndef WEEWIKI_PRIVATE_H
#define WEEWIKI_PRIVATE_H
<<structs>>
#endif
prev | home | next