On Tue, 2 Mar 2021 06:49:18 +0200 Tzvetomir Stoyanov <tz.stoyanov@xxxxxxxxx> wrote: > While looking at these changes, I think it could be more flexible instead of > introducing a new API, to enhance the existing tracecmd_read_headers(). > We can add an additional (optional) parameter to point out what headers > to be read, i.e. the desired new state of reading the file. Something like that: > int tracecmd_read_headers(struct tracecmd_input *handle, int state); > It will read the file from its current file_state to the desired state. > The API could be called multiple times, to progress the reading of the > file, header by header if needed, or a bunch of headers. > I actually like this idea. The only downside of it, is that we need to make the states part of the API (export them). -- Steve