]> git.saurik.com Git - cycript.git/blobdiff - sig/types.hpp
Use class extension syntax as part of Object CYON.
[cycript.git] / sig / types.hpp
index f0530466c8a01d5c4e364cc36bdfb286a282daf7..ea0a307ade3d2b32b6dc63d624b86e6e50118be3 100644 (file)
@@ -1,5 +1,5 @@
-/* Cycript - Optimizing JavaScript Compiler/Runtime
- * Copyright (C) 2009-2015  Jay Freeman (saurik)
+/* Cycript - The Truly Universal Scripting Language
+ * Copyright (C) 2009-2016  Jay Freeman (saurik)
 */
 
 /* GNU Affero General Public License, Version 3 {{{ */
@@ -57,7 +57,7 @@ struct Type {
     {
     }
 
-    virtual Type *Copy(CYPool &pool, const char *name = NULL) const = 0;
+    virtual Type *Copy(CYPool &pool, const char *rename = NULL) const = 0;
     virtual const char *GetName() const;
 
     virtual const char *Encode(CYPool &pool) const = 0;
@@ -98,7 +98,7 @@ struct Signature {
 struct Void :
     Type
 {
-    Void *Copy(CYPool &pool, const char *name = NULL) const override;
+    Void *Copy(CYPool &pool, const char *rename = NULL) const override;
 
     const char *Encode(CYPool &pool) const override;
     CYTypedIdentifier *Decode(CYPool &pool) const override;
@@ -111,7 +111,7 @@ struct Void :
 struct Unknown :
     Type
 {
-    Unknown *Copy(CYPool &pool, const char *name = NULL) const override;
+    Unknown *Copy(CYPool &pool, const char *rename = NULL) const override;
 
     const char *Encode(CYPool &pool) const override;
     CYTypedIdentifier *Decode(CYPool &pool) const override;
@@ -124,7 +124,7 @@ struct Unknown :
 struct String :
     Type
 {
-    String *Copy(CYPool &pool, const char *name = NULL) const override;
+    String *Copy(CYPool &pool, const char *rename = NULL) const override;
 
     const char *Encode(CYPool &pool) const override;
     CYTypedIdentifier *Decode(CYPool &pool) const override;
@@ -134,10 +134,11 @@ struct String :
     JSValueRef FromFFI(JSContextRef context, ffi_type *ffi, void *data, bool initialize, JSObjectRef owner) const override;
 };
 
+#ifdef CY_OBJECTIVEC
 struct Meta :
     Type
 {
-    Meta *Copy(CYPool &pool, const char *name = NULL) const override;
+    Meta *Copy(CYPool &pool, const char *rename = NULL) const override;
 
     const char *Encode(CYPool &pool) const override;
     CYTypedIdentifier *Decode(CYPool &pool) const override;
@@ -150,7 +151,7 @@ struct Meta :
 struct Selector :
     Type
 {
-    Selector *Copy(CYPool &pool, const char *name = NULL) const override;
+    Selector *Copy(CYPool &pool, const char *rename = NULL) const override;
 
     const char *Encode(CYPool &pool) const override;
     CYTypedIdentifier *Decode(CYPool &pool) const override;
@@ -159,6 +160,7 @@ struct Selector :
     void PoolFFI(CYPool *pool, JSContextRef context, ffi_type *ffi, void *data, JSValueRef value) const override;
     JSValueRef FromFFI(JSContextRef context, ffi_type *ffi, void *data, bool initialize, JSObjectRef owner) const override;
 };
+#endif
 
 struct Bits :
     Type
@@ -170,7 +172,7 @@ struct Bits :
     {
     }
 
-    Bits *Copy(CYPool &pool, const char *name = NULL) const override;
+    Bits *Copy(CYPool &pool, const char *rename = NULL) const override;
 
     const char *Encode(CYPool &pool) const override;
     CYTypedIdentifier *Decode(CYPool &pool) const override;
@@ -190,7 +192,7 @@ struct Pointer :
     {
     }
 
-    Pointer *Copy(CYPool &pool, const char *name = NULL) const override;
+    Pointer *Copy(CYPool &pool, const char *rename = NULL) const override;
 
     const char *Encode(CYPool &pool) const override;
     CYTypedIdentifier *Decode(CYPool &pool) const override;
@@ -212,7 +214,7 @@ struct Array :
     {
     }
 
-    Array *Copy(CYPool &pool, const char *name = NULL) const override;
+    Array *Copy(CYPool &pool, const char *rename = NULL) const override;
 
     const char *Encode(CYPool &pool) const override;
     CYTypedIdentifier *Decode(CYPool &pool) const override;
@@ -222,6 +224,7 @@ struct Array :
     JSValueRef FromFFI(JSContextRef context, ffi_type *ffi, void *data, bool initialize, JSObjectRef owner) const override;
 };
 
+#ifdef CY_OBJECTIVEC
 struct Object :
     Type
 {
@@ -232,8 +235,7 @@ struct Object :
     {
     }
 
-    Object *Copy(CYPool &pool, const char *name = NULL) const override;
-    const char *GetName() const override;
+    Object *Copy(CYPool &pool, const char *rename = NULL) const override;
 
     const char *Encode(CYPool &pool) const override;
     CYTypedIdentifier *Decode(CYPool &pool) const override;
@@ -242,6 +244,7 @@ struct Object :
     void PoolFFI(CYPool *pool, JSContextRef context, ffi_type *ffi, void *data, JSValueRef value) const override;
     JSValueRef FromFFI(JSContextRef context, ffi_type *ffi, void *data, bool initialize, JSObjectRef owner) const override;
 };
+#endif
 
 struct Aggregate :
     Type
@@ -256,7 +259,7 @@ struct Aggregate :
     {
     }
 
-    Aggregate *Copy(CYPool &pool, const char *name = NULL) const override;
+    Aggregate *Copy(CYPool &pool, const char *rename = NULL) const override;
     const char *GetName() const override;
 
     const char *Encode(CYPool &pool) const override;
@@ -286,7 +289,7 @@ struct Function :
     {
     }
 
-    Function *Copy(CYPool &pool, const char *name = NULL) const override;
+    Function *Copy(CYPool &pool, const char *rename = NULL) const override;
 
     const char *Encode(CYPool &pool) const override;
     CYTypedIdentifier *Modify(CYPool &pool, CYTypedIdentifier *result, CYTypedParameter *parameters) const override;
@@ -296,10 +299,11 @@ struct Function :
     JSValueRef FromFFI(JSContextRef context, ffi_type *ffi, void *data, bool initialize, JSObjectRef owner) const override;
 };
 
+#ifdef CY_OBJECTIVEC
 struct Block :
     Callable
 {
-    Block *Copy(CYPool &pool, const char *name = NULL) const override;
+    Block *Copy(CYPool &pool, const char *rename = NULL) const override;
 
     const char *Encode(CYPool &pool) const override;
     CYTypedIdentifier *Decode(CYPool &pool) const override;
@@ -309,6 +313,7 @@ struct Block :
     void PoolFFI(CYPool *pool, JSContextRef context, ffi_type *ffi, void *data, JSValueRef value) const override;
     JSValueRef FromFFI(JSContextRef context, ffi_type *ffi, void *data, bool initialize, JSObjectRef owner) const override;
 };
+#endif
 
 Type *joc_parse_type(char **name, char eos, bool variable, bool signature);
 void joc_parse_signature(Signature *signature, char **name, char eos, bool variable);