Next: , Previous: Header, Up: Preparation


2.2 Version Check

It is often desirable to check that the version of `KSBA' used is indeed one which fits all requirements. Even with binary compatibility, new features may have been introduced but through peculiarities of the runtime linker an old version gets actually used. So you better check that the version is as expected right after program startup.

— Function: const char * ksba_check_version (const char *req_version)

Check that the the version of the library is at minimum the one given as a string in req_version and return the actual version string of the library; return NULL if the condition is not met. If NULL is passed to this function, no check is done and only the version string is returned. It is a pretty good idea to run this function as soon as possible, because it may also initializes some subsystems. In a multi-threaded environment if should be called before any more threads are created.