View Single Post
Old 2012-10-26, 22:46   #10
burrobert
 
burrobert's Avatar
 
Oct 2012
Altona Victoria

11002 Posts
Default

Quote:
Originally Posted by Batalov View Post
The demo.c code is deliberately outside of the library, so that all the API was clear; it can be read and cut-and-pasted. You cannot just call the core methods (from any library, not just libmsieve) without the proper initialization.

Also, generally it is not a robust idea to manually set up some variables when the constructor (in this case, msieve_obj_new()) exists. Over the course of time, the library can be later updated, methods refactored, etc, and the new constructor will take care of that, but the raw code will fail. That is all of course unless the role of the raw code is for one day/one test only and then to be deleted.
Actually I hadn't noticed the demo.c program but I'll have a look at it now. I wasn't able to find any documentation for the API so I looked at the header files to work out the structures and functions.
burrobert is offline   Reply With Quote