Added freefare_version() function (#104)

Added freefare_version() function
This commit is contained in:
broth-itk 2019-07-01 06:22:26 +02:00 committed by Romain Tartière
parent 5459806659
commit 262eacedca
4 changed files with 21 additions and 1 deletions

View file

@ -52,6 +52,7 @@ linkedman = \
freefare.3 freefare_get_tag_type.3 \ freefare.3 freefare_get_tag_type.3 \
freefare.3 freefare_get_tag_uid.3 \ freefare.3 freefare_get_tag_uid.3 \
freefare.3 freefare_get_tags.3 \ freefare.3 freefare_get_tags.3 \
freefare.3 freefare_version.3 \
freefare_error.3 freefare_perror.3 \ freefare_error.3 freefare_perror.3 \
freefare_error.3 freefare_strerror.3 \ freefare_error.3 freefare_strerror.3 \
freefare_error.3 freefare_strerror_r.3 \ freefare_error.3 freefare_strerror_r.3 \

View file

@ -28,7 +28,8 @@
.Nm freefare_get_tag_friendly_name , .Nm freefare_get_tag_friendly_name ,
.Nm freefare_get_tag_uid , .Nm freefare_get_tag_uid ,
.Nm freefare_free_tag , .Nm freefare_free_tag ,
.Nm freefare_free_tags .Nm freefare_free_tags ,
.Nm freefare_version
.Nd Generic target manipulation functions .Nd Generic target manipulation functions
.\" _ _ _ .\" _ _ _
.\" | | (_) |__ _ __ __ _ _ __ _ _ .\" | | (_) |__ _ __ __ _ _ __ _ _
@ -69,6 +70,8 @@ enum freefare_tag_type {
.Fn freefare_free_tag "FreefareTag tags" .Fn freefare_free_tag "FreefareTag tags"
.Ft "void" .Ft "void"
.Fn freefare_free_tags "FreefareTag *tags" .Fn freefare_free_tags "FreefareTag *tags"
.Ft "const char *"
.Fn freefare_version
.\" ____ _ _ _ .\" ____ _ _ _
.\" | _ \ ___ ___ ___ _ __(_)_ __ | |_(_) ___ _ __ .\" | _ \ ___ ___ ___ _ __(_)_ __ | |_(_) ___ _ __
.\" | | | |/ _ \/ __|/ __| '__| | '_ \| __| |/ _ \| '_ \ .\" | | | |/ _ \/ __|/ __| '__| | '_ \| __| |/ _ \| '_ \
@ -117,6 +120,10 @@ can be gathered using the
and and
.Fn freefare_get_tag_friendly_name .Fn freefare_get_tag_friendly_name
functions. functions.
.Pp
The
.Fn freefare_version
function returns the version of the library.
.\" ____ _ _ .\" ____ _ _
.\" | _ \ ___| |_ _ _ _ __ _ __ __ ____ _| |_ _ ___ ___ .\" | _ \ ___| |_ _ _ _ __ _ __ __ ____ _| |_ _ ___ ___
.\" | |_) / _ \ __| | | | '__| '_ \ \ \ / / _` | | | | |/ _ \/ __| .\" | |_) / _ \ __| | | | '__| '_ \ \ \ / / _` | | | | |/ _ \/ __|

View file

@ -213,6 +213,16 @@ freefare_free_tag(FreefareTag tag)
} }
} }
/*
* Return lib version
*/
const char *
freefare_version(void)
{
return PACKAGE_VERSION;
}
const char * const char *
freefare_strerror(FreefareTag tag) freefare_strerror(FreefareTag tag)
{ {

View file

@ -50,6 +50,8 @@ void freefare_free_tag(FreefareTag tag);
void freefare_free_tags(FreefareTag *tags); void freefare_free_tags(FreefareTag *tags);
bool freefare_selected_tag_is_present(nfc_device *device); bool freefare_selected_tag_is_present(nfc_device *device);
const char *freefare_version(void);
const char *freefare_strerror(FreefareTag tag); const char *freefare_strerror(FreefareTag tag);
int freefare_strerror_r(FreefareTag tag, char *buffer, size_t len); int freefare_strerror_r(FreefareTag tag, char *buffer, size_t len);
void freefare_perror(FreefareTag tag, const char *string); void freefare_perror(FreefareTag tag, const char *string);