Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Fri, 6 Feb 2004 15:58:33 +0100
Local: Fri, Feb 6 2004 9:58 am
Subject: Re: Alignment Issues with *ManagedStruct?
Uri Guttman <u...@stemsystems.com> wrote: s/leo/Joe R. Parrot Hacker/ - I can craft initializers by hand ;) > boy, was this easy with this module. all we need to do is mess around > with the output to get whatever leo needs. 1) some script e.g. gen_struct (struct2pasm ...) located in tools/dev or 2) options: --gen-pasm, -p (default, *if* src file =~ /\.pasm$/ 3) Operation 3a) Take a C structure, spit out initializer > with this struct (from leo with some minor changes): ## &gen_struct(--options, --pmc=P20, --gen-pasm) # struct xt { # char x; # struct yt { # char i,k; # int j; # } Y; # char z; #} X; ## &end_gen ## begin autogeneratedd bla bla 4) The output new P20, .OrderedHash # .PerlArray if --no-named-initializer or and .include "datatypes.pasm" # for DATATYPE_ consts below 4b) data type of item push $init_pmc, .DATATYPE_$type # --no-named-init... or set $init_pmc["$var"], .DATATYPE_$type # --name-init.. If item is a nested struct or a pointer to nested struct please 4c) item count = 0, or N for array of items push $init_pmc, $item_count 4d) offset - always 0 for now push $init_pmc, 0 4e) nice to have: preserve C comments (put these after '#') S. also t/pmc/nci.t for examples of initializers and src/nci_test.c for I hope above outline is somewhat clear else please just ask. > uri leo You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||