Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Option reorganisation, Part IV.



Here is the next step in using hashtable for options.  This depends on
Zefram's previous rewite in article 2612.

After this patch the optns array is no longer used.  Loops over this array
are replaced with scanhashtable and scanmatchtable calls.

After this patch it'll be quite easy to add new options dynamically.
This patch also decreases the memory used by zsh a little bit.

Only init.c, main.c and options.c needs to be recompiled for this patch, so
you can continue using your old modules.

Zoltan


begin 644 opt4.patch.gz
M'XL(`*11Q#(``^T\:W?:2+*?F5_1]NZ,P8$$\"N)D^S!6+%98_`%G'&<9#(R
M"*,Q2%Q))'$2[V^_5?V0^B5,)C.S>^Y9[ZQCJ:NJN^M=I98V-S=)/QH^"N>)
M'P;QPV&A]N3)[J-:_5%]E]1VG^[4GE;W"EL/:_"_^@^52B4/>H_4ZT^WJT]W
M=G_85'_PFFP]+N]L$WI)2)Q$BV%"@$K@SCSR!6[AS[$;3SKAR".!]RG9+Q0>
M;=*_B!^0"0R1X<2%/S<?<7"XC,@F4`!0A*4P(S=Q$62-@O@!FR7D(&S=)%C,
MKKR(4;K;AU\_L,D'[M74XT")>\5'`&\P\<C0#<+`'[K3E`JN/:$HE!+,^;>1
M-_8#CW3/!N^;_>-"H5@CSYX1Y_2\W1@X>*ND09V84"<FE`EDPER:0)<(1?<@
M`S;:;0#D2_S*%_&53?.54RII.`?=\U['85@9=(DJ!(KV,8&_*G^U:,=3]SK>
MYS<6`0KE"UP5&'J23N5.?3<F"9UPS'G0:O09L8*L)#8=8>3OR&+_3U<725%L
M>B)IB$5!,M6P:8:D$W^N2MBL?V>W7-O;$N8O4^ET.S(A6`CYB?PKHZ_/"O"X
M'1U8:+JZ<;[G0O73=E42K1^3R)MZ'UP0?!(2;[:8NG2`"EMAZYG3;#7:0."Q
M3"">A(OI"#3X`VC(E4=B+R%7MYR05RPQ0O!?G`#AH6040D45)?>XEH\7TRE3
MDU3K%D'L7P?>B`$S?4?0V/.(>Q5^X*!W9`CNF*EQ_(:NO'7IO"//T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