1234567891011121314151617181920212223242526272829303132333435363738394041 |
- /* Copyright Yann Weber <asmsh@yannweb.net>
- This file is part of asmsh.
-
- asmsh is free software: you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation, either version 3 of the License, or any later version.
-
- asmsh is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- details.
-
- You should have received a copy of the GNU General Public License along
- with asmsh. If not, see <https://www.gnu.org/licenses/>.
- */
- #ifndef ASMSH_HISTORY_H
- #define ASMSH_HISTORY_H
- #include "config.h"
-
- #include <fcntl.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
- #include <sys/types.h>
- #include <sys/stat.h>
-
- static const char ASMSH_HISTORY_FILE[] = "asmsh.history";
-
- typedef void(add_history_f)(const char*);
-
- /** Return the history filename and create the directory if needed
- * @note the returned string should be freed after use
- * @param const char * if NULL use $HOME
- */
- char * history_filename_init(const char *homedir);
-
- int save_history(const char *history_path, const char* const* hists);
- int load_history(const char *history_path, add_history_f *add_h);
-
- #endif
|