-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add some basic history function prototype in history header file
- Loading branch information
Showing
4 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ lash | |
dist/ | ||
tags | ||
.vscode/ | ||
.VSCodeCounter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "history.h" | ||
|
||
#include <string.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#include "lib/string/strlib.h" | ||
#include "glob.h" | ||
|
||
FILE *history_file; | ||
char *history_file_path; | ||
uint64 history_poiner; | ||
|
||
/* | ||
* Open history file from the user home path , and create if dosnt exitst | ||
*/ | ||
void init_lash_history() { | ||
history_file_path = concat(2,user_home_path,HISTORY_FILE_NAME); | ||
history_file = fopen(strcat(user_home_path,HISTORY_FILE_NAME),"w+"); | ||
} | ||
|
||
/* | ||
* Add a line to history file , if post == -1 will and to bottome of file | ||
*/ | ||
void add_to_history(const char *line,int pos) { | ||
} | ||
|
||
/* | ||
* Get a special line of history file | ||
*/ | ||
void get_history(int line) { | ||
} | ||
|
||
/* | ||
* Close history file | ||
*/ | ||
void close_history() { | ||
fclose(history_file); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <stdio.h> | ||
#include "basics.h" | ||
|
||
#define HISTORY_FILE_NAME ".lashhistory" | ||
|
||
extern FILE *history_file; | ||
extern char *history_file_path; | ||
extern uint64 history_pointer; | ||
|
||
void clear_history(); | ||
void where_history(); | ||
char *current_history(); | ||
void history_set_pos(); | ||
void init_lash_history(); | ||
void add_to_history(const char *,int); | ||
void get_histroy(int); | ||
void remove_history(int); | ||
void close_history(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters