From: Jay Freeman (saurik) Date: Thu, 22 Oct 2009 07:51:08 +0000 (+0000) Subject: Maybe fully separated the backend library from Console. X-Git-Tag: v0.9.432~287 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/2aa77fd825c02cabbe13f9ccdc486012f65e4707 Maybe fully separated the backend library from Console. --- 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 ] [