From 2aa77fd825c02cabbe13f9ccdc486012f65e4707 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 22 Oct 2009 07:51:08 +0000 Subject: [PATCH] Maybe fully separated the backend library from Console. --- Console.cpp | 37 ++++++++++++++++++++++++++++++++----- Darwin.mk | 3 ++- Library.mm | 18 ------------------ makefile | 2 +- 4 files changed, 35 insertions(+), 25 deletions(-) diff --git a/Console.cpp b/Console.cpp index 0c5a13b..dfc5c8c 100644 --- a/Console.cpp +++ b/Console.cpp @@ -118,7 +118,11 @@ void Run(int socket, const char *data, size_t size, FILE *fout = NULL, bool expa const char *json; if (socket == -1) { mode_ = Running; +#ifdef CY_EXECUTE json = CYExecute(pool, data); +#else + json = NULL; +#endif mode_ = Working; if (json != NULL) size = strlen(json); @@ -332,14 +336,27 @@ static void *Map(const char *path, size_t *psize) { int main(int argc, char *argv[]) { bool tty(isatty(STDIN_FILENO)); - pid_t pid(_not(pid_t)); bool compile(false); - for (;;) switch (getopt(argc, argv, "cg:n:p:s")) { +#ifdef CY_ATTACH + pid_t pid(_not(pid_t)); +#endif + + for (;;) switch (getopt(argc, argv, + "cg:n:" +#ifdef CY_ATTACH + "p:" +#endif + "s" + )) { case -1: goto getopt; case '?': - fprintf(stderr, "usage: cycript [-c] [-p ] [