USING: alien alien.accessors alien.c-syntax alien.c-types alien.libraries alien.strings alien.syntax generalizations io io.encodings.binary io.encodings.utf8 io.files.temp io.streams.byte-array kernel math parser sequences struct-arrays system unix.utilities words ; IN: smoke.ffi TYPEDEF: short Smoke::Index TYPEDEF: short Index TYPEDEF: void QString C-STRUCT: ModuleIndex { "Smoke*" "smoke" } { "Index" "index" } ; TYPEDEF: ModuleIndex Smoke::ModuleIndex C-STRUCT: Class { "char*" "className" } ! Name of the class { "bool" "external" } ! Whether the class is in another module { "Index" "parents" } ! Index into inheritanceList { "void*" "classFn" } ! Calls any method in the class { "void*" "enumFn" } ! Handles enum pointers { "ushort" "flags" } ; ! ClassFlags TYPEDEF: Class Smoke::Class C-STRUCT: Method { "Index" "classId" } ! Index into classes { "Index" "name" } ! Index into methodNames; real name { "Index" "args" } ! Index into argumentList { "uchar" "numArgs" } ! Number of arguments { "uchar" "flags" } ! MethodFlags (const/static/etc...) { "Index" "ret" } ! Index into types for the return type { "Index" "method" } ; ! Passed to Class.classFn, to call method TYPEDEF: Method Smoke::Method C-STRUCT: Type { "char*" "name" } ! Stringified type name { "Index" "classId" } ! Index into classes. -1 for none { "ushort" "flags" } ; ! TypeFlags TYPEDEF: Type Smoke::Type C-STRUCT: MethodMap { "Index" "classId" } ! Index into classes { "Index" "name" } ! Index into methodNames; munged name { "Index" "method" } ; ! Index into methods TYPEDEF: MethodMap Smoke::MethodMap C-LIBRARY: smoke-ffi COMPILE-AS-C++ C-LINK/FRAMEWORK: QtCore C-LINK: smokeqt C-INCLUDE: C-INCLUDE: C-INCLUDE: C-FUNCTION: void smoke_init_qt ( ) init_qt_Smoke(); ; C-FUNCTION: Smoke* smoke_qt ( ) return qt_Smoke; ; C-FUNCTION: void delete_smoke_qt ( ) delete qt_Smoke; ; C-FUNCTION: Smoke::Type* smoke_types ( Smoke* s ) return s->types; ; C-FUNCTION: Smoke::Class* smoke_classes ( Smoke* s ) return s->classes; ; C-FUNCTION: Smoke::Method* smoke_methods ( Smoke* s ) return s->methods; ; C-FUNCTION: Smoke::Index* smoke_inheritanceList ( Smoke* s ) return s->inheritanceList; ; C-FUNCTION: Smoke::Index* smoke_argumentList ( Smoke* s ) return s->argumentList; ; C-FUNCTION: Smoke::Index* smoke_ambiguousMethodList ( Smoke* s ) return s->ambiguousMethodList; ; C-FUNCTION: Smoke::MethodMap* smoke_methodMaps ( Smoke* s ) return s->methodMaps; ; C-FUNCTION: const-char** smoke_methodNames ( Smoke* s ) return s->methodNames; ; C-FUNCTION: Smoke::Index smoke_numTypes ( Smoke* s ) return s->numTypes; ; C-FUNCTION: Smoke::Index smoke_numClasses ( Smoke* s ) return s->numClasses; ; C-FUNCTION: Smoke::Index smoke_numMethods ( Smoke* s ) return s->numMethods; ; C-FUNCTION: Smoke::Index smoke_numMethodMaps ( Smoke* s ) return s->numMethodMaps; ; C-FUNCTION: Smoke::Index smoke_numMethodNames ( Smoke* s ) return s->numMethodNames; ; C-FUNCTION: Smoke::ModuleIndex smoke_findClass ( char* c, Smoke* s ) return s->findClass(c); ; C-FUNCTION: Smoke::ModuleIndex smoke_findMethod ( char* c, char* name, Smoke* s ) return s->findMethod(c, name); ; C-FUNCTION: void smoke_callMethod ( Smoke::Class c, Smoke::Index m, void* obj, Smoke::StackItem* args ) (*c.classFn)(m, obj, args); ; C-FUNCTION: QString* QString_new ( ) return new QString(); ; C-FUNCTION: void QString_delete ( QString* o ) delete o; ; C-FUNCTION: int QString_length ( QString* o ) return o->length(); ; C-FUNCTION: void QString_set_length ( int n, QString* o ) o->resize(n); ; C-FUNCTION: void QString_reserve ( int n, QString* o ) o->reserve(n); ; C-FUNCTION: int QString_capacity ( QString* o ) return o->capacity(); ; C-FUNCTION: ushort QString_nth_unsafe ( int n, QString* s ) return s->at(n).unicode(); ; C-FUNCTION: void QString_set_nth_unsafe ( int c, int n, QString* s ) s->replace(n, 1, QChar(c)); ; C-FUNCTION: QString* QString_from_utf8 ( char* str, int n ) return new QString(QString::fromUtf8(str, n)); ; C-FUNCTION: const-char* QString_to_utf8 ( QString* s ) return s->toUtf8().constData(); ; ;C-LIBRARY ! enum TypeFlags CONSTANT: tf_elem HEX: F CONSTANT: tf_stack HEX: 10 CONSTANT: tf_ptr HEX: 20 CONSTANT: tf_ref HEX: 30 CONSTANT: tf_const HEX: 40 ! enum ClassFlags CONSTANT: cf_constructor HEX: 1 CONSTANT: cf_deepcopy HEX: 2 CONSTANT: cf_virtual HEX: 4 CONSTANT: cf_undefined HEX: 10 ! enum MethodFlags CONSTANT: mf_static HEX: 1 CONSTANT: mf_const HEX: 2 CONSTANT: mf_copyctor HEX: 4 CONSTANT: mf_internal HEX: 8 CONSTANT: mf_enum HEX: 10 CONSTANT: mf_ctor HEX: 20 CONSTANT: mf_dtor HEX: 40 CONSTANT: mf_protected HEX: 80