Redid the trampoline generator in what will hopefully be a more portable fashion.
[cycript.git] / Library.cpp
index 4cccc06a6e401d54ebfdddb172c71aa33ac8843a..a981b2bcb8281322f68e62c41d591641a13cb9d3 100644 (file)
 #include <sstream>
 #include <cmath>
 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/un.h>
-
 #include "Parser.hpp"
 #include "Cycript.tab.hh"
 
@@ -1454,27 +1449,6 @@ CYJSError::CYJSError(JSContextRef context, const char *format, ...) {
     CYThrow(context, exception);
 }
 
-extern "C" void CYHandleServer(pid_t pid) {
-    CYInitialize();
-
-    int socket(_syscall(::socket(PF_UNIX, SOCK_STREAM, 0))); try {
-        struct sockaddr_un address;
-        memset(&address, 0, sizeof(address));
-        address.sun_family = AF_UNIX;
-        sprintf(address.sun_path, "/tmp/.s.cy.%u", pid);
-
-        _syscall(connect(socket, reinterpret_cast<sockaddr *>(&address), SUN_LEN(&address)));
-
-        apr_pool_t *pool;
-        apr_pool_create(&pool, NULL);
-
-        CYHandleClient(pool, socket);
-    } catch (const CYException &error) {
-        CYPool pool;
-        fprintf(stderr, "%s\n", error.PoolCString(pool));
-    }
-}
-
 JSGlobalContextRef CYGetJSContext() {
     CYInitialize();