Starting to move stuff in to a lib
[mnenc] / mnencd.hpp
index 4eb4bb2..ba7e6a8 100644 (file)
@@ -71,8 +71,22 @@ void put_password(std::string masterpasswd, std::string passwd, std::string user
        password pw = password(menc.encrypt(key, passwd ), "", key);
        pw.to_file(make_filename(user, app));
 }
+std::string do_something(std::string str) { //Handle requests for secure pipe
+    pid_t proc = fork();
+    std::string reply = "";
+    if( proc == 0 ) { // child
+        reply = open_connection( str );
+    } else if( p > 0 ) { // parent
+       // Store p somewhere
+    } else { // fork failed
+    }
+    
+    return reply;
+}
+std::string open_connection(std::string str) {
 
-std::string do_something(std::string str) { //Handle requests
+}
+std::string do_something_else(std::string str) { //Handle requests
 
        std::vector<std::string> request; //Incomming message stored here
        request = explode(str, "|"); //explode request with function from php.hpp