summaryrefslogtreecommitdiff
path: root/src/puzzles/puzzle.h
blob: d530a891263f2d03bbe4f956d74001ae7f56be7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <stddef.h>
#include <wren.h>

#ifndef PUZZLE_H

// This is a param that would be placed in a slot
// https://wren.io/embedding/slots-and-handles.html#writing-slots
typedef struct {
    WrenType type;
    // We store this value as void * to generalize. The downside of this approach
    // is an extenciva allocation
    void *value;
} PuzzleIO;

typedef struct {
    // https://wren.io/embedding/calling-wren-from-c.html#getting-a-method-handle
    char *MainMethodSignature;

    size_t argc;
    PuzzleIO *argv;
} Test;

typedef struct {
    char *Name;
    char *Description;

    /// The tests that are accessible for an end user
    size_t TestC;
    Test *Tests;
} Puzzle;

// TODO
void ReadPuzzleFromFile(const char *path);

void FreePuzzle(Puzzle *self);
/// A prebuilt puzzle. Used for debuging
Puzzle *GetTestPuzzle();

#define PUZZLE_H
#endif // PUZZLE_H