X-Git-Url: http://the.earth.li/gitweb/?a=blobdiff_plain;f=keyarray.h;fp=keyarray.h;h=e50a030c4ec2dd576d0040ad62e85b54484d9701;hb=2039724ebd70536ad567630725f6b75b7868e486;hp=0a137a618f22f9cbd2325559361a45396fedb816;hpb=4b6032dbfb20e041043cfa0b6b84145f49a98a11;p=onak.git diff --git a/keyarray.h b/keyarray.h index 0a137a6..e50a030 100644 --- a/keyarray.h +++ b/keyarray.h @@ -64,4 +64,20 @@ void array_free(struct keyarray *array); */ bool array_add(struct keyarray *array, struct openpgp_fingerprint *fp); +/** + * @brief Compare two OpenPGP fingerprints + * @param a Fingerprint 1 + * @param b Fingerprint 2 + * + * Compares 2 OpenPGP fingerprints, returning an integer less than, equal to, + * or greater than zero depending on whether a is less than, matches, or is + * greater than b. + * + * For the purposes of comparison shorter fingerprints sort earlier than + * longer fingerprints (i.e. v3 < v4 < v5) and comparison of same-length + * fingerprints treats them as a numberical value. + */ +int fingerprint_cmp(struct openpgp_fingerprint *a, + struct openpgp_fingerprint *b); + #endif /* __KEYARRAY_H__ */