Skip to content

Commit

Permalink
Added freefare_version() function (nfc-tools#104)
Browse files Browse the repository at this point in the history
Added freefare_version() function
  • Loading branch information
broth-itk authored and smortex committed Jul 1, 2019
1 parent 5459806 commit 262eace
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions libfreefare/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ linkedman = \
freefare.3 freefare_get_tag_type.3 \
freefare.3 freefare_get_tag_uid.3 \
freefare.3 freefare_get_tags.3 \
freefare.3 freefare_version.3 \
freefare_error.3 freefare_perror.3 \
freefare_error.3 freefare_strerror.3 \
freefare_error.3 freefare_strerror_r.3 \
Expand Down
9 changes: 8 additions & 1 deletion libfreefare/freefare.3
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
.Nm freefare_get_tag_friendly_name ,
.Nm freefare_get_tag_uid ,
.Nm freefare_free_tag ,
.Nm freefare_free_tags
.Nm freefare_free_tags ,
.Nm freefare_version
.Nd Generic target manipulation functions
.\" _ _ _
.\" | | (_) |__ _ __ __ _ _ __ _ _
Expand Down Expand Up @@ -69,6 +70,8 @@ enum freefare_tag_type {
.Fn freefare_free_tag "FreefareTag tags"
.Ft "void"
.Fn freefare_free_tags "FreefareTag *tags"
.Ft "const char *"
.Fn freefare_version
.\" ____ _ _ _
.\" | _ \ ___ ___ ___ _ __(_)_ __ | |_(_) ___ _ __
.\" | | | |/ _ \/ __|/ __| '__| | '_ \| __| |/ _ \| '_ \
Expand Down Expand Up @@ -117,6 +120,10 @@ can be gathered using the
and
.Fn freefare_get_tag_friendly_name
functions.
.Pp
The
.Fn freefare_version
function returns the version of the library.
.\" ____ _ _
.\" | _ \ ___| |_ _ _ _ __ _ __ __ ____ _| |_ _ ___ ___
.\" | |_) / _ \ __| | | | '__| '_ \ \ \ / / _` | | | | |/ _ \/ __|
Expand Down
10 changes: 10 additions & 0 deletions libfreefare/freefare.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,16 @@ freefare_free_tag(FreefareTag tag)
}
}

/*
* Return lib version
*/
const char *
freefare_version(void)
{
return PACKAGE_VERSION;
}


const char *
freefare_strerror(FreefareTag tag)
{
Expand Down
2 changes: 2 additions & 0 deletions libfreefare/freefare.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ void freefare_free_tag(FreefareTag tag);
void freefare_free_tags(FreefareTag *tags);
bool freefare_selected_tag_is_present(nfc_device *device);

const char *freefare_version(void);

const char *freefare_strerror(FreefareTag tag);
int freefare_strerror_r(FreefareTag tag, char *buffer, size_t len);
void freefare_perror(FreefareTag tag, const char *string);
Expand Down

0 comments on commit 262eace

Please sign in to comment.