package provide Freetype::ftsystem 0.1

if {![info exists _source([file tail [info script]])]} {
package require Freetype::ft2build

#TODO: how to imprement function pointer??

ft::struct define FT_Memory {
    {user     int * pointer      1 pointer}
    {alloc    int - pointer-proc 1 pointer}
    {free     int - pointer-proc 1 pointer}
    {realloc  int - pointer-proc 1 pointer}
}

ft::struct define FT_StreamDesc {
    {value   int - long    1 void}
    {pointer int * pointer 1 pointer}
}

ft::struct define FT_Stream {
    {base        int    - pointer             1 pointer}
    {size        int    - {unsigned long}     1 {unsigned long}}
    {pos         int    - {unsigned long}     1 {unsigned long}}
    {descriptor  object - FT_StreamDesc       1 FT_StreamDesc}
    {pathname    object - FT_StreamDesc       1 FT_StreamDesc}       
    {read        int    - pointer-proc        1 pointer}
    {close       int    - pointer-proc        1 pointer}
    {memory      object - FT_Memory           1 pointer}
    {cursor      int    - pointer             1 pointer}
    {limit       int    - pointer             1 pointer}
}

set _source([file tail [info script]]) 1
}
