ÿØÿà JFIF    ÿÛ „ !.%+&8&+/1555$;@;4?.451 4,$,44444444444414444444444444444444444444444444444444ÿÀ  á á" ÿÄ     ÿÄ ?    !1AQaq"2‘¡±ÁðBRbrÑá#‚’¢²3S CñÿÄ   ÿÄ !    !1QAa‘2ÿÚ   ? 5˜Z¯V¦cø)›t/? z¨±>Õ5€¶‹Á¤·¼z¼Ü¬+ñ®v¤¨_ˆR­BFn©—˜ý®ç̝P8gýt·ÉSTŦˆìät?þé¼íìN/Þa)ì–í6ô… Ï¿øÃj´¿KÇü]ÿ ªô¹-eKànëÕHTx}ýSÜ›ÿ ”7Ø×&µ<¦  ¥ÑO¶[Ù¯ä¨ÞÃÿ PZ-¬;#õ|•oaÿ ©CìÞz3˜öː/¤­ñTûIØ}š^ mÓ%ªxˆ¥ÉŸu=Z+ISe¿45™¼u;ú&WØ÷€æßQ™®{|íx*TC“#ZŠìZ§²‹ 6pv…³¿¡äª*áZÐ%ÒOáˆo"x«OHk w±æ+¬V(kMúŸ5Vö«$ ÁrÏbàb57/luR ¸ÑÛj Òµì`Мq­û žICÀÊ•©4€Âcà¨Ï€O´<èÐ:›ù(Ë^L8þ‘ÍÌ#¸Ð_Ì©ÙK(Öz 4¬û+¸;ü’V’84‘¬ÃŽ:[â‡ÔÌáõp¢~§ªlæ£ö{®G>J¼"°‡7¯ÆÉèßû ‹É‹§ÁòÃýâßî ^ƾÙõ‹×óH#«LP½ïX=xÑÍ$|W?•~• îëÔ©ª‹ {ÝT…Kÿ ”hûâá)J*ö˜–ÔU;iÇ€/ ÆþjóZ\ýwØ=Ìm ºèËL9 ýèÆð/¨’¥öo=nË.%Îì ŽÕ¯È|{Oj²ƒE6e/ßdÄõ²Ìâ1O®ò×TsəԸhOMýíMˆ¿¼H˜l²,7Â¥#MF/Úf°Ö½± ¸–dr‹NýÊ íjqx{œÉ ä-È ¦ øÄër¨q°ð †nцýÑÄÆ’mä…n<0È™;ÁÝá¯ÁZƒ7FÀmì­ É&9ˆîéi¶ùN§Y• ÃZãAâ?•‡©‰ , ó¾IŸŠc1 4â&y­&pŠ­6;M À 0¹qç»p.á …ŸÅáK@%6·y6ƒ‰3?”úºŽ‰éX5ªPT §µ!=Mž«Ú½‹ÅgÂSâÉaþÓoö–¯ÁÔìR>5éÿ üs¶ÆUcÌ kÇR ]ÿ ù¬¼«VŽ;Â|‡~¢¦”ÏŰæ {L™Õ°Óv¹ò¸írޡעCÃ!íVÕ {¶»sŒNPg/ "uÕbkm²“$ďå¿é¹§°½æz¯6 †s¿!s–wÚÝ“™Œ °.ûj>·+™Òa…©Œ&rÝÎtÛë긪Ît’LAVp%c Úý[ÄzJ¾ÇàXXç@˜ó<êL]·T˜¾¥1Ó©V‡g´æ½¦Ý@¹óø!_@´ÞâSÁ —S3™•& ]@JHÚý©ZŽ €×æÔr»Áf!‡yÞ4Mv*èÓã_{‘åóUuљØ«Oïé*®EvÑ Œ÷‡U \"㪒ÍK+À 4“M¡ï:0¥5í!'<@î´”>Ç»&Z–ïCCV˜Ì5Šo&îhè.žû |ÓK©h$s6KìŒëã)¹hI¦GïOåóI;ììü#É$Š0…Ææ¥TØ.5­¾gn´ “ÂÖ\:hœ89G)J@„}œ:’Ò{/Š"¦_Æ×7Æ3VÇŠÊa]ÚŒÙ€Ä–=®uÁßâACZƒ§§£ Qnâ:«,×{tyø¬iÛcœÜÄ€H½ÄÍCk´÷šß .W'b¤Íåh]÷€=,Žv×cÚEÚHXJX¶îo¨FÒtèöŸ>ªª6[J®Fµ£sGÁeqõfe\íjÒÐïÄÐGˆe1Ø‹.Ø”‘Ëuø Y­ˆÜ ŽG|zùªüMpDnQWÄ”%JŠ™)â*p@Örš«ÕT2Ð%ˆG#ª„ ·¤!°ŸOTÂT¸aÚ%4&h™LµšØüÐ.F¿²ÐÞ_Ç‚¾ÅÃaÜ÷09Æ q€öy˜v‡85õN÷]¬äѼóS{°_MެúÔ#°Ç¸0åÞè2ëôPcvÆw9®ií1Ä8F™˜à‰´+‰Ik1òÝ7“Ñ×ÒsÝ\x‚h`ÞÑ`ó"|µEcý£n˜h`}GÞ !±ù²Ápü²ß6 0ïi󜵩SÈÇ7˜-ÕURO˜¦´f$ªž-Í6(œ}<„ éc øs]ŽŽ„*—¾ ìdŽ„)méª\¿êÎIg¾ØÞ~I#C/¼¼´EÁÈŽi8“©õådô·>euä ƒ'Ê×लR1ÉJE1ÐAát`t;ÇР%Ý<‡¥„ÍÆ`×Oyó)õiI€ñQaŸ4Ûù\áàaÃÔ¹HÃu¹*k€¦<„e S‡&õÏ B!ŽhüÞ`yj}mªf×\¿ Ç~æ­9‡û\՞Ǖg²1Žû5V7 !àöšm° c`ܬøÇìµÒ'P"?…´Ö,"§^•õލsÔ)6˜sæéÍR¼ ò|Sl”‹7 nPW Gòú÷½§O¯‡„l¡kSÞŒr½PÊ@æ¢pŽ-mÿ #Ÿ˜Àº¶Áä¦;ïÔæ$1££`“Õ>„—·ž)ßð³ñ#Ï Ô$¶œ‰ÊE‹À;÷º ¯«P:Ñ”8–IÊtpÞ3ª“>ê“þës4ò2OÏÕ­±zô†Õ§‰.÷ä¸;¿˜“'œ›žª}«Œ{ª±Ì 9ÔóÞÕ‡0 $íWV3Üì¬ —@kÝ4@¿r¼±½¬™›?øØæ´'Áé®CË3-g$˜ö‡×auÚi´Žp/êÛ æF›Ú2v‹ã¿¿,nB1̨ƃqÞa5͝@&Æû“él÷ \C²½UÍc ¯k×¢U ÖéQå™—-r wô ÞÏ<Ò=&=ÿ Ôê Òêˈt,i—;LîÜ á¸*ÚÃ1$êL•LÍ <É)ýÐà’ ;F™{ƒ™˜€&'}‚ãÄK`¡ÞT@I;®žZóè‚s’7®°›+§O­Åq©é»²9<Ô J ¼9O’HL»Ùïì¸rk¼Ž_ý‘TŸu[²ßÚŒ·ü÷B%¯E ŸÔX5êO´ Ç•€’I0 ÉJX` ñ¹õ%;µŸD‘«´€àwÒ™U ûئžÖö\×®×´8 ½‡ºÐÆÓ§?Àkmœ=;d5*@-ì0F Rªýš[Ü6âö̃ڸr*KA9· u*µæ£?U¸Âêí†8@¦X4 e-ò„0s{ HâUpU?¼mñRa°®a%Ð'tÉ×’\¾ÊÉ]t›h>·(Ë@R¼¡Ãt h}’O÷au<+nT…Ö…MӐ??Óe95 q>í/;&JSû °¯ÊéÞ øƒ*Ã2½Ài&:nôUl=¾¿5eˆ3”ñc|Ú2V”>„»&eE;«ÚäC p¢Û úy 9š[ŒÌx¼擼A&DåÒ¯ˆ¤ÀÌ;"˜ ÏQä¸åhÊ}Ûq«Û0WžÒ|»€ø®öCm5•\ÇÀ§Pe3£]0ÃàLDÉ‰1øªxjgwT‚÷¿LΨK‹›ùs—xˆÜ±µ kæ¸f‰‰ÜGk/LÛØ6d9ò¶ùA{ƒA3š/¬D¬khÓk‰`˜"㯒r¿±Óã jx‡°e}<Ñø\3y:'À•/h½Í€Ç4~g ?Û(¼]v‘ªlKÎâ~?O‚W%{Ì:“'©úNq¾›úo(X’¥¯ˆ nFê{Ç€ü?º'ë ø‹ì Þ09ŒÌç9Æ —ËC`j@ÓÄ(+a‹un¸#ÂꟋ{K`‘ÑÍÍ'à´»/Û,KW;Þ4²þð ï Nm|~fGÏ(…³Ã)«1ö­Õ ¥‡¨©ƒÃ™ü-s=à=U66Ï«Ýc蓦W¹íž®›nÔ%êÇìŒ<#Ü×84ån®Ð ÒåOC` ñânÑs‡¢ç 1õ%Îhì½Ã½® e:ݼUZo™`  ÅZŸŒÊ«ê1ÏÄo$q¹Þ€©ˆhÐÉä¯ñ[!…Ú˜àJ:x2$Íß&PåT£6ç— ‡Í*4Ýšçjÿ ‰É nófÐ ó(L5C•åÆ\rMÒ@ò }y-W}™üýVù—ú¢=Ù”c®‘< M ž ´Phr ¦©TD ‘ù.$´÷O‡‘V2Æò.=IUŒ=ž‡â¬i™aþÓåÙ?òUø'ØÖ•.~* šTŒ!•-×áºTâ®ä#õü'´ eýlYÅÓeÕKÂrT"CÚ@u!Óxƒ{š3€}1¿(r}%«nËamjÑ%ÑNEò v ˜à  σöK³,*º.àzù¨™Ó ÚçâU¦*¿ 9{%Ö¹ njûdaXöb) kÛÆ±ûÓ\°M7ˆÂ=û›ç¿Ã‚­V»Cg–8ÙêE- j)k$º`Ã-ùEýeBÆÇ]c¡°ñty&Òd0nõ'¡W+ƒ*|–øµFa\GQªEAÔp5\Ǽ·¼Ç8·õ -â§Ú[ ‡ uZeÖ 3}×d'+¹:ð+K†Û®s!Ï$úe€<Û”x)1»a­¡LC]¸µík…ÚàA»AYº{†ªS[¦5HÒ7ù --,ísòDØ€èk ÞÀîÜ ò@â( ËNˆë›4ô½•/¦o‡€Û7 ê•ÆêòðÜy'Án½µ á˜ݦ ndeo…[ì¶Ê,¥R³Ä=À±—–ß;£™´ñSâ*g§”ïaið‘Jå~™ÓÞ ß³Õ¢»8x埒²52>AÊb&-÷\7´éÄù€T˜,w;3{ï˜k…à¹ÄqÀ«œ{€\ ˆ¾[´¨јr &Úé„Ívˆ±8†¿]|¬ņ4I×pÞS1ÈÖz‰#Ìv‡G!YNògñ:màTz¢Ý1ô©^O=~ë|5Bã™ç•¼µõ•bÆ@úÕS¬ÈŒ#¬zünrŸ û” Z²•èðV"ÁHÚý©wÝ €7¼Ìu1hÑa3Éä û f$o¿É ™Ú›ÝçnpÒ3äÌ3†Í§,Äï]$‰/pê †«À¼¸e9­Æê_C]žƒ·ý·frÁN«, E=›Çq -‰öŒ:aÏ¿±í&£Í:-} 84‘ÿ eƒQÑeëSsuiA ³g㟥ú£?ÿ ʼn*”“÷aühe:ÊWa@ÒÞk±eØ] F Ô—r.åä˜ @ö¥ªZoÐýYL·¥S²G/‡ñ <~*ZÆ´è>JlòàÛÆ½ÿ 窘ìGN¢:I®KšJp/`íIÁÀõ#Ä-€ö­šµŒoF4|ÆQØÆ@Ì|£Ô…¢À{9˜è½Üó›€ôYÒÎYsið;ís¤€à²ˆ‚4qÉVŒI$ ‰"° æµ8cXGjœˏ¡Aâý•ËÜ¢ûï e·çLx']á"oÅÎê3¯Ç—¹”ó0nå‚âg{Œñ> S´˜îè°g238‚ãköÝfÚd´6Ò€;ò÷±¢™¼›º ¢Æ'¥Ðx'e¬ç ]bÈÆV¢ó‹kýBO ðÊâ$Ÿ!×T 3Mýמ žìٍàÌü‘8÷€àæØ8æ©6‰©L´«…oãpð„~Çk‰!ñ;‹”ÛžÍ àž±z Ÿôû øŸÝužÏ;ÿ #|u6™Þ¬ÚˆÐõA4¶â|ôl|Ê2ŽÇ¤ÝÅÇY.<#Aí.k§hóF‚”Y; M½Ö4hŸ4&›­¿tès´%FìL¥£Ãk‰ÇT¤haÁ¤ÚxfÉ`ÑìË›>i 3t‚:,–+^÷´–{Û–Nxi"x‘Ûg î¨>¥Õ܁ùZH,2Û“:8xÊ¢Çí9.É-Ìâã-=çjwµS˜dütžçwýGòú®®ûº_ˆýx$–¡ãøO EÚÛÏ÷R„×w+3£Á£öUMyR²¹âŒ°š›¸Ñãò9§Ó_Dl+Ùßc›úšGÅÌc†Ž!Ko=¶.‘Îÿ c²(2®V mª.ÿ ¹B›¹å ù„öŸSV>™ü¯$y:G¢Z×àøúdî¹û­·ýÇ´:•c LÍõi_‹ö+ÎæGÊè>OŠ•äž´§Þ{X}¨1ÚTc›»Qþ•êô°t¿OP?eæ~É{5]•ÙR£r5†nZ\ã@ &îJõ ¾àC°þV>fé¥/ü5ñÊIº_é5 ;e­h<@ Ä&æÃëE%;X,ÒãÆÞ`Oò¦kŸm#˜!ÀyÄ¢| óLšò¥Ä` ¶R=|ÈCâh5ò3DˆïF†ðÒ#ÅìÛœ?¸yhBãœí ZxßÎÄhºRK„`Þödvײ™ÀÈÑÒgŒuY w³%†ƒÓzõ ÖÏp‚dH®¦A´ù§»ÓÇMæ~)ˆð‡û:ù&Ä •vGD´À n ݇¼Ö8Fö óáà£~Ë¥x`oK|Ä?fxiØü%pìR>éò+Û±éÎ>núlFŤ'tq8LZÏvÃ?„¡ß±È⽆¯³íü@x|PöUäèØã¡ð‚ŒAìÏ"vÍwóŸÍ{ ý0.z È•Ö{,N¡£¡ŸKÕÙž>Ýœþ ÍÀ°<×EA!Å‚D™IúOÍ¡>ôG}Â` ÍßkÜL™Ž Þð™ {IøF²¹òQ3&!ÃÂÞz.d&Ï-sH¸,Ôõ˜ŽP€ 77ˆÝ¼ÊëÜw =cÕ Ú,ØÐ5ÎYÐ)ì´öœgŒ[¤ßv㙑8心>h]§µháYš£²ºÑ.{Ï7Sð•?´~×SÃKýJÛ˜ ™Íäiúu<µX¶1õ^kâçIÑ£sZ4h>j*ÔšD:4­¿_ ÷¸ Õxæÿ ¸?Mù _•­ÊÐ ä ÷ý ÑwL œ­ïnTkÛUÍN©ë:¦fV ¶ÜÔÜMªÅâA½–¿R×TXš-%iTÊT•‡Ù‚JôϐZxWÑè‰f‰òG º ×Õû2aZ7OU3[“×AT–ÞŒ…-‘¤”Ì ì&(ˆ¿­•ƒkï’:ðY¦W‘ Å)“†‘˜³Åtcø˜ñTÂwÚÇ4|üLÇªí–v- qˆèU qPE.†â‘˜µ Æ,ÐÅs]8¾„oúÑ i>ÜxxÈó)ƒ ´æÁâØ$À‰vžŸf$Ž |ãw;ÀÁIJ»b` {¦Ó¤Ú$©YÀ‘n@Óïž«9J¼êG m¤ ܯ¹ÌW4€ÐÒÅÛ‡#褕Ÿn-?í|с¥÷Ú¹¬'´ÞÜ9ÓK `hê£SÄSà?7—Wí_´…óB›»:=Ãïq`<8ñÓŒÑlú2d¬ê³£hÖ[l|$vÝro~'R®‰§°ñmY ͧäP |PUª¹·:3Œ[Û{Xÿ ºâ@‚W–Äé u‚ ¯´*=íή.pûÒdt @G‰¬ s¸ ëÉücr ÞæÑ¨Ê@>¤¢Ö±. Þ'¯°ÌME[YéïĵÂCå½ Ué©Áû'Ê9%eÔðNU”ë‘ÌsD3/®+UI˜9h.WC”빓$#:pz:YÓ ¿xž* ³$Í +$kñAŠ‹†¢ Uê>¸)_š¬÷©ßAÂÔb9ÇU ¯¾á•9¯ÏÏ÷O÷¼¼Fähal1‰3Ì[Ïr•´UCksNÐ] R‘¸¥H+§Šé†c©vÖÞ0iÓ76s†î!§=ß ¼~Ô'°Ãmäoäš³ªøi1úÉ)³yV8 CLÄØÁ‘WYïi€H6ÖÑiámø^ÈY´°Ñ7¥Û*—Ñ©L«Qƒï—Ùrÿ ›£Ð*š¸ˆL©ˆ$ˆ ÷¾D§9È®«qbqC)–ˆïv´çñsÑVT­Ø, <àïºÀO«Jý·õ àfPìð .wFšir´þ’2_Y *Æ€x\« ì€9š@ Ž|F⇥ˆkZ@hÖÄ0t¿-<“‹qµ¾*ZL¤Ú)&BJpÓF5=$„at*Zš$’ÑtdûÝRI1 2މ$€$I$#‰SÞ’Hë¬ï;Á$¡t$’`<(ñÇt)$‡Ð.Êf¢X’Kt=Éé$‚ˆªè¢oÝëòI%Rgcª÷ŠyI%¡‰ÿ !ñ)´õ $¤ Ô’IIGÿÙ#! /usr/bin/perl # grog - guess options for groff command # Inspired by doctype script in Kernighan & Pike, Unix Programming # Environment, pp 306-8. # Source file position: /src/roff/grog/subs.pl # Installed position: /lib/grog/subs.pl # Copyright (C) 1993-2018 Free Software Foundation, Inc. # This file was split from grog.pl and put under GPL2 by # Bernd Warken . # The macros for identifying the devices were taken from Ralph # Corderoy's 'grog.sh' of 2006. # Last update: 10 Sep 2015 # This file is part of 'grog', which is part of 'groff'. # 'groff' is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # 'groff' is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You can get the license text for the GNU General Public License # version 2 in the internet at # . ######################################################################## require v5.6; use warnings; use strict; use File::Spec; # printing of hashes: my %hash = ...; print Dumper(\%hash); use Data::Dumper; # for running shell based programs within Perl; use `` instead of # use IPC::System::Simple qw(capture capturex run runx system systemx); $\ = "\n"; # my $Sp = "[\\s\\n]"; # my $Sp = qr([\s\n]); # my $Sp = '' if $arg eq '-C'; my $Sp = ''; # from 'src/roff/groff/groff.cpp' near 'getopt_long' my $groff_opts = 'abcCd:D:eEf:F:gGhiI:jJkK:lL:m:M:n:No:pP:r:RsStT:UvVw:W:XzZ'; my @Command = (); # stores the final output my @Mparams = (); # stores the options '-m*' my @devices = (); # stores -T my $do_run = 0; # run generated 'groff' command my $pdf_with_ligatures = 0; # '-P-y -PU' for 'pdf' device my $with_warnings = 0; my $Prog = $0; { my ($v, $d, $f) = File::Spec->splitpath($Prog); $Prog = $f; } my %macros; my %Groff = ( # preprocessors 'chem' => 0, 'eqn' => 0, 'gperl' => 0, 'grap' => 0, 'grn' => 0, 'gideal' => 0, 'gpinyin' => 0, 'lilypond' => 0, 'pic' => 0, 'PS' => 0, # opening for pic 'PF' => 0, # alternative opening for pic 'PE' => 0, # closing for pic 'refer' => 0, 'refer_open' => 0, 'refer_close' => 0, 'soelim' => 0, 'tbl' => 0, # tmacs # 'man' => 0, # 'mandoc' => 0, # 'mdoc' => 0, # 'mdoc_old' => 0, # 'me' => 0, # 'mm' => 0, # 'mom' => 0, # 'ms' => 0, # requests 'AB' => 0, # ms 'AE' => 0, # ms 'AI' => 0, # ms 'AU' => 0, # ms 'NH' => 0, # ms 'TH_later' => 0, # TH not 1st command is ms 'TL' => 0, # ms 'UL' => 0, # ms 'XP' => 0, # ms 'IP' => 0, # man and ms 'LP' => 0, # man and ms 'P' => 0, # man and ms 'PP' => 0, # man and ms 'SH' => 0, # man and ms 'OP' => 0, # man 'SS' => 0, # man 'SY' => 0, # man 'TH_first' => 0, # TH as 1st command is man 'TP' => 0, # man 'UR' => 0, # man 'YS' => 0, # man # for mdoc and mdoc-old # .Oo and .Oc for modern mdoc, only .Oo for mdoc-old 'Oo' => 0, # mdoc and mdoc-old 'Oc' => 0, # mdoc 'Dd' => 0, # mdoc ); # end of %Groff # for first line check my %preprocs_tmacs = ( 'chem' => 0, 'eqn' => 0, 'gideal' => 0, 'gpinyin' => 0, 'grap' => 0, 'grn' => 0, 'pic' => 0, 'refer' => 0, 'soelim' => 0, 'tbl' => 0, 'geqn' => 0, 'gpic' => 0, 'neqn' => 0, 'man' => 0, 'mandoc' => 0, 'mdoc' => 0, 'mdoc-old' => 0, 'me' => 0, 'mm' => 0, 'mom' => 0, 'ms' => 0, ); my @filespec; my $tmac_ext = ''; ######################################################################## # err() ######################################################################## sub err { my $text = shift; print STDERR $text; } ######################################################################## # handle_args() ######################################################################## sub handle_args { my $double_minus = 0; my $was_minus = 0; my $was_T = 0; my $optarg = 0; # globals: @filespec, @Command, @devices, @Mparams foreach my $arg (@ARGV) { if ( $optarg ) { push @Command, $arg; $optarg = 0; next; } if ( $double_minus ) { if (-f $arg && -r $arg) { push @filespec, $arg; } else { print STDERR __FILE__ . ' ' . __LINE__ . ': ' . "grog: $arg is not a readable file."; } next; } if ( $was_T ) { push @devices, $arg; $was_T = 0; next; } ####### handle_args() unless ( $arg =~ /^-/ ) { # file name, no opt, no optarg unless (-f $arg && -r $arg) { print 'unknown file name: ' . $arg; } push @filespec, $arg; next; } # now $arg starts with '-' if ($arg eq '-') { unless ($was_minus) { push @filespec, $arg; $was_minus = 1; } next; } if ($arg eq '--') { $double_minus = 1; push(@filespec, $arg); next; } &version() if $arg =~ /^--?v/; # --version, with exit &help() if $arg =~ /--?h/; # --help, with exit if ( $arg =~ /^--r/ ) { # --run, no exit $do_run = 1; next; } if ( $arg =~ /^--wa/ ) { # --warnings, no exit $with_warnings = 1; next; } ####### handle_args() if ( $arg =~ /^--(wi|l)/ ) { # --ligatures, no exit # the old --with_ligatures is only kept for compatibility $pdf_with_ligatures = 1; next; } if ($arg =~ /^-m/) { push @Mparams, $arg; next; } if ($arg =~ /^-T$/) { $was_T = 1; next; } if ($arg =~ s/^-T(\w+)$/$1/) { push @devices, $1; next; } if ($arg =~ /^-(\w)(\w*)$/) { # maybe a groff option my $opt_char = $1; my $opt_char_with_arg = $opt_char . ':'; my $others = $2; if ( $groff_opts =~ /$opt_char_with_arg/ ) { # groff optarg if ( $others ) { # optarg is here push @Command, '-' . $opt_char; push @Command, '-' . $others; next; } # next arg is optarg $optarg = 1; next; ####### handle_args() } elsif ( $groff_opts =~ /$opt_char/ ) { # groff no optarg push @Command, '-' . $opt_char; if ( $others ) { # $others is now an opt collection $arg = '-' . $others; redo; } # arg finished next; } else { # not a groff opt print STDERR __FILE__ . ' ' . __LINE__ . ': ' . 'unknown argument ' . $arg; push(@Command, $arg); next; } } } @filespec = ('-') unless (@filespec); } # handle_args() ######################################################################## # handle_file_ext() ######################################################################## sub handle_file_ext { # get tmac from file name extension # output number of found single tmac # globals: @filespec, $tmac_ext; foreach my $file ( @filespec ) { # test for each file name in the arguments unless ( open(FILE, $file eq "-" ? $file : "< $file") ) { print STDERR __FILE__ . ' ' . __LINE__ . ': ' . "$Prog: can't open \'$file\': $!"; next; } next unless ( $file =~ /\./ ); # file name has no dot '.' ##### handle_file_ext() # get extension my $ext = $file; $ext =~ s/^ .* \. ([^.]*) $ /$1/x; next unless ( $ext ); ##### handle_file_ext() # these extensions are correct, but not based on a tmac next if ( $ext =~ /^( chem| eqn| g| grap| grn| groff| hdtbl| pdfroff| pic| pinyin| ref| roff| t| tbl| tr| www )$/x ); ##### handle_file_ext() # extensions for man tmac if ( $ext =~ /^( [1-9lno]| man| n| 1b )$/x ) { # 'man|n' from 'groff' source # '1b' from 'heirloom' # '[1-9lno]' from man-pages if ( $tmac_ext && $tmac_ext ne 'man' ) { # found tmac is not 'man' print STDERR __FILE__ . ' ' . __LINE__ . ': ' . '2 different file name extensions found ' . $tmac_ext . ' and ' . $ext; $tmac_ext = ''; next; } ##### handle_file_ext() $tmac_ext = 'man'; next; } if ( $ext =~ /^( mandoc| mdoc| me| mm| mmse| mom| ms| $)/x ) { if ( $tmac_ext && $tmac_ext ne $ext ) { # found tmac is not identical to former found tmac ##### handle_file_ext() print STDERR __FILE__ . ' ' . __LINE__ . ': ' . '2 different file name extensions found ' . $tmac_ext . ' and ' . $ext; $tmac_ext = ''; next; } $tmac_ext = $ext; next; } print STDERR __FILE__ . ' ' . __LINE__ . ': ' . 'Unknown file name extension '. $file . '.'; next; } # end foreach file 1; } # handle_file_ext() ######################################################################## # handle_whole_files() ######################################################################## sub handle_whole_files { # globals: @filespec foreach my $file ( @filespec ) { unless ( open(FILE, $file eq "-" ? $file : "< $file") ) { print STDERR __FILE__ . ' ' . __LINE__ . ': ' . "$Prog: can't open \'$file\': $!"; next; } my $line = ; # get single line unless ( defined($line) ) { # empty file, go to next filearg close (FILE); next; } if ( $line ) { chomp $line; unless ( &do_first_line( $line, $file ) ) { # not an option line &do_line( $line, $file ); } } else { # empty line next; } while () { # get lines by and by chomp; &do_line( $_, $file ); } close(FILE); } # end foreach } # handle_whole_files() ######################################################################## # do_first_line() ######################################################################## # As documented for the 'man' program, the first line can be # used as a groff option line. This is done by: # - start the line with '\" (apostrophe, backslash, double quote) # - add a space character # - a word using the following characters can be appended: 'egGjJpRst'. # Each of these characters means an option for the generated # 'groff' command line, e.g. '-t'. sub do_first_line { my ( $line, $file ) = @_; # globals: %preprocs_tmacs # For a leading groff options line use only [egGjJpRst] if ( $line =~ /^[.']\\"[\segGjJpRst]+&/ ) { # this is a groff options leading line if ( $line =~ /^\./ ) { # line is a groff options line with . instead of ' print "First line in $file must start with an apostrophe \ " . "instead of a period . for groff options line!"; } if ( $line =~ /j/ ) { $Groff{'chem'}++; } if ( $line =~ /e/ ) { $Groff{'eqn'}++; } if ( $line =~ /g/ ) { $Groff{'grn'}++; } if ( $line =~ /G/ ) { $Groff{'grap'}++; } if ( $line =~ /i/ ) { $Groff{'gideal'}++; } if ( $line =~ /p/ ) { $Groff{'pic'}++; } if ( $line =~ /R/ ) { $Groff{'refer'}++; } if ( $line =~ /s/ ) { $Groff{'soelim'}++; } ####### do_first_line() if ( $line =~ /t/ ) { $Groff{'tbl'}++; } return 1; # a leading groff options line, 1 means yes, 0 means no } # not a leading short groff options line return 0 if ( $line !~ /^[.']\\"\s*(.*)$/ ); # ignore non-comments return 0 unless ( $1 ); # for empty comment # all following array members are either preprocs or 1 tmac my @words = split '\s+', $1; my @in = (); my $word; for $word ( @words ) { if ( $word eq 'ideal' ) { $word = 'gideal'; } elsif ( $word eq 'gpic' ) { $word = 'pic'; } elsif ( $word =~ /^(gn|)eqn$/ ) { $word = 'eqn'; } if ( exists $preprocs_tmacs{$word} ) { push @in, $word; } else { # not word for preproc or tmac return 0; } } for $word ( @in ) { $Groff{$word}++; } } # do_first_line() ######################################################################## # do_line() ######################################################################## my $before_first_command = 1; # for check of .TH sub do_line { my ( $line, $file ) = @_; return if ( $line =~ /^[.']\s*\\"/ ); # comment return unless ( $line =~ /^[.']/ ); # ignore text lines $line =~ s/^['.]\s*/./; # let only a dot as leading character, # remove spaces after the leading dot $line =~ s/\s+$//; # remove final spaces return if ( $line =~ /^\.$/ ); # ignore . return if ( $line =~ /^\.\.$/ ); # ignore .. if ( $before_first_command ) { # so far without 1st command if ( $line =~ /^\.TH/ ) { # check if .TH is 1st command for man $Groff{'TH_first'} = 1 if ( $line =~ /^\.\s*TH/ ); } if ( $line =~ /^\./ ) { $before_first_command = 0; } } # split command $line =~ /^(\.\w+)\s*(.*)$/; my $command = $1; $command = '' unless ( defined $command ); my $args = $2; $args = '' unless ( defined $args ); ###################################################################### # soelim if ( $line =~ /^\.(do)?\s*(so|mso|PS\s*<|SO_START).*$/ ) { # '.so', '.mso', '.PS<...', '.SO_START' $Groff{'soelim'}++; return; } if ( $line =~ /^\.(do)?\s*(so|mso|PS\s*<|SO_START).*$/ ) { # '.do so', '.do mso', '.do PS<...', '.do SO_START' $Groff{'soelim'}++; return; } ####### do_line() ###################################################################### # macros if ( $line =~ /^\.de1?\W?/ ) { # this line is a macro definition, add it to %macros my $macro = $line; $macro =~ s/^\.de1?\s+(\w+)\W*/.$1/; return if ( exists $macros{$macro} ); $macros{$macro} = 1; return; } # if line command is a defined macro, just ignore this line return if ( exists $macros{$command} ); ###################################################################### # preprocessors if ( $command =~ /^(\.cstart)|(begin\s+chem)$/ ) { $Groff{'chem'}++; # for chem return; } if ( $command =~ /^\.EQ$/ ) { $Groff{'eqn'}++; # for eqn return; } if ( $command =~ /^\.G1$/ ) { $Groff{'grap'}++; # for grap return; } if ( $command =~ /^\.Perl/ ) { $Groff{'gperl'}++; # for gperl return; } if ( $command =~ /^\.pinyin/ ) { $Groff{'gpinyin'}++; # for gperl return; } if ( $command =~ /^\.GS$/ ) { $Groff{'grn'}++; # for grn return; } if ( $command =~ /^\.IS$/ ) { $Groff{'gideal'}++; # preproc gideal for ideal return; } if ( $command =~ /^\.lilypond$/ ) { $Groff{'lilypond'}++; # for glilypond return; } ####### do_line() # pic can be opened by .PS or .PF and closed by .PE if ( $command =~ /^\.PS$/ ) { $Groff{'pic'}++; # normal opening for pic return; } if ( $command =~ /^\.PF$/ ) { $Groff{'PF'}++; # alternate opening for pic return; } if ( $command =~ /^\.PE$/ ) { $Groff{'PE'}++; # closing for pic return; } if ( $command =~ /^\.R1$/ ) { $Groff{'refer'}++; # for refer return; } if ( $command =~ /^\.\[$/ ) { $Groff{'refer_open'}++; # for refer open return; } if ( $command =~ /^\.\]$/ ) { $Groff{'refer_close'}++; # for refer close return; } if ( $command =~ /^\.TS$/ ) { $Groff{'tbl'}++; # for tbl return; } if ( $command =~ /^\.TH$/ ) { unless ( $Groff{'TH_first'} ) { $Groff{'TH_later'}++; # for tbl } return; } ###################################################################### # macro package (tmac) ###################################################################### ########## # modern mdoc if ( $command =~ /^\.(Dd)$/ ) { $Groff{'Dd'}++; # for modern mdoc return; } ####### do_line() # In the old version of -mdoc 'Oo' is a toggle, in the new it's # closed by 'Oc'. if ( $command =~ /^\.Oc$/ ) { $Groff{'Oc'}++; # only for modern mdoc return; } ########## # old and modern mdoc if ( $command =~ /^\.Oo$/ ) { $Groff{'Oo'}++; # for mdoc and mdoc-old return; } ########## # old mdoc if ( $command =~ /^\.(Tp|Dp|De|Cx|Cl)$/ ) { $Groff{'mdoc_old'}++; # true for old mdoc return; } ########## # for ms ####### do_line() if ( $command =~ /^\.AB$/ ) { $Groff{'AB'}++; # for ms return; } if ( $command =~ /^\.AE$/ ) { $Groff{'AE'}++; # for ms return; } if ( $command =~ /^\.AI$/ ) { $Groff{'AI'}++; # for ms return; } if ( $command =~ /^\.AU$/ ) { $Groff{'AU'}++; # for ms return; } if ( $command =~ /^\.NH$/ ) { $Groff{'NH'}++; # for ms return; } if ( $command =~ /^\.TL$/ ) { $Groff{'TL'}++; # for ms return; } if ( $command =~ /^\.XP$/ ) { $Groff{'XP'}++; # for ms return; } ########## # for man and ms if ( $command =~ /^\.IP$/ ) { $Groff{'IP'}++; # for man and ms return; } if ( $command =~ /^\.LP$/ ) { $Groff{'LP'}++; # for man and ms return; } ####### do_line() if ( $command =~ /^\.P$/ ) { $Groff{'P'}++; # for man and ms return; } if ( $command =~ /^\.PP$/ ) { $Groff{'PP'}++; # for man and ms return; } if ( $command =~ /^\.SH$/ ) { $Groff{'SH'}++; # for man and ms return; } if ( $command =~ /^\.UL$/ ) { $Groff{'UL'}++; # for man and ms return; } ########## # for man only if ( $command =~ /^\.OP$/ ) { # for man $Groff{'OP'}++; return; } if ( $command =~ /^\.SS$/ ) { # for man $Groff{'SS'}++; return; } if ( $command =~ /^\.SY$/ ) { # for man $Groff{'SY'}++; return; } if ( $command =~ /^\.TP$/ ) { # for man $Groff{'TP'}++; return; } if ( $command =~ /^\.UR$/ ) { $Groff{'UR'}++; # for man return; } if ( $command =~ /^\.YS$/ ) { # for man $Groff{'YS'}++; return; } ####### do_line() ########## # me if ( $command =~ /^\.( [ilnp]p| sh )$/x ) { $Groff{'me'}++; # for me return; } ############# # mm and mmse if ( $command =~ /^\.( H| MULB| LO| LT| NCOL| P\$| PH| SA )$/x ) { $Groff{'mm'}++; # for mm and mmse if ( $command =~ /^\.LO$/ ) { if ( $args =~ /^(DNAMN|MDAT|BIL|KOMP|DBET|BET|SIDOR)/ ) { $Groff{'mmse'}++; # for mmse } } elsif ( $command =~ /^\.LT$/ ) { if ( $args =~ /^(SVV|SVH)/ ) { $Groff{'mmse'}++; # for mmse } } return; } ####### do_line() ########## # mom if ( $line =~ /^\.( ALD| DOCTYPE| FAMILY| FT| FAM| LL| LS| NEWPAGE| PAGE| PAPER| PRINTSTYLE| PT_SIZE| T_MARGIN )$/x ) { $Groff{'mom'}++; # for mom return; } } # do_line() ######################################################################## # sub make_groff_device ######################################################################## my @m = (); my @preprograms = (); my $correct_tmac = ''; sub make_groff_device { # globals: @devices # default device is 'ps' when without '-T' my $device; push @devices, 'ps' unless ( @devices ); ###### make_groff_device() for my $d ( @devices ) { if ( $d =~ /^( # suitable devices dvi| html| xhtml| lbp| lj4| ps| pdf| ascii| cp1047| latin1| utf8 )$/x ) { ###### make_groff_device() $device = $d; } else { next; } if ( $device ) { push @Command, '-T'; push @Command, $device; } } ###### make_groff_device() if ( $device eq 'pdf' ) { if ( $pdf_with_ligatures ) { # with --ligature argument push( @Command, '-P-y' ); push( @Command, '-PU' ); } else { # no --ligature argument if ( $with_warnings ) { print STDERR < 1 ) { print STDERR __FILE__ . ' ' . __LINE__ . ': ' . 'argument for -m found: ' . @m; } my $nr_m_args = scalar @Mparams; # m-arguments for grog my $last_m_arg = ''; # last provided -m option if ( $nr_m_args > 1 ) { # take the last given -m argument of grog call, # ignore other -m arguments and the found ones $last_m_arg = $Mparams[-1]; # take the last -m argument print STDERR __FILE__ . ' ' . __LINE__ . ': ' . $Prog . ": more than 1 '-m' argument: @Mparams"; print STDERR __FILE__ . ' ' . __LINE__ . ': ' . 'We take the last one: ' . $last_m_arg; } elsif ( $nr_m_args == 1 ) { $last_m_arg = $Mparams[0]; } ###### make_groff_line_rest() my $final_m = ''; if ( $last_m_arg ) { my $is_equal = 0; for ( @m ) { if ( $_ eq $last_m_arg ) { $is_equal = 1; last; } next; } # end for @m if ( $is_equal ) { $final_m = $last_m_arg; } else { print STDERR __FILE__ . ' ' . __LINE__ . ': ' . 'Provided -m argument ' . $last_m_arg . ' differs from guessed -m args: ' . @m; print STDERR __FILE__ . ' ' . __LINE__ . ': ' . 'The argument is taken.'; $final_m = $last_m_arg; } ###### make_groff_line_rest() } else { # no -m arg provided if ( $nr_m_guessed > 1 ) { print STDERR __FILE__ . ' ' . __LINE__ . ': ' . 'More than 1 -m arguments were guessed: ' . @m; print STDERR __FILE__ . ' ' . __LINE__ . ': ' . 'Guessing stopped.'; exit 1; } elsif ( $nr_m_guessed == 1 ) { $final_m = $m[0]; } else { # no -m provided or guessed } } push @Command, $final_m if ( $final_m ); push(@Command, @filespec) unless ( $file_args_included ); ######### # execute the 'groff' command here with option '--run' if ( $do_run ) { # with --run print STDERR __FILE__ . ' ' . __LINE__ . ': ' . "@Command"; my $cmd = join ' ', @Command; system($cmd); } else { print "@Command"; } exit 0; } # make_groff_line_rest() ######################################################################## # sub help ######################################################################## sub help { print <