|
From: Chris F. <cd...@fo...> - 2011-05-28 00:44:15
|
On Fri, May 27, 2011 at 01:24:28AM -0300, Luiz Angelo Daros de Luca wrote: > Hello Chris, > > I hope that, if you see my code, it didn't scary you. :-) > I have finished the plugin implementation part and I also almost > finished the ruby-file-sync example. However, I cannot finish the > plugin without a format implementation. > > Here comes my problem: formats have no data. There is no > osync_objformat_set_data. I implemented it using the > same strategy that I used to workarround the missing > osync_objtype_sink_get_userdata. It was all ok until I started to > implement the first objformat callback router method. All format > callbacks do not have an OSyncObjFormat argument, as > plugin and objettype sink callbacks have OSyncPlugin and > OSyncObjTypeSink. The only way to define data is by returning some > pointer from initialization function. Yeah, I see how that could be a problem for a wrapper. I'm guessing a bit here, but I believe that implementing the objformat userdata that way means that the objformat names can be known, while not using much memory. If any objformat is needed during the sync, then it could be initialized on the fly. If all objformats had to be initialized at the beginning, and only two were needed, it would be a waste. Is it possible to make use of this in ruby? i.e. only initialize things when asked for? The only key you can use would be the objformat name, but that does not change once created. - Chris |