A shell that runs x86_64 assembly
c
x86-64
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

history.h 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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_HISTORY_H
  14. #define ASMSH_HISTORY_H
  15. #include "config.h"
  16. #include <fcntl.h>
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <string.h>
  20. #include <unistd.h>
  21. #include <sys/types.h>
  22. #include <sys/stat.h>
  23. static const char ASMSH_HISTORY_FILE[] = "asmsh.history";
  24. typedef void(add_history_f)(const char*);
  25. /** Return the history filename and create the directory if needed
  26. * @note the returned string should be freed after use
  27. * @param const char * if NULL use $HOME
  28. */
  29. char * history_filename_init(const char *homedir);
  30. int save_history(const char *history_path, const char* const* hists);
  31. int load_history(const char *history_path, add_history_f *add_h);
  32. #endif