This is the magicffi Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:55:48 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
magicffi
cffi interface to libmagic(3)
Desmond O. Chang <dochang+magicffi@gmail.com>
Desmond O. Chang <dochang+magicffi@gmail.com>
Simplified BSD License
A file type determination library.
cffi-grovel
(system).
cffi-grovel
(system).
cffi
(system).
cl-ppcre
(system).
package.lisp
(file).
grovel.lisp
(file).
types.lisp
(file).
api.lisp
(file).
shortcuts.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
magicffi/magicffi.asd
magicffi/package.lisp
magicffi/grovel.lisp
magicffi/types.lisp
magicffi/api.lisp
magicffi/shortcuts.lisp
magicffi/grovel.lisp
package.lisp
(file).
magicffi
(system).
magicffi/types.lisp
grovel.lisp
(file).
magicffi
(system).
magic
(class).
magic-error
(condition).
magic-error-errno
(reader method).
magic-error-error
(reader method).
magicp
(function).
open-magic-p
(function).
%boolean-from-lisp
(function).
%boolean-to-lisp
(function).
%magic-c-to-lisp
(function).
%magic-cookie
(reader method).
(setf %magic-cookie)
(writer method).
%magic-error-reporter
(function).
%magic-lisp-to-c
(function).
magicffi/api.lisp
types.lisp
(file).
magicffi
(system).
*magic-database*
(special variable).
magic-buffer
(function).
magic-check
(function).
magic-close
(function).
magic-compile
(function).
magic-error
(function).
magic-file
(function).
magic-load
(function).
magic-open
(function).
magic-setflags
(function).
with-open-magic
(macro).
%database-funcall
(macro).
%pathlist-to-cstring
(function).
%pathname-concat
(function).
%truename
(function).
%var-accessor-*errno*
(function).
(setf %var-accessor-*errno*)
(function).
*errno*
(symbol macro).
magic-verify-version
(function).
magic-version
(function).
magicffi/shortcuts.lisp
api.lisp
(file).
magicffi
(system).
pathname-apple
(function).
pathname-extension
(function).
pathname-file
(function).
pathname-mime
(function).
pathname-mime-encoding
(function).
pathname-mime-type
(function).
Packages are listed by definition order.
magicffi
Usage:
> (asdf:load-system :magicffi)
> (use-package :magicffi)
> (with-open-magic (magic ’(:mime-type :symlink))
(magic-load magic)
(magic-file magic #P"magicffi.asd"))
"text/plain"
cffi
.
common-lisp
.
*magic-database*
(special variable).
magic
(class).
magic-buffer
(function).
magic-check
(function).
magic-close
(function).
magic-compile
(function).
magic-error
(function).
magic-error
(condition).
magic-error-errno
(generic reader).
magic-error-error
(generic reader).
magic-file
(function).
magic-load
(function).
magic-open
(function).
magic-setflags
(function).
magicp
(function).
open-magic-p
(function).
pathname-apple
(function).
pathname-extension
(function).
pathname-file
(function).
pathname-mime
(function).
pathname-mime-encoding
(function).
pathname-mime-type
(function).
with-open-magic
(macro).
%boolean-from-lisp
(function).
%boolean-to-lisp
(function).
%database-funcall
(macro).
%magic-c-to-lisp
(function).
%magic-cookie
(generic reader).
(setf %magic-cookie)
(generic writer).
%magic-error-reporter
(function).
%magic-lisp-to-c
(function).
%pathlist-to-cstring
(function).
%pathname-concat
(function).
%truename
(function).
%var-accessor-*errno*
(function).
(setf %var-accessor-*errno*)
(function).
*errno*
(symbol macro).
magic-verify-version
(function).
magic-version
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Default magic database files. It can be NIL(default), or a designator for a non-empty list of pathname designators. NIL means the default database files defined by libmagic.
Opens the magic cookie MAGIC, executes BODY and close MAGIC.
FLAGS:
A list of keywords (see types), defaulted to (:none).
MAGICFILES:
NIL, or a list of pathname designators for the database files.
Defaulted to NIL, which uses the default database available in the system. This covers the most usage.
Returns a textual description of the contents of the STRING argument. An error of type MAGIC-ERROR is signaled on failure.
Checks the validity of database files. PATHNAME-LIST is NIL(default), which means use *MAGIC-DATABASE*, or a designator for a non-empty list of pathname designators. Returns ’true’ on success and signals an error of type MAGIC-ERROR on failure.
Closes the magic database and deallocates any resources used. It is permissible to close an already closed magic, and has no effect. Returns ’true’ if an open magic cookie has been closed, or ’false’ if the magic cookie is already closed.
Compiles database files. PATHNAME-LIST is NIL(default), which means use *MAGIC-DATABASE*, or a designator for a non-empty list of pathname designators. Returns ’true’ on success and signals an error of type MAGIC-ERROR on failure. The compiled files created are named from the basename(1) of each file argument with ‘.mgc’ appended to it.
Signals an error of type MAGIC-ERROR.
Returns a textual description of the contents of the PATHSPEC argument. PATHSPEC is a pathname designator. An error of type MAGIC-ERROR is signaled on failure.
Loads database files. PATHNAME-LIST is NIL(default), which means use *MAGIC-DATABASE*, or a designator for a non-empty list of pathname designators. Returns ’true’ on success and signals an error of type MAGIC-ERROR on failure.
Creates a magic cookie and returns it. An error of type SIMPLE-ERROR is signaled on failure. FLAGS specifies how the other magic functions should behave. See README for the flags usage.
Sets the magic flags. Signals an error of type SIMPLE-ERROR on systems that don’t support utime(2), or utimes(2) when :PRESERVE-ATIME is set; otherwise, returns ’true’.
Returns ’true’ if object is of type MAGIC; otherwise, returns ’false’. It is unaffected by whether object, if it is a magic, is open or closed.
Returns ’true’ if MAGIC is open; otherwise, returns ’false’.
Return the Apple creator/type
Return a /-separated list of extensions. This is NOT about the file name extensions (such as .png).
Returns a description, as in unix ‘file‘ command
Return the MIME type
Return the MIME encoding
Return the MIME type
magic-error
)) ¶magic-error
)) ¶Consists of errors that are related to MAGICFFI.
Use the function MAGIC-ERROR to signal it. The error number and error
string are accessed by the functions MAGIC-ERROR-ERRNO and
MAGIC-ERROR-ERROR.
The magic_version() command returns the version number of this library which is compiled into the shared library using the constant MAGIC_VERSION from <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.
Jump to: | %
(
F G M O P W |
---|
Jump to: | %
(
F G M O P W |
---|
Jump to: | %
*
C S |
---|
Jump to: | %
*
C S |
---|
Jump to: | A C F G M P S T |
---|
Jump to: | A C F G M P S T |
---|