lkml.org 
[lkml]   [2005]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: kconfig: avoid temporary file
Date
Hi,

On Friday 31 December 2004 00:52, Sam Ravnborg wrote:

> # scripts/kconfig/mconf.c
> # 2004/12/30 22:29:51+01:00 sam@mars.ravnborg.org +78 -28
> # introduce a general growable string.
> # Allow us to skip one additional temporary file

I'm not really against the change, but the reason is weird. In the end the
string is still written to a file anyway...

> +/* 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.

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

\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.237 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site