guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gwrap: including header files in generated code


From: John Steele Scott
Subject: gwrap: including header files in generated code
Date: Fri, 01 Sep 2006 22:52:06 +0900
User-agent: Pan/0.14.2.91 (As She Crawled Across the Table (Debian GNU/Linux))

Hi,

I am trying to figure out how to use g-wrap. So far I have hacked the
examples from the documentation into the following minimal sample:

(use-modules (oop goops))
(use-modules (g-wrap))
(use-modules (g-wrap guile))
(use-modules (g-wrap guile ws standard))

(define-class <my-wrapset> (<gw-guile-wrapset>)
  #:id 'my-wrapset
  #:dependencies '(standard))

(define-method (initialize (ws <my-wrapset>) initargs)
  (next-method)
  
  (wrap-function! ws
                  #:name 'strfry
                  #:returns '(mchars caller-owned)
                  #:arguments '(((mchars caller-owned) s))
                  #:c-name "strfry"))

(generate-wrapset 'guile 'my-wrapset "my-wrapset")

This mostly works, but to make it compile I have to edit the generated
source to have it #include <string.h>. (Btw, if you try this example you
need to also compile with -D_GNU_SOURCE, since strfry is a GNU extension.)

How do I tell g-wrap to put "#include <string.h>\n" in the output? There
are some places in the output source where it looks like it is doing
something similar, but I couldn't figure it out.

cheers,

John





reply via email to

[Prev in Thread] Current Thread [Next in Thread]