|
From: Henrik /K. <he...@ka...> - 2009-11-10 00:47:01
|
Dear all, During my work on upgrading mozilla-sync to Thunderbird 3, I am once again thinking about creating a mozilla-format FORMAT plugin. But, as always, I have a question... The mozilla-format would be an non-string format - basically a C struct with a couple of members, implementing a key/value array. The struct would be wrapped in functions like mozilla_format_add_key_value_pair(key, value). Now the question is: Where to put the definition of the C struct and the wrapping functions? Those definitions would have to be accessible both by the mozilla-format FORMAT plugin and the mozilla-sync SYNC plugin (an external plugin, by the way...) Looking at xmlformat we have functions like osync_xmlformat_parse and osync_xmlformat_assemble defined in the main OpenSync codebase (opensync/xmlformat/opensync_xmlformat.c), not in the format plugin. But I guess we would not like to pollute the main OpenSync codebase with mozilla-format stuff. Looking at vformat, it seems that the internal format is a string, so even if the vformat plugin has some internal woodo to convert to/from xmlformat, a peer wishing to create a vformat would just create a string. But this would not work for mozilla-format, where we would need to create the C struct. Putting the definition of the C struct and the wrapping functions inside the format plugin is no good, as they would not be published for the mozilla-sync SYNC plugin to use. So, I need some help here: Where to put the definition of the C struct and the wrapping functions? Bonus question: If I want to create a converter between mozilla-format and vformat, I would need access to the vformat functions. Currently those are internal function in the vformat plugin. How can I get access to them? /Henrik |