diff options
| author | 2023-11-26 21:34:11 +0000 | |
|---|---|---|
| committer | 2026-11-07 02:13:38 +0000 | |
| commit | 252df6c74c7be9b82aa89cdb4972f91c87b06184 (patch) | |
| tree | 988497c67eb3d8d8789aa9bdea47bafd300e25b2 /src/ops.h | |
| download | coursework-252df6c74c7be9b82aa89cdb4972f91c87b06184.tar.gz | |
Diffstat (limited to 'src/ops.h')
| -rw-r--r-- | src/ops.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ops.h b/src/ops.h new file mode 100644 index 0000000..e8eface --- /dev/null +++ b/src/ops.h | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | #ifndef OPS_H | ||
| 2 | #define OPS_H | ||
| 3 | |||
| 4 | #include <obstack.h> | ||
| 5 | |||
| 6 | enum op { | ||
| 7 | OP_NOP, | ||
| 8 | OP_DUP, | ||
| 9 | OP_DEL, | ||
| 10 | OP_CLR, | ||
| 11 | OP_SWP, | ||
| 12 | OP_NEG, | ||
| 13 | OP_ADD, | ||
| 14 | OP_MUL, | ||
| 15 | OP_SUB, | ||
| 16 | OP_DIV, | ||
| 17 | OP_MOD, | ||
| 18 | OP_INC, | ||
| 19 | OP_DEC, | ||
| 20 | OP_POW, | ||
| 21 | OP_GCD, | ||
| 22 | OP_LCM, | ||
| 23 | OP_COUNT, | ||
| 24 | }; | ||
| 25 | |||
| 26 | typedef void (*op_fn) (void); | ||
| 27 | |||
| 28 | extern op_fn op_fns[OP_COUNT]; | ||
| 29 | extern const char *op_names[OP_COUNT]; | ||
| 30 | |||
| 31 | enum op str2op (const char *str); | ||
| 32 | |||
| 33 | #endif | ||
