Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

linked struct!

 [1/2] from: maarten::koopmans::surfnet::nl at: 6-May-2002 16:04


Hi, How do I specify a struct! that has a reference to a next entry (linked list) with type itself? And how do I intelligently define a complex struct type in a routine definition without doing that inline?=09 --Maarten

 [2/2] from: petr:krenzelok:trz:cz at: 6-May-2002 19:54


Maarten Koopmans wrote:
>Hi, > >How do I specify a struct! that has a reference to a next entry (linked list) >with type itself? > >And how do I intelligently define a complex struct type in a routine >definition without doing that inline? > >--Maarten >
I am still not sure of what you need to achieve, but together with Cyphre we wrapped gfl_lib - it is a library allowing to load 350 gfx file formats ... The pity is we can't get access to memory buffer, as rebol library interface seems to cut image data in a referenced structure, once it achieves null char, or so is my theory ... here is how to handle nested structures ... We are in rebol, right? So we can compose things, right? :-) _GFL_BITMAP: make struct! compose/deep [ Type [short] Origin [short] Width [integer!] Height [integer!] BytesPerLine [integer!] LinePadding [short] Reserved [short] BytesPerPixel [char!] BitsPerComponent [char!] Xdpi [short] Ydpi [short] TransparentIndex [short] ColorUsed [integer!] ColorMap [integer!] Data [char*] ] none GFL_BITMAP_WRAP: make struct! compose/deep [ gfl_bitmap [struct! [(first _GFL_BITMAP)]] ] reduce [0 0 0 0 0 0 0 #"^@" #"^@" 0 0 0 0 0 img-buff] -pekr-