|
|
@ -8,6 +8,10 @@ |
|
|
#define INK_SH_READ_BUFF 32768 |
|
|
#define INK_SH_READ_BUFF 32768 |
|
|
#endif // INK_SH_READ_BUFF |
|
|
#endif // INK_SH_READ_BUFF |
|
|
|
|
|
|
|
|
|
|
|
#ifndef GIT_COMMIT_HASH |
|
|
|
|
|
#define GIT_COMMIT_HASH "?" |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
int get_type_by_name(struct context* ctx, const char* name); |
|
|
int get_type_by_name(struct context* ctx, const char* name); |
|
|
|
|
|
|
|
|
static void print_string(struct context* ctx, const struct elem string) { |
|
|
static void print_string(struct context* ctx, const struct elem string) { |
|
|
@ -127,6 +131,16 @@ static void call_word(struct context* ctx) { |
|
|
ink_push_fn(ctx, frame); |
|
|
ink_push_fn(ctx, frame); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void print_releasever(struct context* ctx) { |
|
|
|
|
|
const char * commit = GIT_COMMIT_HASH; |
|
|
|
|
|
|
|
|
|
|
|
while (*commit) { |
|
|
|
|
|
ctx->putchar(ctx, *commit++); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ctx->putchar(ctx, '\n'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
int main(int argc, char** argv) { |
|
|
int main(int argc, char** argv) { |
|
|
char read_buffer[INK_SH_READ_BUFF]; |
|
|
char read_buffer[INK_SH_READ_BUFF]; |
|
|
struct context* ctx; |
|
|
struct context* ctx; |
|
|
@ -135,6 +149,7 @@ int main(int argc, char** argv) { |
|
|
ink_add_native(ctx, "words?", list_words); |
|
|
ink_add_native(ctx, "words?", list_words); |
|
|
ink_add_native(ctx, "words!", resolve_word); |
|
|
ink_add_native(ctx, "words!", resolve_word); |
|
|
ink_add_native(ctx, "words.call", call_word); |
|
|
ink_add_native(ctx, "words.call", call_word); |
|
|
|
|
|
ink_add_native(ctx, "version", print_releasever); |
|
|
end_argv = argv + argc; |
|
|
end_argv = argv + argc; |
|
|
size_t cnt; |
|
|
size_t cnt; |
|
|
int no_exit = 1; |
|
|
int no_exit = 1; |
|
|
|