lin-club  

Re: r2llib interface change requests

mulix
Sun, 05 Aug 2001 02:24:49 -0700

On Sat, 4 Aug 2001, guy keren wrote:

>
> On Fri, 3 Aug 2001, mulix wrote:
>
> > i guess you didnt get my meaning above.
> > if we switch from file existence (r2l state) + size (biditext base dir)
> > to two files (one for r2l state and one for biditext base dir), then we
> > have to have *two* stat()s, anyway.
> > if we need to have two stat()s, i dont like the ugly interface.
>
> ok. so lets not use 2 files then. instead, we can encode both attribtues
> as the size of the file. allocate bit 0 for 'enable' mode. bits 1+2 for
> 'biditext base state'.
>
> thus:
>
> size:   r2l_mode      biditext base direction
> ----------------------------------------------
> 0       enabled       neutral
> 1       disabled      neutral
> 2       enabled       rtl
> 3       disabled      rtl
> 4       enabled       ltr
> 5       disabled      ltr

i liked it, therefore i implemented it :)
see the release announcement for r2llib-0.21.

-- 
mulix
http://www.advogato.com/person/mulix

linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead