Re: Re: [PATCH v4 3/5] config: make parsing stack struct independent from actual data source

2013-05-13 Thread Heiko Voigt
On Sun, May 12, 2013 at 09:56:39PM -0700, Junio C Hamano wrote: Heiko Voigt hvo...@hvoigt.net writes: /* - * The fields f and name of top need to be initialized before calling + * All source specific fields in the union, name and the callbacks + * fgetc, ungetc, ftell of top need to be

Re: [PATCH v4 3/5] config: make parsing stack struct independent from actual data source

2013-05-13 Thread Junio C Hamano
Heiko Voigt hvo...@hvoigt.net writes: On Sun, May 12, 2013 at 09:56:39PM -0700, Junio C Hamano wrote: Heiko Voigt hvo...@hvoigt.net writes: /* - * The fields f and name of top need to be initialized before calling + * All source specific fields in the union, name and the callbacks +

Re: Re: [PATCH v4 3/5] config: make parsing stack struct independent from actual data source

2013-05-13 Thread Jeff King
On Mon, May 13, 2013 at 04:04:35PM +0200, Heiko Voigt wrote: -static int do_config_from(struct config_file *top, config_fn_t fn, void *data) +static int do_config_from_source(struct config_source *top, config_fn_t fn, void *data) [...] I thought I recalled that Jeff asked me to

Re: [PATCH v4 3/5] config: make parsing stack struct independent from actual data source

2013-05-12 Thread Junio C Hamano
Heiko Voigt hvo...@hvoigt.net writes: /* - * The fields f and name of top need to be initialized before calling + * All source specific fields in the union, name and the callbacks + * fgetc, ungetc, ftell of top need to be initialized before calling * this function. */ -static int

[PATCH v4 3/5] config: make parsing stack struct independent from actual data source

2013-05-11 Thread Heiko Voigt
To simplify adding other sources we extract all functions needed for parsing into a list of callbacks. We implement those callbacks for the current file parsing. A new source can implement its own set of callbacks. Instead of storing the concrete FILE pointer for parsing we store a void pointer.