Added iso_lib_is_compatible() function.
This commit is contained in:
parent
6434de535c
commit
69d0503053
@ -557,6 +557,14 @@ int iso_image_new(const char *name, IsoImage **image);
|
||||
*/
|
||||
void iso_lib_version(int *major, int *minor, int *micro);
|
||||
|
||||
/**
|
||||
* Check if the library is ABI compatible with the given version.
|
||||
*
|
||||
* @return
|
||||
* 1 lib is compatible, 0 is not.
|
||||
*/
|
||||
int iso_lib_is_compatible(int major, int minor, int micro);
|
||||
|
||||
/**
|
||||
* Creates an IsoWriteOpts for writing an image. You should set the options
|
||||
* desired with the correspondent setters.
|
||||
|
@ -1248,3 +1248,17 @@ void iso_lib_version(int *major, int *minor, int *micro)
|
||||
*minor = LIBISOFS_MINOR_VERSION;
|
||||
*micro = LIBISOFS_MICRO_VERSION;
|
||||
}
|
||||
|
||||
int iso_lib_is_compatible(int major, int minor, int micro)
|
||||
{
|
||||
int cmajor, cminor, cmicro;
|
||||
|
||||
/* for now, the rule is that library is compitable if requested
|
||||
* version is lower */
|
||||
iso_lib_version(&cmajor, &cminor, &cmicro);
|
||||
|
||||
return cmajor > major
|
||||
|| (cmajor == major
|
||||
&& (cminor > minor
|
||||
|| (cminor == minor && cmicro >= micro)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user