Jeff King [off-list ref] writes:
I wonder if it would be more obvious with the more usual OO-struct
functions, like:
struct config_source {
...
};
void config_source_init_file(struct config_source *, const char *fn);
void config_source_init_strbuf(struct config_source *,
const struct strbuf *buf);
void config_source_clear(struct config_source *);
int config_source_parse(struct config_source *);
and then the use would be something like:
struct config_source top;
int ret;
config_source_init_file(&top, "foo");
ret = config_source_parse(&top);
config_source_clear(&top);
return ret;
I.e., "init" constructors, a "clear" destructor, and any methods like
"parse" that you need.
Yup, that cocincides with my first impression I sent out for the
previous RFC/PATCH round.