[REBOL] Re: linked struct!
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-