← Back to team overview

kicad-developers team mailing list archive

Re: Using FILE_LINE_READER in pcbnew


On 01/11/2011 04:07 PM, Marco Mattila wrote:
> Hi,
> When discussing the possibility to save plotting options into board
> files earlier, Dick suggested that it might be a good idea to start
> using FILE_LINE_READER in pcbnew. I made a patch that basically
> changes GetLine to use a LINE_READER instead of a file directly. The
> old function was renamed to GetLineD, since it is still currently used
> somewhere else outside pcbnew in its old form. Changing the rest of
> the code to use the new GetLine seems to be fairly trivial in most
> places:
> Old code:
> char line[1024]
> GetLine( file, line, ...)
> ...
> New code:
> char* line;
> GetLine( &fileLineReader )
> line = (char*) fileLineReader;
> ...
> Because it's a rather large patch, I thought that I should post it
> here for comments before committing. If my approach seems reasonable,
> I can clean up and amend the patch so that the new GetLine is used
> everywhere (including eeschema) and GetLineD is not needed anymore.


I'm glad you asked.

There is good and bad in the patch, but enough bad that I think we need to
keep talking.

Let me get back to you within the next couple of hours please, but do not