LIBBB: parse_config()

dronnikov at gmail.com dronnikov at gmail.com
Mon Jul 7 12:31:29 PDT 2008


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) {
	bb_error_msg("LINE---------");
	while (*token) {
		bb_error_msg("TOKEN [%s]", *token);
		token++;
	}
	token++;
}

free(token);
free(data);
----- CUT -----

Please, comment and consider applying.

TIA,
--
Vladimir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parse.patch
Type: application/octet-stream
Size: 3790 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20080707/d086d983/attachment.obj 


More information about the busybox mailing list