Hello,

In C, it's common to have various values that you combine via '|'. In most of 
the C interfacing vocabs that I've used, these values are provided via a 
simple word definition. So the question is, how do you OR them together? 
There are a few ways to go about it. After trying out a few, I finally 
settled on a macro named 'flags'. For now, it's tucked away in the obscure 
vocab 'unix.linux.ifreq'. If it becomes generally used, I'll put it in a 
better place. It's very simple to use:

  { S_IRUSE S_IWUSR S_IXUSR } flags

I like that better than:

  S_IRUSE S_IWUSR bitor S_IXUSR bitor

Another benefit is that the values are combined at compile time.

Ed

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to