Universal binary file format




Hello,

I messed last night with GnomePrintMeta and have some questions.

- As I understood, it is designed to be platform independent, i.e.
interchangeable between computers. But can anybody give me some examples,
for which uses this can be useful? Not spooling - this is more lowlevel.
Is that for bonobo?

- I personally do not like the format of meta buffer - it is too
binary-only. If something in the file is screwed up (example: new version
of metafile is used with older replay software) things will end with error
message without any reasonable way to repair anything.

Example: I tried to use metafile for temporary rendering - but
unfortunately it refuses to render before buffer is closed. Marking buffer
length without closing ended with 'serious metafile corruption' error.

So I have idea:
If we do not want to use xml (for good reasons, because xml file size can
change (CR/LF problems etc.) and this will make intended fast
page-scanning impossible) - there was wonderful semi-standard way for
binary files in Amiga (AIFF? IFF?). What if to reimplement GnomePrintMeta
buffer something like:

'AIFF''GPMF'{metafile size}'VERS'{string length}"Gnome Print Metafile 1.2"
'PAGE'{size of page description}'MOVE'{8}$x$$y$'LINE'{8}$x$$y$
etc. (I have to look more closely to spec - this is only as I remember it)
'ABCD' is four-byte designator
{number} is 32 bit integer (HSB first)
$number$ is 32 bit float (IEEE standard)

In Amiga there was general libxml-like library for parsing such files -
i.e. these could be rendered into memory blocks without renderer knowing
anything about the meaning of tags. Rendering software could install its
own hooks, which were called during rendering, to do usable things.

Maybe there are more places where xml is not suitable (we need fast
scanning), and efs is not required (single stream, no insertion). Then
something like "GNOME Binary interchangeable file standard" and its
support libraries should be useful.

Comments? Thoughts? Flames?

Lauris




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