]> granicus.if.org Git - file/commitdiff
document magic_version
authorChristos Zoulas <christos@zoulas.com>
Sun, 6 Jan 2013 20:56:52 +0000 (20:56 +0000)
committerChristos Zoulas <christos@zoulas.com>
Sun, 6 Jan 2013 20:56:52 +0000 (20:56 +0000)
doc/libmagic.man

index 272b8386a30e7c8afc764331f945023a6e5be0d7..c8a9003b6831e459359f09e0403e19ee01c5f2e7 100644 (file)
@@ -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