A minimalistic programming language written in C89.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

24 行
479 B

6 个月前
6 个月前
  1. #include "ink.h"
  2. #include <stdio.h>
  3. int main(int argc, char** argv) {
  4. char read_buffer[2048];
  5. struct context* ctx = ink_make_default_context();
  6. char** end_argv = argv + argc;
  7. for(argv+=1; argv != end_argv; argv++) {
  8. FILE* file = fopen(*argv, "r");
  9. size_t cnt = fread(read_buffer, 1, 2047, file);
  10. if(cnt == 0) {
  11. }
  12. read_buffer[cnt] = 0;
  13. ink_run(ctx, read_buffer);
  14. if(ctx->panic) {
  15. perror("Panicked !!");
  16. }
  17. fclose(file);
  18. }
  19. return ctx->panic;
  20. }