Phil Dibowitz wrote:
> What about passing around a void* like I suggested with the size and all
> hidden inside of but an export_blob() API that dumps it to something easy -
> such as our uint8_t* with a size, and of course an import_blob() to go with?
> Initially this will be kinda of silly because the internal representation
> will be identical, but it gives us the freedom to change at will and the
> flexibility to let users hack on stuff.
> 
> FURTHER, it means they'll never screw with OUR copy of the data - they have
> to *ask* us to take it via import_blob(), so we can do some sanity checking
> and such if we'd like.

Yeah, I guess that would work.

So I guess we'd end up with something very roughly like:

// could read() or mmap()
read_blob_from_file(filename, out_blob)
// create blob referencing (or taking copy of) user-supplied data
make_blob_from_data(data, size, out_blob)
// copy data from blob into new buffer
copy_data_from_blob(blob, out_data, out_size)
// must know which API created it, to know how to destroy it;
// kinda like a virtual destructor
destroy_blob()

erase_config()
write_config_to_remote(blob)

erase_firmware()
write_firmware_to_remote(blob)

In other words, extract_firmware_binary would be folded into the
internal implementation of write_firmware_to_remote, and similar for
find_config_binary/write_config_to_remote?

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel

Reply via email to