From 0d83f6fea3159ea0d010361a0043e47281105b4e Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Sun, 6 Jan 2013 20:56:52 +0000 Subject: [PATCH] document magic_version --- doc/libmagic.man | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/doc/libmagic.man b/doc/libmagic.man index 6c1f3372..c5f6bdb0 100644 --- a/doc/libmagic.man +++ b/doc/libmagic.man @@ -1,4 +1,4 @@ -.\" $File: libmagic.man,v 1.25 2011/11/10 13:42:09 christos Exp $ +.\" $File: libmagic.man,v 1.26 2011/12/19 17:49:31 christos Exp $ .\" .\" Copyright (c) Christos Zoulas 2003. .\" All Rights Reserved. @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 19, 2011 +.Dd January 6, 2012 .Dt LIBMAGIC 3 .Os .Sh NAME @@ -37,7 +37,9 @@ .Nm magic_setflags , .Nm magic_check , .Nm magic_compile , -.Nm magic_load +.Nm magic_list , +.Nm magic_load , +.Nm magic_version .Nd Magic number recognition library .Sh LIBRARY .Lb libmagic @@ -67,6 +69,8 @@ .Fn magic_list "magic_t cookie" "const char *filename" .Ft int .Fn magic_load "magic_t cookie" "const char *filename" +.Ft int +.Fn magic_version "void" .Sh DESCRIPTION These functions operate on the magic database file @@ -246,6 +250,16 @@ If that variable is not set, the default database file name is __MAGIC__. adds .Dq .mgc to the database filename as appropriate. +.Pp +The +.Fn magic_version +command returns the version number of this library which is compiled into +the shared library using the constant +.Dv MAGIC_VERSION +from +.In magic.h . +This can be used by client programs to verify that the version they compile +against is the same as the version that they run against. .Sh RETURN VALUES The function .Fn magic_open @@ -276,6 +290,9 @@ function returns a textual description of the errors of the above functions, or .Dv NULL if there was no error. +The +.Fn magic_version +always returns the version number of the library. Finally, .Fn magic_setflags returns \-1 on systems that don't support -- 2.50.0