Paste: c-struct offset illustration
Author: | jedahu |
Mode: | c++ |
Date: | Thu, 30 Apr 2009 22:40:47 |
Plain Text |
#ifndef SMOKE_WRAPPER_H
#define SMOKE_WRAPPER_H
#include <smoke.h>
#include <smoke/qt_smoke.h>
extern "C" {
void init_qt_smoke();
Smoke* qt_smoke();
void delete_qt_smoke();
Smoke::Type* smoke_types(Smoke* s);
Smoke::Class* smoke_classes(Smoke* s);
Smoke::Method* smoke_methods(Smoke* s);
Smoke::Index* smoke_inheritanceList(Smoke* s);
Smoke::Index* smoke_argumentList(Smoke* s);
Smoke::Index* smoke_ambiguousMethodList(Smoke* s);
Smoke::MethodMap* smoke_methodMaps(Smoke* s);
const char** smoke_methodNames(Smoke* s);
Smoke::Index smoke_numTypes(Smoke* s);
Smoke::Index smoke_numClasses(Smoke* s);
Smoke::Index smoke_numMethods(Smoke* s);
Smoke::Index smoke_numMethodMaps(Smoke* s);
Smoke::Index smoke_numMethodNames(Smoke* s);
Smoke::ModuleIndex smoke_findClass(Smoke* s, const char* c);
Smoke::ModuleIndex smoke_findMethod(Smoke* s, const char* c, const char* name);
}
#endif
Author: | jedahu |
Mode: | c++ |
Date: | Thu, 30 Apr 2009 22:41:37 |
Plain Text |
#include "c_wrapper.h"
extern "C" {
void init_qt_smoke() {
init_qt_Smoke();
}
Smoke* qt_smoke() {
return qt_Smoke;
}
void delete_qt_smoke() {
delete qt_Smoke;
}
Smoke::Type* smoke_types(Smoke* s) {
return s->types;
}
Smoke::Class* smoke_classes(Smoke* s) {
return s->classes;
}
Smoke::Method* smoke_methods(Smoke* s) {
return s->methods;
}
Smoke::Index* smoke_inheritanceList(Smoke* s) {
return s->inheritanceList;
}
Smoke::Index* smoke_argumentList(Smoke* s) {
return s->argumentList;
}
Smoke::Index* smoke_ambiguousMethodList(Smoke* s) {
return s->ambiguousMethodList;
}
Smoke::MethodMap* smoke_methodMaps(Smoke* s) {
return s->methodMaps;
}
const char** smoke_methodNames(Smoke* s) {
return s->methodNames;
}
Smoke::Index smoke_numTypes(Smoke* s) {
return s->numTypes;
}
Smoke::Index smoke_numClasses(Smoke* s) {
return s->numClasses;
}
Smoke::Index smoke_numMethods(Smoke* s) {
return s->numMethods;
}
Smoke::Index smoke_numMethodMaps(Smoke* s) {
return s->numMethodMaps;
}
Smoke::Index smoke_numMethodNames(Smoke* s) {
return s->numMethodNames;
}
Smoke::ModuleIndex smoke_findClass(Smoke* s, const char* c) {
return s->findClass(c);
}
Smoke::ModuleIndex smoke_findMethod(Smoke* s, const char* c, const char* name) {
return s->findMethod(c, name);
}
}
Author: | jedahu |
Mode: | factor |
Date: | Thu, 30 Apr 2009 22:43:27 |
Plain Text |
Author: | jedahu |
Mode: | factor |
Date: | Thu, 30 Apr 2009 22:44:20 |
Plain Text |
USING: alien alien.destructors alien.syntax alien.libraries generalizations
kernel sequences ;
IN: smoke.ffi
<< "lsmoke" "libsmokewrapper.so" "cdecl" add-library >>
LIBRARY: lsmoke
TYPEDEF: void Smoke
TYPEDEF: void StackItem
TYPEDEF: short Index
C-STRUCT: ModuleIndex
{ "Smoke*" "smoke" }
{ "Index" "index" } ;
C-STRUCT: Class
{ "char*" "className" }
{ "bool" "external" }
{ "Index" "parents" }
{ "void*" "classFn" }
{ "void*" "enumFn" }
{ "ushort" "flags" } ;
C-STRUCT: Method
{ "Index" "classId" }
{ "Index" "name" }
{ "Index" "args" }
{ "uchar" "numArgs" }
{ "uchar" "flags" }
{ "Index" "ret" }
{ "Index" "method" } ;
C-STRUCT: Type
{ "char*" "name" }
{ "Index" "classId" }
{ "ushort" "flags" } ;
C-STRUCT: MethodMap
{ "Index" "classId" }
{ "Index" "name" }
{ "Index" "method" } ;
FUNCTION: void init_qt_smoke ( ) ;
FUNCTION: Smoke* qt_smoke ( ) ;
FUNCTION: void delete_qt_smoke ( ) ;
FUNCTION: Type* smoke_types ( Smoke* s ) ;
FUNCTION: Class* smoke_classes ( Smoke* s ) ;
FUNCTION: Method* smoke_methods ( Smoke* s ) ;
FUNCTION: Index* smoke_inheritanceList ( Smoke* s ) ;
FUNCTION: Index* smoke_argumentList ( Smoke* s ) ;
FUNCTION: Index* smoke_ambiguousMethodList ( Smoke* s ) ;
FUNCTION: MethodMap* smoke_methodMaps ( Smoke* s ) ;
FUNCTION: char** smoke_methodNames ( Smoke* s ) ;
FUNCTION: Index smoke_numTypes ( Smoke* s ) ;
FUNCTION: Index smoke_numClasses ( Smoke* s ) ;
FUNCTION: Index smoke_numMethods ( Smoke* s ) ;
FUNCTION: Index smoke_numMethodMaps ( Smoke* s ) ;
FUNCTION: Index smoke_numMethodNames ( Smoke* s ) ;
FUNCTION: ModuleIndex smoke_findClass ( Smoke* s, char* c ) ;
FUNCTION: ModuleIndex smoke_findMethod ( Smoke* s, char* c, char* name ) ;
Author: | jedahu |
Mode: | factor |
Date: | Thu, 30 Apr 2009 22:45:26 |
Plain Text |
USING: smoke.ffi alien alien.c-types ;
init_qt_smoke
qt_smoke "QApplication" smoke_findClass
[ ModuleIndex-index ] [ ModuleIndex-smoke smoke_classes ] bi
[ "Class" heap-size * ] dip <displaced-alien>
"Class" heap-size memory>byte-array
Class-parents .
New Annotation