Path: utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!xanth!cs.odu.edu!Amiga-Request From: Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator) Newsgroups: comp.sources.amiga Subject: v90i204: YAFR 1.21 - yet another file requester, Part01/02 Message-ID: <13082@xanth.cs.odu.edu> Date: 8 Jul 90 16:03:52 GMT Sender: tadguy@cs.odu.edu Reply-To: davids@ucscb.UCSC.EDU (Dave Schreiber) Lines: 1690 Approved: tadguy@cs.odu.edu (Tad Guy) X-Mail-Submissions-To: Amiga@cs.odu.edu X-Post-Discussions-To: comp.sys.amiga Submitted-by: davids@ucscb.UCSC.EDU (Dave Schreiber) Posting-number: Volume 90, Issue 204 Archive-name: examples/yafr-1.21/part01 [ uuencoded executable and object module included ...tad ] [ This is version 1.21 of YAFR, an update to version 1.15 posted in March. The documentation lists this a 1.20, but the source says 1.21. ...tad ] #!/bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'README' <<'END_OF_FILE' X YAFR V1.20 X by Dave Schreiber X XYAFR V1.20 Copyright (c)1989,1990 by Dave Schreiber. All rights reserved. XYAFR is freely distributable, and may be sold as part of a commercial Xprogram. This copyright message must be included in the documentation Xfor any program, commercial or otherwise, that uses YAFR. Use of YAFR Xin a rogram does not detract in any way from the ownership of YAFR by Xits author, Dave Schreiber, nor does it change its status as a freely Xdistributable program. Dave Schreiber reserves the right to forbid any Xperson or company from incorporating YAFR as part of a program owned by Xthat person or company. X XWhew! Now, enough of legalize. I'd appreciate hearing from you if you Xuse YAFR in a program that you write, but it isn't a requirement. XInstructions for compiling YAFR and using it in other programs is in Xthe source code, YAFR.c. The program yftest is a small demo of the Xfile requestor. Enjoy. X X-Dave Schreiber Xdavids@slugmail.ucsc.edu (prefered, but flakey. If it doesn't work, try Xdavids@ucscb.ucsc.edu (during the school year) or Xdavids@cup.portal.com (all other times).) X END_OF_FILE if test 1163 -ne `wc -c <'README'`; then echo shar: \"'README'\" unpacked with wrong size! fi # end of 'README' fi if test -f 'WdwDefs.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'WdwDefs.h'\" else echo shar: Extracting \"'WdwDefs.h'\" \(9615 characters\) sed "s/^X//" >'WdwDefs.h' <<'END_OF_FILE' X Xstruct Window *FNWindow = NULL; X#define Rp FNWindow->RPort XUBYTE DIRUNDOBUFFER[150]; XUBYTE FNUNDOBUFFER[33]; XUBYTE EXTUNDOBUFFER[150]; X Xstruct PropInfo SliderSInfo = { X AUTOKNOB+FREEVERT, X -1,661, X 655,655 X}; X Xstruct Image Image1 = { X 0,1, X 15,4, X 0, X NULL, X 0x0000,0x0000, X NULL X}; X Xstruct Gadget Slider = { X NULL, X 217,35, X 23,110, X NULL, X FOLLOWMOUSE, X PROPGADGET, X (APTR)&Image1, X NULL, X NULL, X NULL, X (APTR)&SliderSInfo, X 16, X NULL X}; X XUSHORT chip ImageData2[] = { X 0xFFFF,0xFFFF,0xFFFE,0xC000,0x0000,0x0006,0xC006,0x0007, X 0x0006,0xC000,0x000D,0x8006,0xC00E,0x1F0C,0x0F06,0xC006, X 0x199E,0x1986,0xC006,0x198C,0x1986,0xC606,0x198C,0x1986, X 0xC60F,0x199E,0x0F06,0xC000,0x0000,0x0006,0xFFFF,0xFFFF, X 0xFFFE X}; X Xstruct Image Image2 = { X 0,0, X 47,11, X 2, X ImageData2, X 0x0001,0x0000, X NULL X}; X XUSHORT chip ImageData3[] = { X 0x1FFF,0xFFFF,0xFFF0,0xC000,0x0000,0x0006,0xC006,0x0007, X 0x0006,0xC000,0x000C,0x0006,0xC00E,0x0700,0x0F06,0xC006, X 0x181E,0x1986,0xC006,0x0180,0x1986,0xC600,0x198C,0x1986, X 0xC60F,0x199E,0x0006,0xC000,0x0000,0x0006,0x1FFF,0xFFFF, X 0xFFF0,0xE000,0x0000,0x000E,0x1E00,0x0000,0x00F0,0x01F0, X 0x0000,0x1F00,0x000F,0x8003,0xE000,0x0000,0x783C,0x0000, X 0x0000,0x07C0,0x0000,0x0000,0x783C,0x0000,0x000F,0x8003, X 0xE000,0x01F0,0x0000,0x1F00,0x1E00,0x0000,0x00F0,0xE000, X 0x0000,0x000E X}; X Xstruct Image Image3 = { X 0,0, X 47,11, X 2, X ImageData3, X 0x0003,0x0000, X NULL X}; X Xstruct Gadget Info = { X &Slider, X 165,11, X 47,11, X GADGHIMAGE+GADGIMAGE, X GADGIMMEDIATE+TOGGLESELECT, X BOOLGADGET, X (APTR)&Image2, X (APTR)&Image3, X NULL, X NULL, X NULL, X 18, X NULL X}; X XUBYTE filenameSIBuff[33]; Xstruct StringInfo filenameSInfo = { X filenameSIBuff, X FNUNDOBUFFER, X 0, X 33, X 0, X 0,0,0,0,0, X 0, X 0, X NULL X}; X XSHORT BorderVectors1[] = { X 0,0, X 217,0, X 217,10, X 0,10, X 0,0 X}; Xstruct Border Border1 = { X -2,-1, X 1,0,JAM2, X 5, X BorderVectors1, X NULL X}; X Xstruct Gadget filename = { X &Info, X 86,159, X 214,9, X NULL, X RELVERIFY, X STRGADGET, X (APTR)&Border1, X NULL, X NULL, X NULL, X (APTR)&filenameSInfo, X 12, X NULL X}; X XUBYTE ExtNameSIBuff[150]; Xstruct StringInfo ExtNameSInfo = { X ExtNameSIBuff, X EXTUNDOBUFFER, X 0, X 150, X 0, X 0,0,0,0,0, X 0, X 0, X NULL X}; X XSHORT BorderVectors2[] = { X 0,0, X 155,0, X 155,10, X 0,10, X 0,0 X}; Xstruct Border Border2 = { X -2,-1, X 1,0,JAM2, X 5, X BorderVectors2, X NULL X}; X Xstruct Gadget ExtName = { X &filename, X 86,147, X 152,9, X NULL, X RELVERIFY, X STRGADGET, X (APTR)&Border2, X NULL, X NULL, X NULL, X (APTR)&ExtNameSInfo, X 18, X NULL X}; X XSHORT BorderVectors3[] = { X 0,0, X 89,0, X 89,12, X 0,12, X 0,1 X}; Xstruct Border Border3 = { X -1,-1, X 1,0,JAM2, X 5, X BorderVectors3, X NULL X}; X Xstruct IntuiText IText23 = { X 1,0,JAM2, X 37,2, X NULL, X "Ok", X NULL X}; X Xstruct Gadget ok = { X &ExtName, X 6,172, X 88,11, X NULL, X RELVERIFY, X BOOLGADGET, X (APTR)&Border3, X NULL, X &IText23, X NULL, X NULL, X 13, X NULL X}; X XSHORT BorderVectors4[] = { X 0,0, X 84,0, X 84,10, X 0,10, X 0,1 X}; Xstruct Border Border4 = { X -1,-1, X 1,0,JAM2, X 5, X BorderVectors4, X NULL X}; X Xstruct IntuiText IText24 = { X 1,0,JAM2, X 19,1, X NULL, X "Parent", X NULL X}; X Xstruct Gadget parent = { X &ok, X 218,12, X 83,9, X NULL, X RELVERIFY, X BOOLGADGET, X (APTR)&Border4, X NULL, X &IText24, X NULL, X NULL, X 15, X NULL X}; X XSHORT BorderVectors5[] = { X 0,0, X 89,0, X 89,12, X 0,12, X 0,1 X}; Xstruct Border Border5 = { X -1,-1, X 1,0,JAM2, X 5, X BorderVectors5, X NULL X}; X Xstruct IntuiText IText25 = { X 1,0,JAM2, X 21,2, X NULL, X "Cancel", X NULL X}; X Xstruct Gadget cancel = { X &parent, X 213,172, X 88,11, X NULL, X RELVERIFY, X BOOLGADGET, X (APTR)&Border5, X NULL, X &IText25, X NULL, X NULL, X 14, X NULL X}; X XSHORT BorderVectors6[] = { X 0,0, X 57,0, X 57,10, X 0,10, X 0,1 X}; Xstruct Border Border6 = { X -1,-1, X 1,0,JAM2, X 5, X BorderVectors6, X NULL X}; X Xstruct IntuiText IText26 = { X 1,0,JAM2, X 10,1, X NULL, X "PIPE:", X NULL X}; X Xstruct Gadget pipe = { X &cancel, X 245,147, X 56,9, X NULL, X RELVERIFY, X BOOLGADGET, X (APTR)&Border6, X NULL, X &IText26, X NULL, X NULL, X 10, X NULL X}; X XSHORT BorderVectors7[] = { X 0,0, X 57,0, X 57,10, X 0,10, X 0,1 X}; Xstruct Border Border7 = { X -1,-1, X 1,0,JAM2, X 5, X BorderVectors7, X NULL X}; X Xstruct IntuiText IText27 = { X 1,0,JAM2, X 13,1, X NULL, X " ", X NULL X}; X Xstruct Gadget rad = { X &pipe, X 245,135, X 56,9, X NULL, X RELVERIFY, X BOOLGADGET, X (APTR)&Border7, X NULL, X &IText27, X NULL, X NULL, X 9, X NULL X}; X XSHORT BorderVectors8[] = { X 0,0, X 57,0, X 57,10, X 0,10, X 0,1 X}; Xstruct Border Border8 = { X -1,-1, X 1,0,JAM2, X 5, X BorderVectors8, X NULL X}; X Xstruct IntuiText IText28 = { X 1,0,JAM2, X 13,1, X NULL, X " ", X NULL X}; X Xstruct Gadget Ram = { X &rad, X 245,124, X 56,9, X NULL, X RELVERIFY, X BOOLGADGET, X (APTR)&Border8, X NULL, X &IText28, X NULL, X NULL, X 8, X NULL X}; X XSHORT BorderVectors9[] = { X 0,0, X 57,0, X 57,10, X 0,10, X 0,1 X}; Xstruct Border Border9 = { X -1,-1, X 1,0,JAM2, X 5, X BorderVectors9, X NULL X}; X Xstruct IntuiText IText29 = { X 1,0,JAM2, X 13,1, X NULL, X " ", X NULL X}; X Xstruct Gadget vdk = { X &Ram, X 245,113, X 56,9, X NULL, X RELVERIFY, X BOOLGADGET, X (APTR)&Border9, X NULL, X &IText29, X NULL, X NULL, X 7, X NULL X}; X XSHORT BorderVectors10[] = { X 0,0, X 57,0, X 57,10, X 0,10, X 0,1 X}; Xstruct Border Border10 = { X -1,-1, X 1,0,JAM2, X 5, X BorderVectors10, X NULL X}; X Xstruct IntuiText IText30 = { X 1,0,JAM2, X 13,1, X NULL, X " ", X NULL X}; X Xstruct Gadget vd0 = { X &vdk, X 245,102, X 56,9, X NULL, X RELVERIFY, X BOOLGADGET, X (APTR)&Border10, X NULL, X &IText30, X NULL, X NULL, X 6, X NULL X}; X XSHORT BorderVectors11[] = { X 0,0, X 57,0, X 57,10, X 0,10, X 0,1 X}; Xstruct Border Border11 = { X -1,-1, X 1,0,JAM2, X 5, X BorderVectors11, X NULL X}; X Xstruct IntuiText IText31 = { X 1,0,JAM2, X 13,1, X NULL, X " ", X NULL X}; X Xstruct Gadget dh2 = { X &vd0, X 245,91, X 56,9, X NULL, X RELVERIFY, X BOOLGADGET, X (APTR)&Border11, X NULL, X &IText31, X NULL, X NULL, X 5, X NULL X}; X XSHORT BorderVectors12[] = { X 0,0, X 57,0, X 57,10, X 0,10, X 0,1 X}; Xstruct Border Border12 = { X -1,-1, X 1,0,JAM2, X 5, X BorderVectors12, X NULL X}; X Xstruct IntuiText IText32 = { X 1,0,JAM2, X 13,1, X NULL, X " ", X NULL X}; X Xstruct Gadget dh1 = { X &dh2, X 245,80, X 56,9, X NULL, X RELVERIFY, X BOOLGADGET, X (APTR)&Border12, X NULL, X &IText32, X NULL, X NULL, X 4, X NULL X}; X XSHORT BorderVectors13[] = { X 0,0, X 57,0, X 57,10, X 0,10, X 0,1 X}; Xstruct Border Border13 = { X -1,-1, X 1,0,JAM2, X 5, X BorderVectors13, X NULL X}; X Xstruct IntuiText IText33 = { X 1,0,JAM2, X 13,1, X NULL, X " ", X NULL X}; X Xstruct Gadget df2 = { X &dh1, X 245,58, X 56,9, X NULL, X RELVERIFY, X BOOLGADGET, X (APTR)&Border13, X NULL, X &IText33, X NULL, X NULL, X 2, X NULL X}; X XSHORT BorderVectors14[] = { X 0,0, X 57,0, X 57,10, X 0,10, X 0,1 X}; Xstruct Border Border14 = { X -1,-1, X 1,0,JAM2, X 5, X BorderVectors14, X NULL X}; X Xstruct IntuiText IText34 = { X 1,0,JAM2, X 13,1, X NULL, X " ", X NULL X}; X Xstruct Gadget dh0 = { X &df2, X 245,69, X 56,9, X NULL, X RELVERIFY, X BOOLGADGET, X (APTR)&Border14, X NULL, X &IText34, X NULL, X NULL, X 3, X NULL X}; X XSHORT BorderVectors15[] = { X 0,0, X 57,0, X 57,10, X 0,10, X 0,1 X}; Xstruct Border Border15 = { X -1,-1, X 1,0,JAM2, X 5, X BorderVectors15, X NULL X}; X Xstruct IntuiText IText35 = { X 1,0,JAM2, X 13,1, X NULL, X " ", X NULL X}; X Xstruct Gadget df1 = { X &dh0, X 245,47, X 56,9, X NULL, X RELVERIFY, X BOOLGADGET, X (APTR)&Border15, X NULL, X &IText35, X NULL, X NULL, X 1, X NULL X}; X XSHORT BorderVectors16[] = { X 0,0, X 57,0, X 57,10, X 0,10, X 0,1 X}; Xstruct Border Border16 = { X -1,-1, X 1,0,JAM2, X 5, X BorderVectors16, X NULL X}; X Xstruct IntuiText IText36 = { X 1,0,JAM2, X 13,1, X NULL, X " ", X NULL X}; X Xstruct Gadget df0 = { X &df1, X 245,36, X 56,9, X NULL, X RELVERIFY, X BOOLGADGET, X (APTR)&Border16, X NULL, X &IText36, X NULL, X NULL, X 0, X NULL X}; X XSHORT BorderVectors17[] = { X 0,0, X 207,0, X 207,109, X 0,109, X 0,0 X}; Xstruct Border Border17 = { X -2,-1, X 1,0,JAM2, X 5, X BorderVectors17, X NULL X}; X Xstruct Gadget filenamebox = { X &df0, X 6,36, X 204,108, X GADGHBOX+GADGHIMAGE, X GADGIMMEDIATE, X BOOLGADGET, X (APTR)&Border17, X NULL, X NULL, X NULL, X NULL, X 17, X NULL X}; X XUBYTE DirNameSIBuff[150]; Xstruct StringInfo DirNameSInfo = { X DirNameSIBuff, X DIRUNDOBUFFER, X 0, X 150, X 0, X 0,0,0,0,0, X 0, X 0, X NULL X}; X XSHORT BorderVectors18[] = { X 0,0, X 297,0, X 297,10, X 0,10, X 0,0 X}; Xstruct Border Border18 = { X -2,-1, X 1,0,JAM2, X 5, X BorderVectors18, X NULL X}; X Xstruct Gadget DirName = { X &filenamebox, X 6,24, X 294,9, X NULL, X RELVERIFY, X STRGADGET, X (APTR)&Border18, X NULL, X NULL, X NULL, X (APTR)&DirNameSInfo, X 11, X NULL X}; X X#define GadgetList2 DirName X Xstruct NewWindow NewFNWindow = { X 6,9, X 307,187, X 0,1, X MOUSEMOVE+GADGETDOWN+GADGETUP+DISKINSERTED+DISKREMOVED+RMBTRAP, X WINDOWDRAG+ACTIVATE, X &DirName, X NULL, X "Enter filename", X NULL, X NULL, X 5,5, X 640,200, X WBENCHSCREEN X}; END_OF_FILE if test 9615 -ne `wc -c <'WdwDefs.h'`; then echo shar: \"'WdwDefs.h'\" unpacked with wrong size! fi # end of 'WdwDefs.h' fi if test -f 'YAFR.o.uu' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'YAFR.o.uu'\" else echo shar: Extracting \"'YAFR.o.uu'\" \(19332 characters\) sed "s/^X//" >'YAFR.o.uu' <<'END_OF_FILE' Xbegin 664 YAFR.o XM```#YP````)90492+F,``````^D```8D3E7__+_L``!E````+P80+?_N%!/2D!G!G`!8```CB)M__P@44H89OQ3B)'1+P@O$2\*3KH``$_O``Q*7 XM@&9D(FW__"!12AAF_%.(D=$@"-7`8+@O"B\+80`!,%!/2D!G!'`!8$92BDH2# XM9N@0*P`$<@:P`6<$4P!F*G`!8"XO"B\+80`!!E!/2D!G!'`!8!Q(>O\R+PHOZ XM"R!M__PO$&$`_GY@""\*+PMA```,3.T,`/_T3EU.=;_L``!E````2.<`,"9OA XM``PD;P`0(`IF!G``8```LA`K``1R!K`!9P``G'(!L`%G``"4$@!(@0Q!``9DC XM``""TD$R.Q`&3OL0!``*`'0`.@!(`'0`7"!32AAF_%.(D=,O""\3+PI.N@``U XM3^\`#$J`9P1P`&!:(%-*&&;\4XB1TR`(U XM`(XY10*:.6T`+@*<2'C__B\*3KH``%!/*T#_^"!M`!!*$&8,0>P(U")M`!`2\ XMV&;\(&T`$$/M_V(2V&;\2&W_8F$`^/__+RP``$ZZ``!(>``!(&P``"\H`#).N@``2'@`2 XM$TAX``8@;```+R@`,DZZ``!(>``)2&P)`B!L```O*``R3KH``$AX`)I(>``&[ XM(&P``"\H`#).N@``2'@`!TAL"0P@;```+R@`,DZZ``!/[P!$2'@`I4AX``8@7 XM;```+R@`,DZZ``!(>``(2&P)%"!L```O*``R3KH``$*7+RP``$AL!_Q.N@``F XM3^\`("\M__AA``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+RW_\DZZ```@!TSM"(#_Z$Y=3G5.5?_\O^P`< XM`&4```!(YP,P)FT`""1M``Q^`$HS<`!G#B!M`!`1LW``<`!21V#L(`=(P'(Z@ XM(&T`$+(P"/]G&B`'2,!R+[(P"/]G#DI'9PI*$F<&$8%P`%)'?`!*,F``9Q@@2 XM!TC`(@9(P="!(&T`$!&R8``(`%)&8.(@!TC`(@9(P="!(&T`$$(P"`!,WPS`R XM3EU.=4Y5__2_[```90```$CG!P`N+0`(+SP``0``2'@!!$ZZ``!03RM`__9*O XM@&8$<`!@9B\M__8O!TZZ```@;?_V4(A(;`*>2&P#*B\(80#_(D_O`!1\``Q&7 XM`(QL$D'L`IY#[`,J$[!@`&``4D9@Z"\'3KH``"H`+H=.N@``6$\N!4J'9P@O$ XM!V$`_WI83TAX`00O+?_V3KH``$SM`.#_Z$Y=3G6_[```90```$CG`Q`F;P`0+ XM?@`,1P",;!9P`$'L`IX1@'``0>P#*A&`<`!21V#D2'C__B\+3KH``%!/+`!*I XMAF8$<`!@+"\&80#_&%A/?@`,1P",;!QP+T'L`RJP,'``9@Q![`,J$;P`.G``Q XM8`121V#>3-\(P$YU```#^````%L````!```5=```%6P``!5,```5!@``%-@`Z XM`!2P```4:```%%```!1(```4+@``$^8``!.>```2N```$H```!#X```0I```$ XM$)```!!*```01```$#8``!`R```0"@``$`8```_>```/V@``#[8```\:```.8 XM]@``#N(```ZJ```.I@``#I0```X^```..@``#@X```W>```-L```#2X```T"6 XM```,N```##P```P&```+X```"]````NT```+D```"W````LT```+,```"N0`A XM``I>```*6@``"B````H<```*`@``"50```E````)/```"3@```CJ```(S@``< XM"$(```@^```(*```""0```?X```']```!^8```?B```'T@``![H```>V```': XMI@``!Y(```>.```'?@``!VH```=>```'5@``!T```````.S```#K8```Z8```., XMC```#BP```X2```.!@``#@(```L<```*3```"5@```C<```(C```"'H```AP: XM```(9@``"#0```;Z```&\```!N0```;>```&H```!IH````H`````````^^&4 XM```"7U]B87-E```````=```8'```%X```!;N```5V```%9(``!5D```3;```3 XM$R0``!)"```1V@``$3H``!$<```0K@``$%X```T:```,S@``"_(```NJ```+8 XM8@``"0@```9:```%]@``!2(```0T```#C@```*8```!D````2@````:#```"= XM7U]X8V]V9@`````=```8(```%X0``!;R```5W```%98``!5H```3<```$R@`S XM`!)&```1W@``$3X``!$@```0L@``$&(```T>```,T@``"_8```NN```+9@``O XM"0P```9>```%^@``!28```0X```#D@```*H```!H````3@````J#```"7VUA0 XM;&QO8P`````!````%H,```)?;&]N9VIM<`````$````L@P```E]S971M96T`X XM`````0```#J#```"7V9R964````````!````6H,```)?7T-833(R``````,`N XM``-8```#0@```."#```"7W-T&@P```E]497AT````````!0``$Q(``!*^```'[@``!\(```>:^ XM@P``!%]!8W1I=F%T94=A9&=E=``````"```(2@``!_R#```$7U)E9G)ER6 XM```)>(,```)?17A.97AT``````$```F:@P```E]&:```6$@``%?0``!%8A@```E]$3U-"87-E````@ XM`0``$X*#```#7T]N1V%D9V5T`````````0``%,2#```#7T]F9D=A9&=E=```I XM`````0``%2J#```#7T-R96%T95!O```````"Z@!```#7U!A@$`- XM``-?36%K94%B8````````````"I XM````````````.0```#D`"@````H````!_____P$``04```8F`````"`@("``V XM``$``0``#0`!````````!DH````````%^@#U`$4`.``)`````0`!```&.@``< XM``````90`````````````P```````````#D````Y``H````*`````?____\!= XM``$%```&D``````@("`@```!``$```T``0````````:T````````!F0`]0`OT XM`#@`"0````$``0``!J0````````&N@````````````$````````````Y````G XM.0`*````"@````'_____`0`!!0``!OH`````("`@(````0`!```-``$`````A XM```''@````````;.`/4`)``X``D````!``$```<.````````!R0`````````5 XM````````````````SP```,\`;0```&T`````__[__P$``04```=D````````E XM!S@`!@`D`,P`;``#``(``0``!W@``````````````````````!$````````"Y XM!`````````"6``````````````````````````````````````$I```!*0`*X XM````"@````#__O__`0`!!0``!]@````````'B``&`!@!)@`)`````0`$```'4 XM[```````````````````![0`"P````!&:6QE('!A='1E0```0`!```%``T````````(:```"%1%;G1E0!0871T97)N`$9I;&5N86UE```O: XM`%!)4$4Z`"YI;F9O`"\`+P``````````````4$E013H`.@`C/P``4$E013H`, XM+P!U,"`@*&1I:```'B```!X````=2```'2@``!S@```P```'D```!T@```'1.86UE& XM4TEN9F\```````$B`0``!%]";W)D97)696-T;W)S,@````%&`0```E]";W)D, XM97(R```!6@$```)?17AT3F%M90```6H!```$7T)O'0R.````]0!```!7U)A;0```^@!```$7T)OG XM```!X@!0 XM```$7T1I'0S-P``"'0!```#, XM7TYE=T9.5VEN9&]W```(F`$```1?1FER XM>6%F`0```U]A8G-$:7).86UEU XM`````RH!```"7VQO=VUE;0````.V`0``!%]-87-T97)0871T97)N``````/R\ XM`````````_(```/H`````6-H:7!```/J````,O_______L``````!L`&``<`P XM!L````V`!L`.'PP/!L`&&9X9AL`&&8P9AL8&&8P9AL8/&9X/!L``````!O__" XM_____A______\,``````!L`&``<`!L````P`!L`.!P`/!L`&&!X9AL`&`8`96 XMAL8`&8P9AL8/&9X`!L``````!A______\.``````#AX`````\`'P```?```/. XM@`/@````>#P`````!\``````>#P````/@`/@``'P```?`!X`````\.``````" XM#@`````#[P$```-?26UA9V5$871A,@```````0```U]);6%G941A=&$S````E X*`$(````````#\@-?9 X`` Xend Xsize 13780 END_OF_FILE if test 19332 -ne `wc -c <'YAFR.o.uu'`; then echo shar: \"'YAFR.o.uu'\" unpacked with wrong size! fi # end of 'YAFR.o.uu' fi if test -f 'pattern.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pattern.h'\" else echo shar: Extracting \"'pattern.h'\" \(10288 characters\) sed "s/^X//" >'pattern.h' <<'END_OF_FILE' X/* ====================================================================== */ X X/* X AmigaDOS Pattern Matching Demo X March 20, 1990 X X by Dave Haynie X X Released to the Public Domain X X This is the AmigaDOS Pattern Matcher I developed for DiskSalv X V1.40. So far, it seems to work just fine, and certainly works X better than any public domain code I managed to dig up, most X of which was limited to the '?' and '#' characters instead of X full AmigaDOS patterns. X X This will compile under Lattice V5.02 with the command: X X lc -L pattern.c X X The Lattice global optimizer seems to have trouble with it, at X least with the V5.02 system. X X With the function prototypes removed, I suspect it would be a X simple port to the Manx V3.6a compiler. X X I'd certainly appreciate any feedback on this code, especially X if there are any patterns it doesn't correctly match. X*/ X X#include X#include X#include X#include X X/* ====================================================================== */ X X/* These are my allocator routines, slight variations on the C library X routines. The pattern matching code was designed to use the DiskSalv X safe chunky allocator, and rather than re-write the code to use X something else, I provide some basically equivalent routines below. X The pattern compiler allocates string memory, and works best with a X memory allocator that can be cleaned up at program's end (eg, a plain X AllocMem() here isn't a good idea). */ X Xjmp_buf lowmem; /* Don't forget to initialize this! */ X X/* This is the basic safe allocator; it always returns a valid pointer. X The pattern matcher counts on the memory returned having been zeroed X out! */ X Xchar *salloc(LONG size) { X char *ptr; X X if (!(ptr = (char *)malloc(size))) longjmp(lowmem,-1); X setmem(ptr,size,'\0'); X return ptr; X} X X/* This is just for compatibility purposes. */ X Xvoid sfree(char *ptr) { X free(ptr); X} X X/* ====================================================================== */ X X/* This is the definition of a pattern element. The pattern compiler will X create an array of these elements from a string passed to it. */ X Xtypedef struct { X char *aux; /* Auxilary data; string or paren-count */ X BYTE type; /* Corresponding character type */ X} pattern; X X/* The types, for the "special" array. */ X X#define pSTRING 0 /* Plain old string */ X#define pALT 1 /* The alternation character */ X#define pREP 2 /* The repeat character */ X#define pANY 3 /* The match-any character */ X#define pNULL 4 /* The match-null character */ X#define pSUB 5 /* A subpattern */ X#define pEND 6 /* End of the pattern. */ X X/* This is the definition of a pattern matching function, for use in the X "MatchSub()" coroutine. */ X Xtypedef BOOL (*patfunc)(pattern *, char *); X X/* ====================================================================== */ X X/* This section contains the pattern compiler code. */ X X/* This function takes in a string from which one parenthesis has been X stripped. It returns a pointer to the position of the matching X parenthesis, or NULL if it isn't found. */ X Xstatic char *FindParen(char *str) { X short parencnt = 1; X X while (*str) { X switch (*str) { X case '(' : X ++parencnt; X break; X case ')' : X if (--parencnt == 0) return str; X break; X default : X break; X } X ++str; X } X return NULL; X} X X/* This function creates a pattern for later pattern matching. It checks X syntax as well, since we don't want invalid patterns to possibly crash X the machine or otherwise cause trouble. This is a destructive compile, X in that it trashes the input string. */ X Xpattern *CompilePattern(char *str) { X pattern *pat, *result = NULL; X short i = 0, j, tlen, plen = strlen(str)+1; X char fch, nch, *sub, *tmp; X X if (!str) return NULL; X X pat = (pattern *)salloc(sizeof(pattern)*plen); X while (fch = *str++) { X nch = *str; X switch (fch) { X case '(' : /* The start of a group */ X if (nch == '|' || nch == ')') goto fail; X pat[i].type = pSUB; X if (!(str = FindParen(sub = str))) goto fail; X *str++ = '\0'; X if (!(pat[i].aux = (char *)CompilePattern(sub))) goto fail; X break; X case ')' : /* We should never see the end of a group */ X goto fail; X case '|' : /* Alternation */ X if (nch == '|' || nch == ')') goto fail; X pat[i].type = pALT; X break; X case '#' : /* Repeatition */ X if (nch == '#' || nch == '|' || nch == ')' || !nch) goto fail; X pat[i].type = pREP; X switch (nch) { X case '(' : X case '%' : X case '?' : X break; X case '\047': X nch = *str++; X default: X pat[++i].type = pSTRING; X pat[i].aux = (char *)salloc(2); X pat[i].aux[0] = nch; X str++; X break; X } X break; X case '?' : /* One of anything */ X pat[i].type = pANY; X break; X case '%' : /* One of nothing */ X pat[i].type = pNULL; X break; X default: /* Normal characters */ X pat[i].type = pSTRING; X tmp = (char *)salloc((long)(tlen = strlen(str)+2)); X tmp[0] = fch; X j = 1; X while (*str && !strchr("()|#?%",*str)) { X if (*str == '\047') ++str; X tmp[j++] = *str++; X } X tmp[j] = '\0'; X strupr(strcpy(pat[i].aux = salloc(j+1),tmp)); X sfree(tmp); X break; X } X ++i; X } X pat[i++].type = pEND; X result = (pattern *)memcpy(salloc(sizeof(pattern)*i),(char *)pat,sizeof(pattern)*i); X Xfail: X sfree((char *)pat); X return result; X} X X/* ====================================================================== */ X X/* This is the actual pattern matching code. This code hasn't been really X optimized or anything; it's highly recursive, but it's designed to be X as nice to your stack as possible. There are four coroutines in my X pattern matcher. The top-level routine "MatchPattern()" takes in a X pattern and a string, and knows only how to subdivide an alternated X pattern and pass that on the the single pattern matcher, "MatchOne()". X That routine knows how to match strings, NULLs, and ANYs. It calls X "MatchRepeat()" to handle the repeat pattern, and "MatchSub()" to handle X a sub-pattern. Similarly, the "MatchRepeat()" routine knows how to match X repeated strings, NULLs, and ANYs. It also calls the "MatchSub()" routine X to handle repeated subpatterns. The "MatchSub()" splits the input string X into strings for the subpattern and parent pattern to match, and works X through these until a match is found or we've tried all possibilities. X It calls "MatchPattern()" on a simple subpattern, or "MatchRepeat()" on a X repeated subpattern. */ X X/* Forward Declarations */ X Xstatic BOOL MatchOne(pattern *, char *); Xstatic BOOL MatchSub(pattern *, pattern *, char *, patfunc); Xstatic BOOL MatchRepeat(pattern *, char *); X BOOL MatchPattern(pattern *, char *); X X/* This function matches a subpattern, where "sub" is the subpattern, X "pat" is the rest of the pattern at the current level, and "str" X is the usual string. The string splitting uses dynamic allocation X to avoid stack overflows as much as possible, the "subob" function X is the particular pattern matching function to use on the subpattern. */ X Xstatic BOOL MatchSub(pattern *sub, pattern *pat, char *str, patfunc subop) { X short pos, len = strlen(str)+1; X char *copy = salloc(strlen(str)+1); X X for (pos = 0; pos < len; pos++) { X if ((*subop)(sub,copy) && MatchOne(pat,str)) { X sfree(copy); X return TRUE; X } X copy[pos] = *str++; X } X sfree(copy); X return FALSE; X} X X/* This function matches a repeat pattern. It returns the part of the X string not matched, or NULL if the whole string was matched. */ X Xstatic BOOL MatchRepeat(pattern *pat, char *str) { X pattern *local = pat++; X X switch (local->type) { X case pSTRING : X while (TRUE) { X if (MatchPattern(pat,str)) return TRUE; X if (strnicmp(str,local->aux,strlen(local->aux))) break; X str += strlen(local->aux); X } X break; X case pANY : X do { X if (MatchPattern(pat,str)) return TRUE; X } while (*++str); X if (pat[0].type == pEND || pat[0].type == pALT) return TRUE; X break; X case pNULL : X break; X case pSUB : X if (MatchPattern(pat,str)) return TRUE; X return MatchSub((pattern *)local->aux,pat,str,MatchRepeat); X case pEND : X break; X } X return MatchOne(pat,str); X} X X/* This function tries to match a single pattern against the given X string. It is up to the calling function to worry about alternation. */ X Xstatic BOOL MatchOne(pattern *pat, char *str) { X if (!str) return FALSE; X X while (pat->type != pEND && pat->type != pALT) { X switch (pat->type) { X case pSTRING: X if (strnicmp(str,pat->aux,strlen(pat->aux))) return FALSE; X str += strlen(pat->aux); X break; X case pREP : X return MatchRepeat(++pat,str); X case pANY : X if (!*str++) return FALSE; X break; X case pNULL : X break; X case pSUB : X return MatchSub((pattern *)pat->aux,pat+1,str,MatchPattern); X } X ++pat; X } X if (!*str) return TRUE; X return FALSE; X} X X/* This function matches a given string against a precompiled pattern. The X main function here doesn't do any actual matching; it just subdivides X a pattern into individual items based on any alternation used. */ X XBOOL MatchPattern(pattern *pat, char *str) { X if (!str) return FALSE; X X while (pat && pat->type != pEND) { X if (MatchOne(pat,str)) return TRUE; X X while (pat->type != pALT && pat->type != pEND) ++pat; X if (pat->type == pALT) ++pat; X } X return FALSE; X} X X/* ====================================================================== */ X END_OF_FILE if test 10288 -ne `wc -c <'pattern.h'`; then echo shar: \"'pattern.h'\" unpacked with wrong size! fi # end of 'pattern.h' fi if test -f 'yafrHead.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'yafrHead.h'\" else echo shar: Extracting \"'yafrHead.h'\" \(1409 characters\) sed "s/^X//" >'yafrHead.h' <<'END_OF_FILE' X#include X#include X#include X#include X#include X#include X X#include "WdwDefs.h" X Xextern struct IntuitionBase *IntuitionBase; Xextern struct GfxBase *GfxBase; Xextern struct DosLibrary *DOSBase; X X#define WORDROUND(xxx) (((long)xxx+3)>>2)<<2) /* Round to word boundary */ X#define D_S(name, type) char c_##name[sizeof(type)+3]; \ X type *name = (type *)WORDROUND(c_##name); X X#define XBorder 8 X#define YBorder 45 X X#define GN_CANCEL 0 X#define GN_NEWDIR 1 X#define GN_NEWDISK 2 X#define GN_OK 3 X#define GN_PARENT 4 X#define GN_RIEN 5 X#define GN_DONE 6 X Xstruct fibNode X { X struct FileInfoBlock fib; X struct fibNode *next,*prev; X ULONG num; X }; X Xstruct fibHeader X { X struct fibNode *directory,*first,*last,*current,*top; X ULONG curnum,firstnum; X }; X XUSHORT yafr_e_FilenamePenColor,yafr_e_DirnamePenColor; X X#define MAXPATHSTRING 140 Xchar absDir[MAXPATHSTRING]; Xchar absDirName[MAXPATHSTRING]; X Xstruct Gadget *FirstDisabled = NULL; /*The first ghosted gadget...*/ X X XBYTE IsDOSDisk(); Xvoid ResetGadgets(); Xvoid bstrcpy(); Xvoid ClearFileBox(); XBYTE Parentize(); Xvoid UpdateSlider(); Xvoid UpdateList(); Xvoid RewriteList(); XBYTE CheckExt(); XBYTE GetFib(); Xvoid CopyFIB(); Xvoid PrintFileName(); Xvoid RefreshGadget(); Xvoid FreeFuncMemory(); Xvoid PutDevicesInGadgets(); END_OF_FILE if test 1409 -ne `wc -c <'yafrHead.h'`; then echo shar: \"'yafrHead.h'\" unpacked with wrong size! fi # end of 'yafrHead.h' fi if test -f 'yftest.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'yftest.c'\" else echo shar: Extracting \"'yftest.c'\" \(939 characters\) sed "s/^X//" >'yftest.c' <<'END_OF_FILE' X/*- - - - - - - - -yftest -- a program for demoing YAFR - - - - - - - - - -*/ X X#include X#include X#include X Xstruct IntuitionBase *IntuitionBase; Xstruct GfxBase *GfxBase; X Xextern GetFilename(); X#define CRNT header.current->fib X Xmain() /*A temporary main()*/ X{ X char Name[33],Dir[150],Ext[18],CN[183]; X UBYTE status; X X OpenLibs(); X X Name[0]=NULL; X strcpy(Dir,"DF0:"); X strcpy(Ext,""); X status=GetFilename(Name,Dir,Ext,NULL,32,10,"Enter my filename",NULL,1,3,TRUE); X X CloseLibsAndExit(); /*Clean up*/ X} X XOpenLibs() X{ X if((IntuitionBase=(struct IntuitionBase *) X OpenLibrary("intuition.library",0))==NULL) X exit(10); X X if((GfxBase=(struct GfxBase *)OpenLibrary("graphics.library",0))==NULL) X { X CloseLibrary(IntuitionBase); X exit(20); X } X X} X XCloseLibsAndExit() X{ X CloseLibrary(GfxBase); X CloseLibrary(IntuitionBase); X exit(0); X} X END_OF_FILE if test 939 -ne `wc -c <'yftest.c'`; then echo shar: \"'yftest.c'\" unpacked with wrong size! fi # end of 'yftest.c' fi echo shar: End of archive 1 \(of 2\). cp /dev/null ark1isdone MISSING="" for I in 1 2 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked both archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0 -- Mail submissions (sources or binaries) to . Mail comments to the moderator at . Post requests for sources, and general discussion to comp.sys.amiga.