WIP editor

Can only read the password no safe for edit
This commit is contained in:
Nikola Petrov
2024-07-22 11:52:52 +02:00
parent 5b0dcb23ea
commit ae7c8571b4
9 changed files with 1156 additions and 1 deletions

View File

@@ -20,7 +20,8 @@ enum class Arg
Username, // update username
Name, // update label name
File, // select save file
Size // show size of file
Size, // show size of file
Editor // open editor, password as note
};
Arg get_args(int argc, char **argv, char **label);
@@ -47,4 +48,6 @@ void arg_file(Buffer &decrypted_buffer, Buffer &encrypted_buffer, const char *la
void arg_size(Buffer &encrypted_buffer);
void arg_editor(Buffer &decrypted_buffer, Buffer &encrypted_buffer, const char *label, std::string &key);
#endif

6
include/editor.hpp Normal file
View File

@@ -0,0 +1,6 @@
#ifndef EDITOR_HPP
#define EDITOR_HPP
int edit_file(const char *s);
#endif // EDITOR_HPP

View File

@@ -8,4 +8,9 @@ bool put_data_on_clipboard(const char *text);
std::string get_user_password();
std::optional<std::string> get_save_path();
int getWindowSize(int *rows, int *cols);
int enableRawMode(void);
int writeTerm(const char *buf, int length);
int readTerm(char *buf, int length);
#endif