unfinished but, soon adding books

This commit is contained in:
SuperNovaa41 2024-01-22 15:36:53 -05:00
parent 928d9b9e01
commit 4a0da14f89
2 changed files with 21 additions and 2 deletions

View File

@ -1,7 +1,10 @@
#include <cinttypes>
#include <string> #include <string>
#include <vector> #include <vector>
#include <fstream> #include <fstream>
#include <unistd.h>
#include "isbn-interaction.h" #include "isbn-interaction.h"
#include "csv.h" #include "csv.h"
@ -47,3 +50,20 @@ std::string get_all_books()
return total_lines + "}"; return total_lines + "}";
} }
void add_new_book(std::string isbn)
{
pid_t pid;
std::string program_name = "./isbn";
std::string write = "w";
const char* args[] = {program_name.c_str(), isbn.c_str(), write.c_str()};
pid = fork();
if (0 == pid) { //
// this is the child
}
//TODO execvp the args blah blah
}

View File

@ -17,7 +17,6 @@ std::string book_vec_to_json(std::vector<std::string> headers, std::vector<std::
*/ */
std::string get_all_books(); std::string get_all_books();
void add_new_book(std::string isbn);
#endif #endif