Re: Ответ: Ответ: LIBBB: parse_config()

2008-07-09 Thread Rob Landley
On Tuesday 08 July 2008 16:40:14 Vladimir Dronnikov wrote: Cool! But we need to not just process continuations and comments but also to parse the line into some (possibly variable) amount of whitespaces-delimited tokens. There's no obvious reason to mix these two issues. A function that

Re: Ответ: Ответ: LIBBB: parse_config()

2008-07-09 Thread Tito
On Wednesday 09 July 2008 14:35:50 Rob Landley wrote: On Tuesday 08 July 2008 16:40:14 Vladimir Dronnikov wrote: Cool! But we need to not just process continuations and comments but also to parse the line into some (possibly variable) amount of whitespaces-delimited tokens. There's

Re: Ответ: Ответ: LIBBB: parse_config()

2008-07-09 Thread Tito
On Wednesday 09 July 2008 18:01:17 Tito wrote: On Wednesday 09 July 2008 14:35:50 Rob Landley wrote: On Tuesday 08 July 2008 16:40:14 Vladimir Dronnikov wrote: Cool! But we need to not just process continuations and comments but also to parse the line into some (possibly variable)

Re: Ответ: Ответ: LIBBB: parse_config()

2008-07-09 Thread Vladimir Dronnikov
Hmmm! 1. The only major difference from what I proposed on (09.07.2008 2:16) is to use a bunch on xmalloc_fgetline() (which in turn uses a bunch of fgetc()) along with malloc/free cycles. I still think then if a file can be processed in-memory it should be processed in-memory. Though a FEATURE

Re: LIBBB: parse_config()

2008-07-08 Thread Vladimir Dronnikov
The point is to define both library and applet interfaces so that the needless duplication of data does not exist. I'm inclined to rewrite parse_config() so that it takes variable number of arguments which are the pointers to (char *) vectors. E.g. char *minutes, *hours;

Re: Ответ: LIBBB: parse_config()

2008-07-08 Thread Tito
On Monday 07 July 2008 22:29:38 Vladimir Dronnikov wrote: Sure :) But some help is needed. I am trying to convert inotifyd. mdev is saint animal. Natanael mentioned ifup/down. There is crond that uses plain config. There gotta be savings en gros if we cope this together. -- Vladimir

Ответ: Ответ: LIBBB: parse_config()

2008-07-08 Thread Vladimir Dronnikov
Cool! But we need to not just process continuations and comments but also to parse the line into some (possibly variable) amount of whitespaces-delimited tokens. And, as I mentioned earlier, we need to use the collected tokens in unobtrusive way in the applets. Can you go on and code these

LIBBB: parse_config()

2008-07-07 Thread dronnikov
A helper function for parsing vanilla config files is added. I see mdev, crond and others can use it to uniformly process their configs. Typical usage: - CUT - void *data; char **token = parse_config(filename, 128, data); // 128 tokens at most while (*token) {

Re: LIBBB: parse_config()

2008-07-07 Thread Bernhard Fischer
On Mon, Jul 07, 2008 at 12:31:29PM -0700, [EMAIL PROTECTED] wrote: A helper function for parsing vanilla config files is added. I see mdev, crond and others can use it to uniformly process their configs. It would be better if you would convert a few users to this new parse_config() and show the

Ответ: LIBBB: parse_config()

2008-07-07 Thread Vladimir Dronnikov
Sure :) But some help is needed. I am trying to convert inotifyd. mdev is saint animal. Natanael mentioned ifup/down. There is crond that uses plain config. There gotta be savings en gros if we cope this together. -- Vladimir 2008/7/7, Bernhard Fischer [EMAIL PROTECTED]: On Mon, Jul 07, 2008

Re: LIBBB: parse_config()

2008-07-07 Thread Denys Vlasenko
[CC: [EMAIL PROTECTED] On Monday 07 July 2008 21:31, [EMAIL PROTECTED] wrote: Please, comment and consider applying. +static void FAST_FUNC replace(char *s, char what, char with) You do not need FAST_FUNCs on static functions. gcc does it itself. At least I try to believe gcc will pick the

Re: LIBBB: parse_config()

2008-07-07 Thread Denys Vlasenko
On Tuesday 08 July 2008 05:47, Denys Vlasenko wrote: [CC: [EMAIL PROTECTED] On Monday 07 July 2008 21:31, [EMAIL PROTECTED] wrote: Please, comment and consider applying. Another comment: the return value should be NULL if file can't be opened; should contain at least one element (NULL) if