+2001-11-20 Marcus Brinkmann <marcus@g10code.de>
+
+ * types.h: Add types EngineObject and GpgsmObject.
+
+ * Makefile.am (libgpgme_la_SOURCES): Add engine-gpgsm.h,
+ engine-gpgsm.c, engine.h and engine.c.
+ * engine.h: New file.
+ * engine.c: Likewise.
+ * engine-gpgsm.h: Likewise.
+ * engine-gpgsm.c: Likewise.
+
+ * rungpg.c (_gpgme_gpg_get_version): New function.
+ (_gpgme_gpg_check_version): Likewise.
+ * rungpg.h: Add prototypes for _gpgme_gpg_get_version and
+ _gpgme_gpg_check_version.
+
+ * version.c (compare_versions): Rename to ...
+ (_gpgme_compare_versions): ... this. Make non-static.
+ (gpgme_check_version): Use _gpgme_compare_versions rather than
+ compare_versions.
+ (gpgme_check_engine): Likewise.
+ * ops.h (_gpgme_get_program_version): Add prototype.
+
2001-11-20 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (libgpgme_la_INCLUDES): Remove obsolete directive.
return s; /* patchlevel */
}
-static const char *
-compare_versions ( const char *my_version, const char *req_version )
+const char *
+_gpgme_compare_versions (const char *my_version,
+ const char *req_version)
{
- int my_major, my_minor, my_micro;
- int rq_major, rq_minor, rq_micro;
- const char *my_plvl, *rq_plvl;
-
- if ( !req_version )
- return my_version;
-
- my_plvl = parse_version_string ( my_version,
- &my_major, &my_minor, &my_micro );
- if ( !my_plvl )
- return NULL; /* very strange: our own version is bogus */
- rq_plvl = parse_version_string( req_version,
- &rq_major, &rq_minor, &rq_micro );
- if ( !rq_plvl )
- return NULL; /* req version string is invalid */
-
- if ( my_major > rq_major
- || (my_major == rq_major && my_minor > rq_minor)
- || (my_major == rq_major && my_minor == rq_minor
- && my_micro > rq_micro)
- || (my_major == rq_major && my_minor == rq_minor
- && my_micro == rq_micro
- && strcmp( my_plvl, rq_plvl ) >= 0) ) {
- return my_version;
+ int my_major, my_minor, my_micro;
+ int rq_major, rq_minor, rq_micro;
+ const char *my_plvl, *rq_plvl;
+
+ if (!req_version)
+ return my_version;
+
+ my_plvl = parse_version_string (my_version, &my_major, &my_minor, &my_micro);
+ if (!my_plvl)
+ return NULL; /* Very strange: our own version is bogus. */
+ rq_plvl = parse_version_string(req_version,
+ &rq_major, &rq_minor, &rq_micro);
+ if (!rq_plvl)
+ return NULL; /* Requested version string is invalid. */
+
+ if (my_major > rq_major
+ || (my_major == rq_major && my_minor > rq_minor)
+ || (my_major == rq_major && my_minor == rq_minor
+ && my_micro > rq_micro)
+ || (my_major == rq_major && my_minor == rq_minor
+ && my_micro == rq_micro
+ && strcmp( my_plvl, rq_plvl ) >= 0))
+ {
+ return my_version;
}
- return NULL;
+ return NULL;
}
* Return value: The version string or NULL
**/
const char *
-gpgme_check_version ( const char *req_version )
+gpgme_check_version (const char *req_version)
{
- do_subsystem_inits ();
- return compare_versions ( VERSION, req_version );
+ do_subsystem_inits ();
+ return _gpgme_compare_versions (VERSION, req_version);
}
-
/**
* gpgme_get_engine_info:
*
return mk_error (Out_Of_Core);
memcpy (ver, s, s2-s);
ver[s2-s] = 0;
- s = compare_versions ( ver, NEED_GPG_VERSION );
+ s = _gpgme_compare_versions ( ver, NEED_GPG_VERSION );
xfree (ver);
if (s)
return 0;