


IMFILEQFORMAT(3IM)     SDSC IMAGE LIBRARY      IMFILEQFORMAT(3IM)



NAME
     ImFileQFormat, ImFileQFFormat - query file's image format

SYNOPSIS
     #include "im.h"

     char *ImFileQFormat( fd, fileName )
          int fd;
          char *fileName;

     char *ImFileQFFormat( fp, fileName )
          FILE *fp;
          char *fileName;


DESCRIPTION
     ImFileQFormat and ImFileQFFormat determine  the  image  file
     format  in  use  by the stream selected by _f_d or _f_p, respec-
     tively.  The name of the format is returned.

NOTES
     If the stream is a pipe or device,  or  a  file  opened  for
     writing,  the stream is left untouched with no data read in.
     The input's image file format is determined by matching  the
     _f_i_l_e_N_a_m_e  extension  (characters after the last "." in name)
     against a list of formats supported by  the  image  library.
     If no match is found, a NULL character string is returned by
     both functions.

     If the stream is a file opened for reading, data is read  in
     and checked against a list of magic numbers for formats sup-
     ported by the image library.  If  no  match  is  found,  the
     _f_i_l_e_N_a_m_e  extension  is  checked,  as above.  If no match is
     found here either, a NULL character string  is  returned  by
     both  functions.   In any case, the stream is reset to point
     to the first byte of the file.

     If a match is found, a character pointer to the name of  the
     matched  image  file  format  is  returned as the function's
     value.  The returned pointer points to internal table  space
     that should not be modified by the user.

RETURNS
     Upon success, the name of the format used by the  stream  is
     returned.   On failure, a NULL character pointer is returned
     and IImErrNo set to

          IMESYS      System call error
          IMEFORMAT   Unknown image file format

SEE ALSO
     ImIntro  (3IM),  ImErrNo  (3IM),  ImFileFormatEquivs  (3IM),



SDSC             Last change: September 24, 1991                1






IMFILEQFORMAT(3IM)     SDSC IMAGE LIBRARY      IMFILEQFORMAT(3IM)



     ImFileFormatOptions  (3IM),  ImFileFRead (3IM), ImFileFWrite
     (3IM), ImFileQNFormat (3IM), ImFileRead  (3IM),  ImFileWrite
     (3IM)

AUTHOR
     Dave Nadeau
     San Diego Supercomputer Center

CONTACT
     SDSC consultants, (619)534-5100, consult@y1.sdsc.edu













































2                Last change: September 24, 1991             SDSC



