#include <sig/parse.hpp>
#include <sig/ffi_type.hpp>
-void Structor_(apr_pool_t *pool, const char *name, const char *types, sig::Type *&type);
+void Structor_(apr_pool_t *pool, sig::Type *&type);
struct Type_privateData :
CYData
}
};
-void Structor_(apr_pool_t *pool, const char *name, const char *types, sig::Type *&type) {
- if (name == NULL)
+void Structor_(apr_pool_t *pool, sig::Type *&type) {
+ if (
+ type->primitive == sig::pointer_P &&
+ type->data.data.type != NULL &&
+ type->data.data.type->primitive == sig::struct_P &&
+ strcmp(type->data.data.type->name, "_objc_class") == 0
+ ) {
+ type->primitive = sig::typename_P;
+ type->data.data.type = NULL;
+ return;
+ }
+
+ if (type->primitive != sig::struct_P || type->name == NULL)
return;
sqlite3_stmt *statement;
" limit 1"
, -1, &statement, NULL));
- _sqlcall(sqlite3_bind_text(statement, 1, name, -1, SQLITE_STATIC));
+ _sqlcall(sqlite3_bind_text(statement, 1, type->name, -1, SQLITE_STATIC));
int mode;
const char *value;
// XXX: this types thing is a throwback to JocStrap
- char *types;
- if (next != '=') {
- types = NULL;
- } else {
- const char *temp(*name);
+ if (next == '=')
Parse_(pool, &type->data.signature, name, end, callback);
- types = (char *) apr_pstrmemdup(pool, temp, *name - temp - 1);
- }
-
- if (callback != NULL)
- (*callback)(pool, type->name, types, type);
} break;
case 'N': type->flags |= JOC_TYPE_INOUT; goto next;
_assert(false);
}
+ if (callback != NULL)
+ (*callback)(pool, type);
+
return type;
}
namespace sig {
-typedef void (*Callback)(apr_pool_t *pool, const char *name, const char *types, Type *&type);
+typedef void (*Callback)(apr_pool_t *pool, Type *&type);
void Parse(apr_pool_t *pool, struct Signature *signature, const char *name, Callback callback);
const char *Unparse(apr_pool_t *pool, struct Signature *signature);