libidn: Version Check

1 
1 2.3 Version Check
1 =================
1 
1 It is often desirable to check that the version of ‘Libidn’ used is
1 indeed one which fits all requirements.  Even with binary compatibility
1 new features may have been introduced but due to problem with the
1 dynamic linker an old version is actually used.  So you may want to
1 check that the version is okay right after program startup.
1 
1 stringprep_check_version
1 ------------------------
1 
1  -- Function: const char * stringprep_check_version (const char *
1           REQ_VERSION)
1      REQ_VERSION: Required version number, or NULL.
1 
1      Check that the version of the library is at minimum the requested
1      one and return the version string; return NULL if the condition is
1      not satisfied.  If a NULL is passed to this function, no check is
1      done, but the version string is simply returned.
1 
1      See ‘STRINGPREP_VERSION’ for a suitable ‘req_version’ string.
1 
1      Return value: Version string of run-time library, or NULL if the
1      run-time library does not meet the required version number.
1 
1    The normal way to use the function is to put something similar to the
1 following first in your ‘main’:
1 
1        if (!stringprep_check_version (STRINGPREP_VERSION))
1          {
1            printf ("stringprep_check_version() failed:\n"
1                    "Header file incompatible with shared library.\n");
1            exit(EXIT_FAILURE);
1          }
1