Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ notmagic(3C) — UTek W2.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ex(1)

file(1)

ERROR(3c)

magic(5)



NOTMAGIC(3C)            COMMAND REFERENCE            NOTMAGIC(3C)



NAME
     notmagic - interface to magic number file

SYNOPSIS
     int notmagic (lowbyte, highbyte)
     char lowbyte, highbyte;

DESCRIPTION
     The file /usr/lib/magic contains a list of magic numbers
     which describe various special files such as object files,
     compacted data files, and archives.  The subroutine notmagic
     gets the magic numbers for files that are definitely not
     text files, and compares them against the combination of
     lowbyte and highbyte to see if the file is not a text file.

     The normal way to use notmagic is to read the first two
     bytes of the file and give them to notmagic in the proper
     order for your system's byte ordering.

     The first time notmagic is called, a table is built from the
     magic number file. This table is saved for further calls to
     notmagic.

     See RETURN VALUE for the meaning of the return values.

FILES
     /usr/lib/magic           The file containing magic number
                              information.

RETURN VALUE
     The possible return values from notmagic are:

     0    If the characters given match a magic number.

     1    If the characters given do not match a magic number.

     -1   If the magic number file cannot be opened. In this
          case, the subroutine ERROR(3c) should be called with an
          exit code of P_ERR or P_WARN.

     -2   If the magic number descriptions contain obvious
          errors. The command file(1) should be used to diagnose
          the problem.

CAVEATS
     The only information taken from the magic number file is
     from lines whose magic numbers are not of type string, and
     only those lines which begin with a 0.

     The characters given to notmagic are expected to be the
     first two characters in the file.




Printed 10/17/86                                                1





NOTMAGIC(3C)            COMMAND REFERENCE            NOTMAGIC(3C)



     Due to some special restrictions, the programs in the ex
     editor family (which includes vi) use a special version of
     notmagic which can only handle up to 300 magic numbers of
     type long and/or short.

SEE ALSO
     ex(1), file(1), ERROR(3c), magic(5).
















































Printed 10/17/86                                                2





































































%%index%%
na:72,77;
sy:149,425;
de:574,1129;
fi:1703,165;
rv:1868,640;
ca:2508,382;3034,291;
se:3325,180;
%%index%%000000000129

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026