A shell that runs x86_64 assembly
c
x86-64
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

shell.h 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Copyright Yann Weber <asmsh@yannweb.net>
  2. This file is part of asmsh.
  3. asmsh is free software: you can redistribute it and/or modify it under the
  4. terms of the GNU General Public License as published by the Free Software
  5. Foundation, either version 3 of the License, or any later version.
  6. asmsh is distributed in the hope that it will be useful, but WITHOUT ANY
  7. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  9. details.
  10. You should have received a copy of the GNU General Public License along
  11. with asmsh. If not, see <https://www.gnu.org/licenses/>.
  12. */
  13. #ifndef ASMSH_SHELL_H
  14. #define ASMSH_SHELL_H
  15. #include "config.h"
  16. #include <stdlib.h>
  17. #include <unistd.h>
  18. #include "asm_env.h"
  19. #include "logger.h"
  20. #include "compile.h"
  21. typedef struct asmsh_s asmsh_t;
  22. #include "shell_sym.h"
  23. struct asmsh_s
  24. {
  25. asmsh_asmc_ctx_t *cctx;
  26. asmsh_env_t *env;
  27. char *child_path;
  28. char *last_instr;
  29. asmsh_bytecode_t last_bcode;
  30. };
  31. int asmsh_init(asmsh_t *sh, const char *child_path);
  32. void asmsh_cleanup(asmsh_t *sh);
  33. /** @return <0 on error 0 on ok 1 on exit */
  34. int asmsh_exec(asmsh_t *sh, const char *cmd);
  35. #include "shell_cmds.h" // declares the static commands list
  36. #endif