X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=keyarray.h;h=e50a030c4ec2dd576d0040ad62e85b54484d9701;hb=4baef3532b82bcaaa1aecc376b7e63e8a20d8bf7;hp=a3e288aae656da90d0416f1aa0efa2bd9ab07857;hpb=46ebdd20784c242ca96b949813d90167349177d9;p=onak.git diff --git a/keyarray.h b/keyarray.h index a3e288a..e50a030 100644 --- a/keyarray.h +++ b/keyarray.h @@ -14,8 +14,7 @@ * more details. * * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * this program. If not, see . */ #ifndef __KEYARRAY_H__ @@ -65,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__ */