]> git.saurik.com Git - cycript.git/blobdiff - Handler.mm
Cut off messages prefixes.
[cycript.git] / Handler.mm
index 79528c447723723f1eaeb383031d35c0c8a50974..01c3cbcbf8dd1a58f1f8f460a5d0c45f947a95c3 100644 (file)
@@ -38,6 +38,7 @@
 /* }}} */
 
 #include "cycript.hpp"
+#include "JavaScript.hpp"
 
 #include "Pooling.hpp"
 #include "Parser.hpp"
@@ -73,7 +74,7 @@ struct CYExecute_ {
     CYExecute_ *execute(reinterpret_cast<CYExecute_ *>([value pointerValue]));
     const char *data(execute->data_);
     execute->data_ = NULL;
-    execute->data_ = CYExecute(execute->pool_, data);
+    execute->data_ = CYExecute(execute->pool_, CYUTF8String(data));
 }
 
 @end
@@ -116,7 +117,7 @@ struct CYClient :
                 return;
             data[size] = '\0';
 
-            CYDriver driver("");
+            CYDriver driver;
             cy::parser parser(driver);
 
             driver.data_ = data;
@@ -129,10 +130,11 @@ struct CYClient :
             } else {
                 NSAutoreleasePool *ar = [[NSAutoreleasePool alloc] init];
 
-                CYContext context(driver.pool_);
+                CYOptions options;
+                CYContext context(driver.pool_, options);
                 driver.program_->Replace(context);
                 std::ostringstream str;
-                CYOutput out(str);
+                CYOutput out(str, options);
                 out << *driver.program_;
                 std::string code(str.str());
                 CYExecute_ execute = {pool, code.c_str()};
@@ -173,7 +175,7 @@ extern "C" void CYHandleClient(apr_pool_t *pool, int socket) {
 }
 
 extern "C" void CYHandleServer(pid_t pid) {
-    CYInitialize();
+    CYInitializeDynamic();
 
     int socket(_syscall(::socket(PF_UNIX, SOCK_STREAM, 0))); try {
         struct sockaddr_un address;