|
3 | 3 |
|
4 | 4 | #include "lua.h" |
5 | 5 |
|
| 6 | +#include <stdbool.h> |
6 | 7 | #include <stddef.h> |
7 | 8 |
|
8 | 9 | //////////////////////////////////////////////////////////////////////////////// |
|
46 | 47 | // |
47 | 48 | //////////////////////////////////////////////////////////////////////////////// |
48 | 49 |
|
49 | | -enum luarequire_NavigateResult |
| 50 | +typedef enum luarequire_NavigateResult |
50 | 51 | { |
51 | 52 | NAVIGATE_SUCCESS, |
52 | 53 | NAVIGATE_AMBIGUOUS, |
53 | 54 | NAVIGATE_NOT_FOUND |
54 | | -}; |
| 55 | +} luarequire_NavigateResult; |
55 | 56 |
|
56 | 57 | // Functions returning WRITE_SUCCESS are expected to set their size_out argument |
57 | 58 | // to the number of bytes written to the buffer. If WRITE_BUFFER_TOO_SMALL is |
58 | 59 | // returned, size_out should be set to the required buffer size. |
59 | | -enum luarequire_WriteResult |
| 60 | +typedef enum luarequire_WriteResult |
60 | 61 | { |
61 | 62 | WRITE_SUCCESS, |
62 | 63 | WRITE_BUFFER_TOO_SMALL, |
63 | 64 | WRITE_FAILURE |
64 | | -}; |
| 65 | +} luarequire_WriteResult; |
65 | 66 |
|
66 | | -struct luarequire_Configuration |
| 67 | +typedef struct luarequire_Configuration |
67 | 68 | { |
68 | 69 | // Returns whether requires are permitted from the given chunkname. |
69 | 70 | bool (*is_require_allowed)(lua_State* L, void* ctx, const char* requirer_chunkname); |
@@ -120,7 +121,7 @@ struct luarequire_Configuration |
120 | 121 | // thread to yield. In this case, this thread should be resumed with the |
121 | 122 | // module result pushed onto its stack. |
122 | 123 | int (*load)(lua_State* L, void* ctx, const char* path, const char* chunkname, const char* loadname); |
123 | | -}; |
| 124 | +} luarequire_Configuration; |
124 | 125 |
|
125 | 126 | // Populates function pointers in the given luarequire_Configuration. |
126 | 127 | typedef void (*luarequire_Configuration_init)(luarequire_Configuration* config); |
|
0 commit comments