Re: kconfig: avoid temporary file

From: Sam Ravnborg
Date: Mon Jan 03 2005 - 00:10:26 EST


On Mon, Jan 03, 2005 at 01:55:04AM +0100, Roman Zippel wrote:
>
> I'm not really against the change, but the reason is weird. In the end the
> string is still written to a file anyway...
Next step is to integrate Petr Baudis patch to link lxdialog with mconf.
Then it is nice to get rid of the file based interface.

> > +/* Growable string. Allocates memory as needed when string expands */
> > +struct gstr {
> > + char *s;
> > + size_t len;
> > +};
>
> I would prefer something more like this:
>
> struct gstr {
> int size;
> char s[0];
> };
>
> and this would be better names for the functions:
>
> struct gstr *str_new(void);
> void str_free(struct gstr *gs);
> void str_append(struct gstr *gs, const char *s);
>
> It would be useful to have these sort of functions in the library, so we can
> e.g. use them to dynamically generate the help text.

I will update my patch with your suggestions later this week.

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/