From: Christos Zoulas Date: Sun, 6 Jan 2013 20:56:52 +0000 (+0000) Subject: document magic_version X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d012175bca4263af16d94984ecd8c14edb46c8b7;p=file document magic_version --- diff --git a/doc/libmagic.man b/doc/libmagic.man index 272b8386..c8a9003b 100644 --- a/doc/libmagic.man +++ b/doc/libmagic.man @@ -1,4 +1,4 @@ -.\" $File: libmagic.man,v 1.26 2011/12/19 17:49:31 christos Exp $ +.\" $File: libmagic.man,v 1.27 2013/01/06 20:56:52 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