lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memory-stream.cc


From: Han-Wen Nienhuys
Subject: Re: memory-stream.cc
Date: Fri, 25 Feb 2005 12:21:29 +0100

address@hidden writes:
> > 
> > A better approach would be to rewrite ttftool/ , Right now, it does
> > output with FILE, but we want it to write to
> > memory. cookie_io_functions_t is an easy way to do that, but it is
> > also possible to substitute My_file for FILE and implement a
> > myfprintf() which writes to memory in stead of disk. Would you want to
> > try implementing that?
> 
> Sorry to butt in, but why reinvent the wheel? lily uses C++ anyway and there
> are more than enough solutions for in-memory streams available that are
> portable to any system with a conforming C++ standard library.
> 
> 
> I am sure Google will reveal more solutions out there. Whatever approach you
> want to pursue, I recommend *not* to redevelop memory streams from scratch.

Well, whatever. The point is that I've imported a C library wholesale;
I think it would be bad practice to change that library or make it
C++. It makes importing bugfixes hard.

The library doesn't do anything spectacular, except call fprintf and
fputs for output. The quickest path to get that up and running without
modifying the code to make a mini-library which mimicks C streams, adn
do

   #define FILE My_file
   #define fprintf My_fprintf

and link a library providing this struct and function.

-- 

 Han-Wen Nienhuys   |   address@hidden   |   http://www.xs4all.nl/~hanwen 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]