Hi,
I want to know what would be the correct approach for map C style flags
#define IFF_UP 0x1 /* interface is up */ #define IFF_BROADCAST 0x2 /* broadcast address valid */
and how to use then later:
struct ifaddrs* curr = ... if(curr->ifa_flags & IFF_UP){...} /*Especially what will be the equivalent lisp*/
Regards, Jose
On Tue, Dec 14, 2010 at 12:53 AM, Attila Lendvai attila.lendvai@gmail.comwrote:
I want to know what would be the correct approach for map C style flags
see cffi-grovel.
I have already looked at cffi-grovel, from http://common-lisp.net/project/cffi/manual/html_node/Groveller-Syntax.html#G... that a constant is what i need.
But still not found any examples on how to do the bit mask operations with this constants, it would be great if some body can guide me to the right direction, as i newbie to cffi and cl and i'm missed in the way.
Regards, Jose
Looking at how other projects use cffi seems that i should use a constant
you can find examples using the usual search tools...
-- attila
On Tue, Dec 14, 2010 at 10:30 PM, pepone.onrez pepone.onrez@gmail.com wrote:
But still not found any examples on how to do the bit mask operations with this constants, it would be great if some body can guide me to the right direction, as i newbie to cffi and cl and i'm missed in the way.
CL has standard bit-wise logical operations. See http://l1sp.org/cl/logand.
On Tue, 14 Dec 2010 22:47:02 +0000, Luís Oliveira said:
On Tue, Dec 14, 2010 at 10:30 PM, pepone.onrez pepone.onrez@gmail.com wrote:
But still not found any examples on how to do the bit mask operations with this constants, it would be great if some body can guide me to the right direction, as i newbie to cffi and cl and i'm missed in the way.
CL has standard bit-wise logical operations. See http://l1sp.org/cl/logand.
And also http://l1sp.org/cl/logtest for use as a predicate.
__Martin