X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/30d468161e503794ea35000572bdf734504390b6..824bc1ec28c62ea1d63622c46e1edfd911c38b64:/Handler.cpp diff --git a/Handler.cpp b/Handler.cpp index 30ea4f4..a49fcb6 100644 --- a/Handler.cpp +++ b/Handler.cpp @@ -19,6 +19,8 @@ **/ /* }}} */ +#include "cycript.hpp" + #include #include #include @@ -34,15 +36,11 @@ #include #endif -#include "cycript.hpp" - +#include "Driver.hpp" #include "JavaScript.hpp" -#include "Parser.hpp" +#include "Syntax.hpp" #include "Pooling.hpp" -#include "Cycript.tab.hh" -#include "Driver.hpp" - struct CYExecute_ { CYPool &pool_; const char * volatile data_; @@ -153,7 +151,7 @@ static void *OnClient(void *data) { return NULL; } -extern "C" void CYHandleClient(int socket) { +void CYHandleClient(int socket) { // XXX: this leaks memory... really? CYPool *pool(new CYPool()); CYClient *client(new(*pool) CYClient(socket)); @@ -174,7 +172,7 @@ static void CYHandleSocket(const char *path) { CYHandleClient(socket); } -extern "C" void CYHandleServer(pid_t pid) { try { +_extern void CYHandleServer(pid_t pid) { try { char path[1024]; sprintf(path, "/tmp/.s.cy.%u", pid); CYHandleSocket(path); @@ -183,7 +181,7 @@ extern "C" void CYHandleServer(pid_t pid) { try { fprintf(stderr, "%s\n", error.PoolCString(pool)); } } -extern "C" char *MSmain0(int argc, char *argv[]) { try { +_extern char *MSmain0(int argc, char *argv[]) { try { _assert(argc == 2); CYHandleSocket(argv[1]); @@ -248,7 +246,7 @@ static void *OnServer(void *data) { return NULL; } -extern "C" void CYListenServer(short port) { +_extern void CYListenServer(short port) { CYInitializeDynamic(); CYServer *server(new CYServer(port));