guile-devel
[Top][All Lists]
Advanced

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

Re: Newbie question on writing bindings.


From: Rob Browning
Subject: Re: Newbie question on writing bindings.
Date: 14 Apr 2001 16:35:00 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Joel Smith <address@hidden> writes:

> Some of the C functions that I want to call from guile take a flag 
> argument which is made from a set of values or'ed together. For example:
> 
> #define FOO     1
> #define BAR     2

The traditional way has generally been to define globals in your
module (or wherever) that are bound to the right integer values
(alternately, you could use a function that given a symbol, returns
the right integer) and then use the normal guile bit-ops to handle the
calls:

  (define FOO 1)
  (define BAR 2)

  (my-func (logior FOO BAR))

etc.

Hope this helps.

-- 
Rob Browning <address@hidden> PGP=E80E0D04F521A094 532B97F5D64E3930



reply via email to

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