"Fossies" - the Fresh Open Source Software Archive

Member "FILETYPE.PM" (13 Feb 1998, 3861 Bytes) of package /windows/mail/pegasus/winpmail/w16-312b.exe:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 ;
    2 ;  Pegasus Mail System,
    3 ;  Copyright (c) 1990-97, David Harris, All Rights Reserved.
    4 ;
    5 ;  File Typing Rules
    6 ;
    7 ;  This file is used by Pegasus Mail to determine the "attachment type"
    8 ;  information for files automatically. It consists of rules that can
    9 ;  test a file's extension and any byte or strings in the first 512
   10 ;  bytes of the file. Each line contains the complete set of rules for
   11 ;  a single type of file, in the following format:
   12 ;
   13 ;     <file type>,<match type>,<operation>[,<operation>...]
   14 ;
   15 ;     "file type" is the WinPMail "attachment type" string that
   16 ;         should be used if a file matches this rule.
   17 ;
   18 ;     "match type" is one of the following values:
   19 ;         0 : Match is good if any operation succeeds
   20 ;         1 : Match is only good if all operations succeed
   21 ;
   22 ;     "operation" is one or more groups of three parameters in
   23 ;     the following format:
   24 ;         <opcode>,<offset>,<string>
   25 ;             "opcode" is one of the following characters:
   26 ;                 X : match the file's extension
   27 ;                 B : match the single byte contained in "string"
   28 ;                     at offset "offset" in the file
   29 ;                 S : match the string contained in "string" starting
   30 ;                     at offset "offset" in the file
   31 ;                 R : match the string contained in "string" anywhere
   32 ;                     in the first 512 bytes of the file
   33 ;             "offset" is the offset to start matching in the file. When
   34 ;                 "operation" is either X or R, it should be set to 0
   35 ;             "string" is the string or byte to match. It can be ASCII
   36 ;                 characters, or escapes in the form "\xxx", where "xxx"
   37 ;                 is exactly three decimal characters.
   38 ;
   39 ;   Examples:
   40 ;      MS-Word,0,X,0,.DOC
   41 ;         - Returns "MS-Word" if the file's extension is ".DOC".
   42 ;
   43 ;      PGP-Public-Key,0,R,0,BEGIN PGP PUBLIC
   44 ;         - Returns "PGP-Public-Key" if the string "BEGIN PGP PUBLIC"
   45 ;           appears anywhere in the first 512 bytes of the file.
   46 ;
   47 ;     PCEXE,1,X,0,.EXE,S,0,MZ
   48 ;         - Returns "PCEXE" if the file's extension is ".EXE"
   49 ;           AND the first two characters in the file are "MZ".
   50 ;
   51 ;      ZIP-Archive,0,X,0,.ZIP,S,0,PK\003
   52 ;         - Returns "ZIP-Archive" if the file's extension is ".ZIP"
   53 ;           OR the first three characters are "PK" and an ASCII 3.
   54 ;
   55 ;  The matching process ends on the first viable match. Because of this,
   56 ;  if you have both a specific set of rules and a general set of rules
   57 ;  for any single file type, you should always place the general rules
   58 ;  after the specific rules in the file to allow more reliable matching.
   59 ;
   60 ;  The parser for this file is inflexible - you must get the format
   61 ;  right. Note in particular that whitespace is not permitted, or if it
   62 ;  is present, it is assumed to be significant. The only valid delimiter
   63 ;  in this file is a comma; the only way you can match a comma in a
   64 ;  string is by using the escape "\044".
   65 ;
   66 ;  Blank lines and lines in this file starting with ';' or '#' are
   67 ;  regarded as comments and are ignored.
   68 ;
   69 
   70 MS-Word,1,S,0,\219\165\045
   71 PCEXE,1,X,0,.EXE,S,0,MZ
   72 PCEXE,1,X,0,.DLL,S,0,MZ
   73 ZIP-archive,0,X,0,.ZIP,S,0,PK\003
   74 MS-Richtext,0,X,0,.RTF,S,0,{\092rtf
   75 Program-source,0,X,0,.C,X,0,.H,X,0,.PAS,X,0,.RC,X,0,.CPP,X,0,.BAS,X,0,.ASM
   76 GIF-image,0,X,0,.GIF,S,0,GIF
   77 JPEG-image,0,X,0,.JPG,S,6,JFIF
   78 BMP-image,0,X,0,.BMP,X,0,.DIB,S,0,BM
   79 WAV-sound-file,1,S,0,RIFF,S,8,WAVE
   80 WAV-sound-file,0,X,0,.WAV
   81 WordPerfect,0,S,1,WPC
   82 Excel-sheet,0,X,0,.XLS
   83 Excel-chart,0,X,0,.XLC
   84 MS-Access,0,X,0,.MDB
   85 AVI-Movie,1,S,0,RIFF,S,8,AVI
   86 AVI-Movie,0,X,0,.AVI
   87 Windows-help,1,X,0,.HLP,S,0,?_\003
   88 HTML-text,0,X,0,.HTM
   89 HTML-text,1,S,0,<HTML>
   90 PGP-Public-Key,0,R,0,BEGIN PGP PUBLIC
   91 PGP-encrypted,0,X,0,.PGP
   92 Text,0,X,0,.TXT
   93