home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 73 65 63 74 69 6f 6e | 7b 53 74 61 6e 64 61 72 |\section|{Standar|
|00000010| 64 20 4d 6f 64 75 6c 65 | 20 5c 73 65 63 74 63 6f |d Module| \sectco|
|00000020| 64 65 7b 6d 69 6d 65 74 | 6f 6f 6c 73 7d 7d 0a 5c |de{mimet|ools}}.\|
|00000030| 73 74 6d 6f 64 69 6e 64 | 65 78 7b 6d 69 6d 65 74 |stmodind|ex{mimet|
|00000040| 6f 6f 6c 73 7d 0a 0a 5c | 72 65 6e 65 77 63 6f 6d |ools}..\|renewcom|
|00000050| 6d 61 6e 64 7b 5c 69 6e | 64 65 78 73 75 62 69 74 |mand{\in|dexsubit|
|00000060| 65 6d 7d 7b 28 69 6e 20 | 6d 6f 64 75 6c 65 20 6d |em}{(in |module m|
|00000070| 69 6d 65 74 6f 6f 6c 73 | 29 7d 0a 0a 54 68 69 73 |imetools|)}..This|
|00000080| 20 6d 6f 64 75 6c 65 20 | 64 65 66 69 6e 65 73 20 | module |defines |
|00000090| 61 20 73 75 62 63 6c 61 | 73 73 20 6f 66 20 74 68 |a subcla|ss of th|
|000000a0| 65 20 63 6c 61 73 73 20 | 5c 63 6f 64 65 7b 72 66 |e class |\code{rf|
|000000b0| 63 38 32 32 2e 4d 65 73 | 73 61 67 65 7d 20 61 6e |c822.Mes|sage} an|
|000000c0| 64 0a 61 20 6e 75 6d 62 | 65 72 20 6f 66 20 75 74 |d.a numb|er of ut|
|000000d0| 69 6c 69 74 79 20 66 75 | 6e 63 74 69 6f 6e 73 20 |ility fu|nctions |
|000000e0| 74 68 61 74 20 61 72 65 | 20 75 73 65 66 75 6c 20 |that are| useful |
|000000f0| 66 6f 72 20 74 68 65 20 | 6d 61 6e 69 70 75 6c 61 |for the |manipula|
|00000100| 74 69 6f 6e 20 66 6f 72 | 0a 4d 49 4d 45 20 73 74 |tion for|.MIME st|
|00000110| 79 6c 65 20 6d 75 6c 74 | 69 70 61 72 74 20 6f 72 |yle mult|ipart or|
|00000120| 20 65 6e 63 6f 64 65 64 | 20 6d 65 73 73 61 67 65 | encoded| message|
|00000130| 2e 0a 0a 49 74 20 64 65 | 66 69 6e 65 73 20 74 68 |...It de|fines th|
|00000140| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 69 74 65 6d |e follow|ing item|
|00000150| 73 3a 0a 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |s:..\beg|in{funcd|
|00000160| 65 73 63 7d 7b 4d 65 73 | 73 61 67 65 7d 7b 66 70 |esc}{Mes|sage}{fp|
|00000170| 7d 0a 52 65 74 75 72 6e | 20 61 20 6e 65 77 20 69 |}.Return| a new i|
|00000180| 6e 73 74 61 6e 63 65 20 | 6f 66 20 74 68 65 20 5c |nstance |of the \|
|00000190| 63 6f 64 65 7b 6d 69 6d | 65 74 6f 6f 6c 73 2e 4d |code{mim|etools.M|
|000001a0| 65 73 73 61 67 65 7d 20 | 63 6c 61 73 73 2e 20 20 |essage} |class. |
|000001b0| 54 68 69 73 20 69 73 0a | 61 20 73 75 62 63 6c 61 |This is.|a subcla|
|000001c0| 73 73 20 6f 66 20 74 68 | 65 20 5c 63 6f 64 65 7b |ss of th|e \code{|
|000001d0| 72 66 63 38 32 32 2e 4d | 65 73 73 61 67 65 7d 20 |rfc822.M|essage} |
|000001e0| 63 6c 61 73 73 2c 20 77 | 69 74 68 20 73 6f 6d 65 |class, w|ith some|
|000001f0| 20 61 64 64 69 74 69 6f | 6e 61 6c 0a 6d 65 74 68 | additio|nal.meth|
|00000200| 6f 64 73 20 28 73 65 65 | 20 62 65 6c 6f 77 29 2e |ods (see| below).|
|00000210| 0a 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0a |.\end{fu|ncdesc}.|
|00000220| 0a 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00000230| 7d 7b 63 68 6f 6f 73 65 | 5f 62 6f 75 6e 64 61 72 |}{choose|_boundar|
|00000240| 79 7d 7b 7d 0a 52 65 74 | 75 72 6e 20 61 20 75 6e |y}{}.Ret|urn a un|
|00000250| 69 71 75 65 20 73 74 72 | 69 6e 67 20 74 68 61 74 |ique str|ing that|
|00000260| 20 68 61 73 20 61 20 68 | 69 67 68 20 6c 69 6b 65 | has a h|igh like|
|00000270| 6c 69 68 6f 6f 64 20 6f | 66 20 62 65 69 6e 67 20 |lihood o|f being |
|00000280| 75 73 61 62 6c 65 20 61 | 73 20 61 0a 70 61 72 74 |usable a|s a.part|
|00000290| 20 62 6f 75 6e 64 61 72 | 79 2e 20 20 54 68 65 20 | boundar|y. The |
|000002a0| 73 74 72 69 6e 67 20 68 | 61 73 20 74 68 65 20 66 |string h|as the f|
|000002b0| 6f 72 6d 0a 5c 63 6f 64 | 65 7b 22 5c 76 61 72 7b |orm.\cod|e{"\var{|
|000002c0| 68 6f 73 74 69 70 61 64 | 64 72 7d 2e 5c 76 61 72 |hostipad|dr}.\var|
|000002d0| 7b 75 69 64 7d 2e 5c 76 | 61 72 7b 70 69 64 7d 2e |{uid}.\v|ar{pid}.|
|000002e0| 5c 76 61 72 7b 74 69 6d | 65 73 74 61 6d 70 7d 2e |\var{tim|estamp}.|
|000002f0| 5c 76 61 72 7b 72 61 6e | 64 6f 6d 7d 22 7d 2e 0a |\var{ran|dom}"}..|
|00000300| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0a 0a |\end{fun|cdesc}..|
|00000310| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|00000320| 7b 64 65 63 6f 64 65 7d | 7b 69 6e 70 75 74 5c 2c |{decode}|{input\,|
|00000330| 20 6f 75 74 70 75 74 5c | 2c 20 65 6e 63 6f 64 69 | output\|, encodi|
|00000340| 6e 67 7d 0a 52 65 61 64 | 20 64 61 74 61 20 65 6e |ng}.Read| data en|
|00000350| 63 6f 64 65 64 20 75 73 | 69 6e 67 20 74 68 65 20 |coded us|ing the |
|00000360| 61 6c 6c 6f 77 65 64 20 | 4d 49 4d 45 20 5c 76 61 |allowed |MIME \va|
|00000370| 72 7b 65 6e 63 6f 64 69 | 6e 67 7d 20 66 72 6f 6d |r{encodi|ng} from|
|00000380| 20 6f 70 65 6e 20 66 69 | 6c 65 0a 6f 62 6a 65 63 | open fi|le.objec|
|00000390| 74 20 5c 76 61 72 7b 69 | 6e 70 75 74 7d 20 61 6e |t \var{i|nput} an|
|000003a0| 64 20 77 72 69 74 65 20 | 74 68 65 20 64 65 63 6f |d write |the deco|
|000003b0| 64 65 64 20 64 61 74 61 | 20 74 6f 20 6f 70 65 6e |ded data| to open|
|000003c0| 20 66 69 6c 65 20 6f 62 | 6a 65 63 74 0a 5c 76 61 | file ob|ject.\va|
|000003d0| 72 7b 6f 75 74 70 75 74 | 7d 2e 20 20 56 61 6c 69 |r{output|}. Vali|
|000003e0| 64 20 76 61 6c 75 65 73 | 20 66 6f 72 20 5c 76 61 |d values| for \va|
|000003f0| 72 7b 65 6e 63 6f 64 69 | 6e 67 7d 20 69 6e 63 6c |r{encodi|ng} incl|
|00000400| 75 64 65 0a 5c 63 6f 64 | 65 7b 22 62 61 73 65 36 |ude.\cod|e{"base6|
|00000410| 34 22 7d 2c 20 5c 63 6f | 64 65 7b 22 71 75 6f 74 |4"}, \co|de{"quot|
|00000420| 65 64 2d 70 72 69 6e 74 | 61 62 6c 65 22 7d 20 61 |ed-print|able"} a|
|00000430| 6e 64 20 5c 63 6f 64 65 | 7b 22 75 75 65 6e 63 6f |nd \code|{"uuenco|
|00000440| 64 65 22 7d 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 |de"}..\e|nd{funcd|
|00000450| 65 73 63 7d 0a 0a 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00000460| 63 64 65 73 63 7d 7b 65 | 6e 63 6f 64 65 7d 7b 69 |cdesc}{e|ncode}{i|
|00000470| 6e 70 75 74 5c 2c 20 6f | 75 74 70 75 74 5c 2c 20 |nput\, o|utput\, |
|00000480| 65 6e 63 6f 64 69 6e 67 | 7d 0a 52 65 61 64 20 64 |encoding|}.Read d|
|00000490| 61 74 61 20 66 72 6f 6d | 20 6f 70 65 6e 20 66 69 |ata from| open fi|
|000004a0| 6c 65 20 6f 62 6a 65 63 | 74 20 5c 76 61 72 7b 69 |le objec|t \var{i|
|000004b0| 6e 70 75 74 7d 20 61 6e | 64 20 77 72 69 74 65 20 |nput} an|d write |
|000004c0| 69 74 20 65 6e 63 6f 64 | 65 64 20 75 73 69 6e 67 |it encod|ed using|
|000004d0| 0a 74 68 65 20 61 6c 6c | 6f 77 65 64 20 4d 49 4d |.the all|owed MIM|
|000004e0| 45 20 5c 76 61 72 7b 65 | 6e 63 6f 64 69 6e 67 7d |E \var{e|ncoding}|
|000004f0| 20 74 6f 20 6f 70 65 6e | 20 66 69 6c 65 20 6f 62 | to open| file ob|
|00000500| 6a 65 63 74 20 5c 76 61 | 72 7b 6f 75 74 70 75 74 |ject \va|r{output|
|00000510| 7d 2e 0a 56 61 6c 69 64 | 20 76 61 6c 75 65 73 20 |}..Valid| values |
|00000520| 66 6f 72 20 5c 76 61 72 | 7b 65 6e 63 6f 64 69 6e |for \var|{encodin|
|00000530| 67 7d 20 61 72 65 20 74 | 68 65 20 73 61 6d 65 20 |g} are t|he same |
|00000540| 61 73 20 66 6f 72 20 5c | 63 6f 64 65 7b 64 65 63 |as for \|code{dec|
|00000550| 6f 64 65 28 29 7d 2e 0a | 5c 65 6e 64 7b 66 75 6e |ode()}..|\end{fun|
|00000560| 63 64 65 73 63 7d 0a 0a | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|00000570| 75 6e 63 64 65 73 63 7d | 7b 63 6f 70 79 6c 69 74 |uncdesc}|{copylit|
|00000580| 65 72 61 6c 7d 7b 69 6e | 70 75 74 5c 2c 20 6f 75 |eral}{in|put\, ou|
|00000590| 74 70 75 74 7d 0a 52 65 | 61 64 20 6c 69 6e 65 73 |tput}.Re|ad lines|
|000005a0| 20 75 6e 74 69 6c 20 45 | 4f 46 20 66 72 6f 6d 20 | until E|OF from |
|000005b0| 6f 70 65 6e 20 66 69 6c | 65 20 5c 76 61 72 7b 69 |open fil|e \var{i|
|000005c0| 6e 70 75 74 7d 20 61 6e | 64 20 77 72 69 74 65 20 |nput} an|d write |
|000005d0| 74 68 65 6d 20 74 6f 20 | 6f 70 65 6e 0a 66 69 6c |them to |open.fil|
|000005e0| 65 20 5c 76 61 72 7b 6f | 75 74 70 75 74 7d 2e 0a |e \var{o|utput}..|
|000005f0| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0a 0a |\end{fun|cdesc}..|
|00000600| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|00000610| 7b 63 6f 70 79 62 69 6e | 61 72 79 7d 7b 69 6e 70 |{copybin|ary}{inp|
|00000620| 75 74 5c 2c 20 6f 75 74 | 70 75 74 7d 0a 52 65 61 |ut\, out|put}.Rea|
|00000630| 64 20 62 6c 6f 63 6b 73 | 20 75 6e 74 69 6c 20 45 |d blocks| until E|
|00000640| 4f 46 20 66 72 6f 6d 20 | 6f 70 65 6e 20 66 69 6c |OF from |open fil|
|00000650| 65 20 5c 76 61 72 7b 69 | 6e 70 75 74 7d 20 61 6e |e \var{i|nput} an|
|00000660| 64 20 77 72 69 74 65 20 | 74 68 65 6d 20 74 6f 20 |d write |them to |
|00000670| 6f 70 65 6e 0a 66 69 6c | 65 20 5c 76 61 72 7b 6f |open.fil|e \var{o|
|00000680| 75 74 70 75 74 7d 2e 20 | 20 54 68 65 20 62 6c 6f |utput}. | The blo|
|00000690| 63 6b 20 73 69 7a 65 20 | 69 73 20 63 75 72 72 65 |ck size |is curre|
|000006a0| 6e 74 6c 79 20 66 69 78 | 65 64 20 61 74 20 38 31 |ntly fix|ed at 81|
|000006b0| 39 32 2e 0a 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |92..\end|{funcdes|
|000006c0| 63 7d 0a 0a 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |c}...\su|bsection|
|000006d0| 7b 41 64 64 69 74 69 6f | 6e 61 6c 20 4d 65 74 68 |{Additio|nal Meth|
|000006e0| 6f 64 73 20 6f 66 20 4d | 65 73 73 61 67 65 20 6f |ods of M|essage o|
|000006f0| 62 6a 65 63 74 73 7d 0a | 5c 6e 6f 64 65 6e 61 6d |bjects}.|\nodenam|
|00000700| 65 7b 6d 69 6d 65 74 6f | 6f 6c 73 2e 4d 65 73 73 |e{mimeto|ols.Mess|
|00000710| 61 67 65 20 4d 65 74 68 | 6f 64 73 7d 0a 0a 54 68 |age Meth|ods}..Th|
|00000720| 65 20 5c 63 6f 64 65 7b | 6d 69 6d 65 74 6f 6f 6c |e \code{|mimetool|
|00000730| 73 2e 4d 65 73 73 61 67 | 65 7d 20 63 6c 61 73 73 |s.Messag|e} class|
|00000740| 20 64 65 66 69 6e 65 73 | 20 74 68 65 20 66 6f 6c | defines| the fol|
|00000750| 6c 6f 77 69 6e 67 20 6d | 65 74 68 6f 64 73 20 69 |lowing m|ethods i|
|00000760| 6e 0a 61 64 64 69 74 69 | 6f 6e 20 74 6f 20 74 68 |n.additi|on to th|
|00000770| 65 20 5c 63 6f 64 65 7b | 72 66 63 38 32 32 2e 4d |e \code{|rfc822.M|
|00000780| 65 73 73 61 67 65 7d 20 | 63 6c 61 73 73 3a 0a 0a |essage} |class:..|
|00000790| 5c 72 65 6e 65 77 63 6f | 6d 6d 61 6e 64 7b 5c 69 |\renewco|mmand{\i|
|000007a0| 6e 64 65 78 73 75 62 69 | 74 65 6d 7d 7b 28 6d 69 |ndexsubi|tem}{(mi|
|000007b0| 6d 65 74 6f 6f 6c 2e 4d | 65 73 73 61 67 65 20 6d |metool.M|essage m|
|000007c0| 65 74 68 6f 64 29 7d 0a | 0a 5c 62 65 67 69 6e 7b |ethod)}.|.\begin{|
|000007d0| 66 75 6e 63 64 65 73 63 | 7d 7b 67 65 74 70 6c 69 |funcdesc|}{getpli|
|000007e0| 73 74 7d 7b 7d 0a 52 65 | 74 75 72 6e 20 74 68 65 |st}{}.Re|turn the|
|000007f0| 20 70 61 72 61 6d 65 74 | 65 72 20 6c 69 73 74 20 | paramet|er list |
|00000800| 6f 66 20 74 68 65 20 5c | 63 6f 64 65 7b 43 6f 6e |of the \|code{Con|
|00000810| 74 65 6e 74 2d 74 79 70 | 65 7d 20 68 65 61 64 65 |tent-typ|e} heade|
|00000820| 72 2e 20 20 54 68 69 73 | 20 69 73 0a 61 20 6c 69 |r. This| is.a li|
|00000830| 73 74 20 69 66 20 73 74 | 72 69 6e 67 73 2e 20 20 |st if st|rings. |
|00000840| 46 6f 72 20 70 61 72 61 | 6d 65 74 65 72 73 20 6f |For para|meters o|
|00000850| 66 20 74 68 65 20 66 6f | 72 6d 0a 5c 73 61 6d 70 |f the fo|rm.\samp|
|00000860| 7b 5c 76 61 72 7b 6b 65 | 79 7d 3d 5c 76 61 72 7b |{\var{ke|y}=\var{|
|00000870| 76 61 6c 75 65 7d 7d 2c | 20 5c 76 61 72 7b 6b 65 |value}},| \var{ke|
|00000880| 79 7d 20 69 73 20 63 6f | 6e 76 65 72 74 65 64 20 |y} is co|nverted |
|00000890| 74 6f 20 6c 6f 77 65 72 | 20 63 61 73 65 20 62 75 |to lower| case bu|
|000008a0| 74 0a 5c 76 61 72 7b 76 | 61 6c 75 65 7d 20 69 73 |t.\var{v|alue} is|
|000008b0| 20 6e 6f 74 2e 20 20 46 | 6f 72 20 65 78 61 6d 70 | not. F|or examp|
|000008c0| 6c 65 2c 20 69 66 20 74 | 68 65 20 6d 65 73 73 61 |le, if t|he messa|
|000008d0| 67 65 20 63 6f 6e 74 61 | 69 6e 73 20 74 68 65 20 |ge conta|ins the |
|000008e0| 68 65 61 64 65 72 0a 5c | 73 61 6d 70 7b 43 6f 6e |header.\|samp{Con|
|000008f0| 74 65 6e 74 2d 74 79 70 | 65 3a 20 74 65 78 74 2f |tent-typ|e: text/|
|00000900| 68 74 6d 6c 3b 20 73 70 | 61 6d 3d 31 3b 20 53 70 |html; sp|am=1; Sp|
|00000910| 61 6d 3d 32 3b 20 53 70 | 61 6d 7d 20 74 68 65 6e |am=2; Sp|am} then|
|00000920| 0a 5c 63 6f 64 65 7b 67 | 65 74 70 6c 69 73 74 28 |.\code{g|etplist(|
|00000930| 29 7d 20 77 69 6c 6c 20 | 72 65 74 75 72 6e 20 74 |)} will |return t|
|00000940| 68 65 20 50 79 74 68 6f | 6e 20 6c 69 73 74 20 5c |he Pytho|n list \|
|00000950| 63 6f 64 65 7b 5b 27 73 | 70 61 6d 3d 31 27 2c 0a |code{['s|pam=1',.|
|00000960| 27 73 70 61 6d 3d 32 27 | 2c 20 27 53 70 61 6d 27 |'spam=2'|, 'Spam'|
|00000970| 5d 7d 2e 0a 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |]}..\end|{funcdes|
|00000980| 63 7d 0a 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00000990| 65 73 63 7d 7b 67 65 74 | 70 61 72 61 6d 7d 7b 6e |esc}{get|param}{n|
|000009a0| 61 6d 65 7d 0a 52 65 74 | 75 72 6e 20 74 68 65 20 |ame}.Ret|urn the |
|000009b0| 5c 76 61 72 7b 76 61 6c | 75 65 7d 20 6f 66 20 74 |\var{val|ue} of t|
|000009c0| 68 65 20 66 69 72 73 74 | 20 70 61 72 61 6d 65 74 |he first| paramet|
|000009d0| 65 72 20 28 61 73 20 72 | 65 74 75 72 6e 65 64 20 |er (as r|eturned |
|000009e0| 62 79 0a 5c 63 6f 64 65 | 7b 67 65 74 70 6c 69 73 |by.\code|{getplis|
|000009f0| 74 28 29 7d 20 6f 66 20 | 74 68 65 20 66 6f 72 6d |t()} of |the form|
|00000a00| 20 5c 73 61 6d 70 7b 5c | 76 61 72 7b 6e 61 6d 65 | \samp{\|var{name|
|00000a10| 7d 3d 5c 76 61 72 7b 76 | 61 6c 75 65 7d 7d 20 66 |}=\var{v|alue}} f|
|00000a20| 6f 72 20 74 68 65 0a 67 | 69 76 65 6e 20 5c 76 61 |or the.g|iven \va|
|00000a30| 72 7b 6e 61 6d 65 7d 2e | 20 20 49 66 20 5c 76 61 |r{name}.| If \va|
|00000a40| 72 7b 76 61 6c 75 65 7d | 20 69 73 20 73 75 72 72 |r{value}| is surr|
|00000a50| 6f 75 6e 64 65 64 20 62 | 79 20 71 75 6f 74 65 73 |ounded b|y quotes|
|00000a60| 20 6f 66 20 74 68 65 20 | 66 6f 72 6d 0a 5c 76 61 | of the |form.\va|
|00000a70| 72 7b 3c 2e 2e 2e 3e 7d | 20 6f 72 20 5c 76 61 72 |r{<...>}| or \var|
|00000a80| 7b 22 2e 2e 2e 22 7d 2c | 20 74 68 65 73 65 20 61 |{"..."},| these a|
|00000a90| 72 65 20 72 65 6d 6f 76 | 65 64 2e 0a 5c 65 6e 64 |re remov|ed..\end|
|00000aa0| 7b 66 75 6e 63 64 65 73 | 63 7d 0a 0a 5c 62 65 67 |{funcdes|c}..\beg|
|00000ab0| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 67 65 74 |in{funcd|esc}{get|
|00000ac0| 65 6e 63 6f 64 69 6e 67 | 7d 7b 7d 0a 52 65 74 75 |encoding|}{}.Retu|
|00000ad0| 72 6e 20 74 68 65 20 65 | 6e 63 6f 64 69 6e 67 20 |rn the e|ncoding |
|00000ae0| 73 70 65 63 69 66 69 65 | 64 20 69 6e 20 74 68 65 |specifie|d in the|
|00000af0| 20 5c 73 61 6d 70 7b 43 | 6f 6e 74 65 6e 74 2d 74 | \samp{C|ontent-t|
|00000b00| 72 61 6e 73 66 65 72 2d | 65 6e 63 6f 64 69 6e 67 |ransfer-|encoding|
|00000b10| 7d 0a 6d 65 73 73 61 67 | 65 20 68 65 61 64 65 72 |}.messag|e header|
|00000b20| 2e 20 20 49 66 20 6e 6f | 20 73 75 63 68 20 68 65 |. If no| such he|
|00000b30| 61 64 65 72 20 65 78 69 | 73 74 73 2c 20 72 65 74 |ader exi|sts, ret|
|00000b40| 75 72 6e 20 5c 63 6f 64 | 65 7b 22 37 62 69 74 22 |urn \cod|e{"7bit"|
|00000b50| 7d 2e 20 20 54 68 65 0a | 65 6e 63 6f 64 69 6e 67 |}. The.|encoding|
|00000b60| 20 69 73 20 63 6f 6e 76 | 65 72 74 65 64 20 74 6f | is conv|erted to|
|00000b70| 20 6c 6f 77 65 72 20 63 | 61 73 65 2e 0a 5c 65 6e | lower c|ase..\en|
|00000b80| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0a 0a 5c 62 65 |d{funcde|sc}..\be|
|00000b90| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 67 65 |gin{func|desc}{ge|
|00000ba0| 74 74 79 70 65 7d 7b 7d | 0a 52 65 74 75 72 6e 20 |ttype}{}|.Return |
|00000bb0| 74 68 65 20 6d 65 73 73 | 61 67 65 20 74 79 70 65 |the mess|age type|
|00000bc0| 20 28 6f 66 20 74 68 65 | 20 66 6f 72 6d 20 5c 73 | (of the| form \s|
|00000bd0| 61 6d 70 7b 5c 76 61 72 | 7b 74 79 70 65 7d 2f 76 |amp{\var|{type}/v|
|00000be0| 61 72 7b 73 75 62 74 79 | 70 65 7d 7d 29 0a 61 73 |ar{subty|pe}}).as|
|00000bf0| 20 73 70 65 63 69 66 69 | 65 64 20 69 6e 20 74 68 | specifi|ed in th|
|00000c00| 65 20 5c 73 61 6d 70 7b | 43 6f 6e 74 65 6e 74 2d |e \samp{|Content-|
|00000c10| 74 79 70 65 7d 20 68 65 | 61 64 65 72 2e 20 20 49 |type} he|ader. I|
|00000c20| 66 20 6e 6f 20 73 75 63 | 68 20 68 65 61 64 65 72 |f no suc|h header|
|00000c30| 0a 65 78 69 73 74 73 2c | 20 72 65 74 75 72 6e 20 |.exists,| return |
|00000c40| 5c 63 6f 64 65 7b 22 74 | 65 78 74 2f 70 6c 61 69 |\code{"t|ext/plai|
|00000c50| 6e 22 7d 2e 20 20 54 68 | 65 20 74 79 70 65 20 69 |n"}. Th|e type i|
|00000c60| 73 20 63 6f 6e 76 65 72 | 74 65 64 20 74 6f 20 6c |s conver|ted to l|
|00000c70| 6f 77 65 72 0a 63 61 73 | 65 2e 0a 5c 65 6e 64 7b |ower.cas|e..\end{|
|00000c80| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|00000c90| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 67 65 74 6d |n{funcde|sc}{getm|
|00000ca0| 61 69 6e 74 79 70 65 7d | 7b 7d 0a 52 65 74 75 72 |aintype}|{}.Retur|
|00000cb0| 6e 20 74 68 65 20 6d 61 | 69 6e 20 74 79 70 65 20 |n the ma|in type |
|00000cc0| 61 73 20 73 70 65 63 69 | 66 69 65 64 20 69 6e 20 |as speci|fied in |
|00000cd0| 74 68 65 20 5c 73 61 6d | 70 7b 43 6f 6e 74 65 6e |the \sam|p{Conten|
|00000ce0| 74 2d 74 79 70 65 7d 20 | 68 65 61 64 65 72 2e 0a |t-type} |header..|
|00000cf0| 49 66 20 6e 6f 20 73 75 | 63 68 20 68 65 61 64 65 |If no su|ch heade|
|00000d00| 72 20 65 78 69 73 74 73 | 2c 20 72 65 74 75 72 6e |r exists|, return|
|00000d10| 20 5c 63 6f 64 65 7b 22 | 74 65 78 74 22 7d 2e 20 | \code{"|text"}. |
|00000d20| 20 54 68 65 20 6d 61 69 | 6e 20 74 79 70 65 20 69 | The mai|n type i|
|00000d30| 73 0a 63 6f 6e 76 65 72 | 74 65 64 20 74 6f 20 6c |s.conver|ted to l|
|00000d40| 6f 77 65 72 20 63 61 73 | 65 2e 0a 5c 65 6e 64 7b |ower cas|e..\end{|
|00000d50| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|00000d60| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 67 65 74 73 |n{funcde|sc}{gets|
|00000d70| 75 62 74 79 70 65 7d 7b | 7d 0a 52 65 74 75 72 6e |ubtype}{|}.Return|
|00000d80| 20 74 68 65 20 73 75 62 | 74 79 70 65 20 61 73 20 | the sub|type as |
|00000d90| 73 70 65 63 69 66 69 65 | 64 20 69 6e 20 74 68 65 |specifie|d in the|
|00000da0| 20 5c 73 61 6d 70 7b 43 | 6f 6e 74 65 6e 74 2d 74 | \samp{C|ontent-t|
|00000db0| 79 70 65 7d 20 68 65 61 | 64 65 72 2e 20 20 49 66 |ype} hea|der. If|
|00000dc0| 0a 6e 6f 20 73 75 63 68 | 20 68 65 61 64 65 72 20 |.no such| header |
|00000dd0| 65 78 69 73 74 73 2c 20 | 72 65 74 75 72 6e 20 5c |exists, |return \|
|00000de0| 63 6f 64 65 7b 22 70 6c | 61 69 6e 22 7d 2e 20 20 |code{"pl|ain"}. |
|00000df0| 54 68 65 20 73 75 62 74 | 79 70 65 20 69 73 0a 63 |The subt|ype is.c|
|00000e00| 6f 6e 76 65 72 74 65 64 | 20 74 6f 20 6c 6f 77 65 |onverted| to lowe|
|00000e10| 72 20 63 61 73 65 2e 0a | 5c 65 6e 64 7b 66 75 6e |r case..|\end{fun|
|00000e20| 63 64 65 73 63 7d 0a | |cdesc}. | |
+--------+-------------------------+-------------------------+--------+--------+