summaryrefslogtreecommitdiff
path: root/Objective-C/objc_support.h
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2007-09-15 14:03:32 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2007-09-15 14:03:32 +0200
commitd0dd29fcf87b51280dd5c2685063ea42cf4fc115 (patch)
tree6492eb0477db2e07978554e4b865f9a812de252b /Objective-C/objc_support.h
parent63a0b732f2f8f7acc054ab4a9d2eb3fa121b1a95 (diff)
Make the code copied from PyObjC compilable stand-alone.
darcs-hash:6a1f1865b6259fc5a7551ffb10494f914359ecc6
Diffstat (limited to 'Objective-C/objc_support.h')
-rw-r--r--Objective-C/objc_support.h55
1 files changed, 4 insertions, 51 deletions
diff --git a/Objective-C/objc_support.h b/Objective-C/objc_support.h
index 6c4028e..a9b4b28 100644
--- a/Objective-C/objc_support.h
+++ b/Objective-C/objc_support.h
@@ -32,61 +32,14 @@
#endif
-/*#F Takes a C value pointed by @var{datum} with its type encoded in
- @var{type}, that should be coming from an ObjC @encode directive,
- and returns an equivalent Python object where C structures and
- arrays are represented as tuples. */
-extern PyObject *pythonify_c_value (const char *type,
- void *datum);
-extern PyObject *pythonify_c_return_value (const char *type,
- void *datum);
-
-/*#F Takes a Python object @var{arg} and translate it into a C value
- pointed by @var{datum} accordingly with the type specification
- encoded in @var{type}, that should be coming from an ObjC @encode
- directive.
- Returns NULL on success, or a static error string describing the
- error. */
-extern int depythonify_c_value (const char *type,
- PyObject *arg,
- void *datum);
-extern int depythonify_c_return_value (const char *type,
- PyObject *arg,
- void *datum);
-
-extern Py_ssize_t PyObjCRT_SizeOfReturnType(const char* type);
-extern Py_ssize_t PyObjCRT_SizeOfType(const char *type);
-extern Py_ssize_t PyObjCRT_AlignOfType(const char *type);
+extern ssize_t PyObjCRT_SizeOfReturnType(const char* type);
+extern ssize_t PyObjCRT_SizeOfType(const char *type);
+extern ssize_t PyObjCRT_AlignOfType(const char *type);
extern const char *PyObjCRT_SkipTypeSpec (const char *type);
extern const char* PyObjCRT_SkipTypeQualifiers (const char* type);
-/*
- * Compatibility with pyobjc-api.h
- */
-static inline id PyObjC_PythonToId(PyObject* value)
-{
- id res;
- int r;
-
- r = depythonify_c_value(@encode(id), value, &res);
- if (r == -1) {
- return NULL;
- } else {
- return res;
- }
-}
-
-static inline PyObject* PyObjC_IdToPython(id value)
-{
- PyObject* res;
-
- res = pythonify_c_value(@encode(id), &value);
- return res;
-}
-
-
extern int PyObjCRT_SetupClass(
- Class, Class, const char*, Class, Class, Py_ssize_t, struct objc_ivar_list*,
+ Class, Class, const char*, Class, Class, ssize_t, struct objc_ivar_list*,
struct objc_protocol_list*);
extern void PyObjCRT_ClearClass(Class cls);