Hi all,
after a long time without hacking on geda, I'm back again! :-)
I have added support for embedded pictures in the schematic. This
affects both libgeda and gschem. When a picture is embedded in the
schematic, gschem will not need the picture file anymore. The picture
data is stored in the schematic file.
Basically, an embedded picture is serialized, then encoded using base64,
and then stored in the schematic file, at the end of its picture
section. The end of the serialized data is marked with a line containing
only a dot '.' character.
Even if a picture is embedded, its filename is still stored in the
schematic file, despite the filename is not used anymore (at least until
it is unembedded). I think it's better to do it, because a picture which
is embedded and, sometime later, unembedded couldn't have a real
filename. This way, when it is unembedded, the original filename is used
again.
Before hacking this, I had to fix a memory leak (gschem segfaulted when
adding a picture) within gschem/noweb/i_basic.nw. I undid the last Dan's
patch and fixed the compiler warning (I think). Dan, please review the
changes and tell me if they are OK.
I added a new file s_encoding.nw, which contains the base64 encoding and
decoding functions. I didn't know exactly where to put them, so I
decided to create a new file. If there is a better place, suggestions
are always welcome....

There is still a compiler warning related with the new file
s_encoding.nw:
When compiling, the compiler tells:
../noweb/s_encoding.nw: In function 's_encoding_base64_decode':
../noweb/s_encoding.nw:233: warning: implicit declaration of function
'strlen'
../noweb/s_encoding.nw:233: warning: incompatible implicit declaration
of built-in function 'strlen'
The function strlen is declared in string.h, I think. At the beginning
of the s_encoding.nw file, I put the include clause:
#ifdef HAVE_STRING_H
#include <string.h>
#endif
If I remove the #ifdef clause, so it always includes the string.h file,
the compiler warning goes away...
The other source files uses this and all is working fine, so I didn't
removed the #ifdef clause... but I don't know why this is happening. Any
ideas?

As always, suggestions and testing are very welcome. Please, report any
bug you found!.

Cheers,

Carlos

Reply via email to