libenchant_myspell.so000075500000057310147207251740011005 0ustar00ELF>@W@8@DD `M`M `M  MM M @@$$Ptd>>>QtdRtd`M`M `M GNUUöWPM[` t=8 @E=BHb7xW6|BEcGvV?qX?\4Tk.kݜ8Tk[q-  u a Q C1l w:B8 R"vZIS fK|~QKx< P"km  $=R *R ` p 2c" p9 " 81R " 8  |= O  O p__gmon_start___init_fini_ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalize_Jv_RegisterClassesg_freeg_strfreev_ZNSsC1ERKSs_ZNSs12_M_leak_hardEv_ZNSs7replaceEmmPKcmg_file_test_ZNSs4_Rep20_S_empty_rep_storageE__stack_chk_fail_ZNSs4_Rep10_M_destroyERKSaIcE_ZNSs4_Rep10_M_disposeERKSaIcE_Unwind_Resume__gxx_personality_v0_ZN14MySpellCheckerC2EP18str_enchant_broker_ZN14MySpellCheckerC1EP18str_enchant_broker_ZN14MySpellCheckerD2Ev_ZN8HunspellD1Ev_ZdlPvg_iconv_close_ZN14MySpellCheckerD1Ev_ZN14MySpellChecker9checkWordEPKcmg_utf8_normalizestrleng_iconv_ZN8Hunspell5spellEPKcPiPPc_ZN14MySpellChecker11suggestWordEPKcmPm_ZN8Hunspell7suggestEPPPcPKcg_malloc0_ng_malloc0init_enchant_provider_ZNSt6vectorISsSaISsEED2Ev_ZNSt6vectorISsSaISsEED1Ev_ZNSt6vectorISsSaISsEE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPSsS1_EERKSs_ZNSs6assignERKSs_Znwm__cxa_begin_catch__cxa_rethrow__cxa_end_catchenchant_get_user_config_dirsg_build_filenameg_slist_appendg_slist_foreachg_slist_freeg_get_system_data_dirsenchant_get_registry_valueenchant_get_prefix_dirg_strdupenchant_get_dirs_from_param_ZNSsC1EPKcRKSaIcEg_dir_openg_filename_to_utf8g_dir_read_nameg_dir_close_ZNKSs5rfindEPKcmm_ZNKSs7compareEmmPKc_ZNSsC1ERKSsmm_ZNSs6appendEPKcmg_strconcat_ZN14MySpellChecker17requestDictionaryEPKcstrncmpispunct_ZN8HunspellC1EPKcS1_S1__ZN8Hunspell16get_dic_encodingEvg_iconv_open__pthread_key_createlibhunspell-1.3.so.0libenchant.so.1libgmodule-2.0.so.0libglib-2.0.so.0libstdc++.so.6libm.so.6libc.so.6libgcc_s.so.1_edata__bss_start_endlibenchant_myspell.soGCC_3.0GLIBC_2.4GLIBC_2.2.5CXXABI_1.3GLIBCXX_3.4 P&y X0ii `ui jӯkvt)`M hM `xM xM O O  O  O O O O )O /Q 4P  P (P 0P 8P @P HP PP  XP  `P  hP  pP xP BP IP P P P P P P CP P P P P P P P Q JQ Q  Q ! Q "(Q #0Q $8Q %@Q &HQ 'PQ >XQ (`Q LhQ *pQ +xQ ,Q -Q .Q 0Q 1Q 2Q FQ 3Q 5Q 6Q 7Q 8Q 9Q :Q ;Q <HH7 HtH57 %7 @%7 h%7 h%7 h%7 h%7 h%7 h%7 h%7 hp%7 h`%7 h P%7 h @%7 h 0%7 h %z7 h %r7 h%j7 h%b7 h%Z7 h%R7 h%J7 h%B7 h%:7 h%27 h%*7 hp%"7 h`%7 hP%7 h@% 7 h0%7 h %6 h%6 h%6 h%6 h %6 h!%6 h"%6 h#%6 h$%6 h%%6 h&%6 h'p%6 h(`%6 h)P%6 h*@%6 h+0%6 h, %z6 h-%r6 h.%j6 h/%b6 h0%Z6 h1%R6 h2%J6 h3%B6 h4%:6 h5%26 h6%*6 h7p%"6 h8`%6 h9P%6 h:@% 6 h;0H6 H=6 UH)HHw]H3 Ht]@H5 H=5 UH)HHHH?HHu]H3 Ht]H@=5 u'H=w3 UHt H=0 h]p5 fffff.H=0 t&H3 HtUH=0 H]WKf.H H +ff.HUHSH8H\$ dH%(HD$(1HHD$ HHBHD$ PHHhH#HD$ HHpHHH F H)AH)HH|$ HT$ HzH;=)2 u0HL$(dH3 %(uH8[]HHhHH=1 HOtEHt$D$ D$ HSHHD$ Ht$HxtHHxjPJHHLd$?H$HHD$`Ht$?H$Hx(HH$뜋PJHfAWHAVAUIATUHSHXL?LwdH%(HD$H1M9HD$0L%" LH$fDHHBL9HI9uH<$L}HHD$0HD$8HD$@lH5v1L1IHT$0HD$8H)HHHD$1L|$Ll$ HD$P@LHEHHEHD$ HxH;=4" L^HT$0HD$8HH)HH9sDHGtH$HL$1LH<1HT$H|$HHAH|$'HT$`HzH;= ALAL$H$BL H$H$HD$ HH)HH9D$ HI1I9t2L-y Ld$`@HEHxL9FHL9uL$MtLLt$xHl$pI9L-' Ld$`f.HEHxL9ZHI9uH|$pHtHHHHHHDafft&&1HHHI#HD$(L`HHL|$(IHtWH5QHHH=?IHIGH$dH3 %(ujHĸ[]A\A]A^A_1H=  HWLHH|$04H|$8*HbHXHLmHEH= HWLzvHHD$`Ht$^Hx/|H1PJHJH=8 HOt8@Ht$@D$LD$L)PJHpJqrffff.ATIUH SLHuHHHtXLHuHHY1[]A\fhvHH HHPHH[]A\1HHHfAVAUIATUSHHoHdH%(HD$1H9tUL% Lt$fHHzL9u9HH9uI}HtHD$dH3%(u7H[]A\A]A^HH= HOtL1Jqr@AWAVAUIATUHSHHHHdH%(HD$81H;{Ht HwHCLd$0HHHCLHkH]HL)HH~fHsHHHuLLHD$0HxH;= HD$8dH3%(HH[]A\A]A^A_HH)HHII)IH<HT$IKHHD$t H|$HL#LM9t&fHt LHIHM9uLsHEMHD$HM9t$Ht LHhIHM9uLkL#LM9t)L5 HT$0I$HxL9IM9uH;HtiHD$L;HkIHCH?II)IH9v9HHHD$HHD$0Ht$/HxHHH9wHHD$E1H= HW*Ht$/H= HOHHT$HT$HMLQHLd$0HD$H9HtHLHHx/H9uuPJHJHLLd$0I9tHLHHxH9u3H+HHqp*H H3H|$t+L9|$LLd$0t5HLHHxH9\$uLd$0HD$LH8HgMHHHHMyspell ProviderdictsData_DirMyspellenchantshare/usr/share/myspell.dichyph_.affUTF-8enchant.myspell.dictionary.path;0Hh(h8H@8hHzRx $8FJ w?;*3$"D\tzPLRx}  ,$AADDP AAI 4 OAAG u AAH DAA$D/ADD \DA<lBBA A(P (A ABBA xDOL$BBB B(A0J8G 8A0A(B BBBB `,XkDfDDBBE A(A0D@h 0A(A BBBA L 7BBB E(A0D8G 8A0A(B BBBA L<H3BBE B(A0D8Dpy 8A0A(B BBBA TBBB B(A0A8G 8A0A(B BBBI TpBEB E(A0D8D 8A0A(B BBBA D<BEB A(A0Dp 0A(A BBBA TcBEB B(A0D8G 8A0A(B BBBA <WBDI { ABC d ABI !9aI=>!}_7    -    #@Fa)az  &5  .i`xM B  |=`M hM o `  P `@  ooo&oM 6FVfv&6FVfv&6FVfv&6FVfvlibenchant_myspell.so.debugI7zXZִF!t/ ]?Eh=ڊ2N O$qRxVjNoqtuJk]S$f3 VkY/u{$Čg9G|BX Ea|(W6YXz^i&l)}ҤcLic Q TXx6lS$AJj * @VMWsiqLQ]R9V|Hm:V<se>G)\0l59p8jQǁè)VJ};=˾_ݻY(0XEN3bYx,Ev滈ImupH?IQ3絇$@@nb+ac.D,g89N@ӧe]<@gM; Q7|Fgu+SMkl}thrק)1RżJkDVh(f#pr0f}q^ d/Jn(<N!ߛTid{N\)@vU6lzĶ$Z8B!}gYZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.gcc_except_table.init_array.fini_array.jcr.data.rel.ro.dynamic.got.got.plt.data.bss.gnu_debuglink.gnu_debugdata $ol( ``80 8o&&EoT@@ ^`` hc  n!t|=|= z2==>>>>CC5`M `MhM hMpM pMxM xMM M@O O@P PQ QR RR  RLlVusr/bin/enchant000075500000036450147207357150007516 0ustar00ELF>,@@5@8 @@@@@@88@8@@@(( --`-`| --`-`TT@T@DDPtd@'@'@@'@<<QtdRtd--`-`00/lib64/ld-linux-x86-64.so.2GNU GNURI&!gaUY*!  @*/8(BEj Cֺ|i : fUaK2bqXj|9 *@q -H:J YyM]hw   .P1`L1`$H1`x1``1`& H1`X1`1` @@ @e* ,@L1` @@  @h1` @ @D @libenchant.so.1_ITM_deregisterTMCloneTableg_slist_freeg_utf8_get_char__gmon_start__g_unichar_typeg_slist_append_Jv_RegisterClassesg_strdup_ITM_registerTMCloneTableg_utf8_skipenchant_broker_request_dictenchant_fopenenchant_broker_free_dictenchant_dict_checkenchant_get_user_languageenchant_dict_free_string_listenchant_dict_suggestenchant_broker_freeenchant_broker_initlibgmodule-2.0.so.0libglib-2.0.so.0g_string_assigng_string_append_unicharg_string_freeg_utf8_pointer_to_offsetg_locale_to_utf8g_locale_from_utf8g_string_new_leng_string_insert_cg_string_newg_string_truncatelibpthread.so.0libc.so.6fflushexitsetlocale__stack_chk_failstdinfgetcstrlen__fprintf_chkstdoutfputcfclosestderrfwritestrcmp__libc_start_main_edata__bss_start_end__libc_csu_fini__data_start_IO_stdin_used__libc_csu_initGLIBC_2.3.4GLIBC_2.4GLIBC_2.2.5oti Pii \ui f/`P1`*X1`0`1`.h1`70` 0`(0`00`80`@0`H0`P0` X0` `0` h0` p0` x0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`1` 1`!1`"1`# 1`$(1`%01`'81`(@1`)HHE HtCH52 %4 @%2 h%* h%" h% h% h%  h% h% hp% h`% h P% h @% h 0% h % h % h% h% h% h% h% h% h% h% h%z hp%r h`%j hP%b h@%Z h0%R h %J h%B h%: h%2 h %* h!%" h"% h#% h$%  h%AWAVI @AUAATUSHdH%(HD$x1H HD$A1D$8H$E1D$<D 9~SMHcM H1p @HHHH@$@HiHUuHHH$@HIHHHD$PHHD$@H31 |$<IHD$(D$[1@1L6fDH|$v tIFHPI;VTIIV@,IIF uIv1D$HY|$8H\$(H1LH|$0D$VH\$PHt$@H$H1LH|$Ht H|$KHL$xdH3 %()HĈ[]A\A]A^A_AGHL$pHT$hE1HHtLHQHIF|$8H\$(Hs1IE1HD$ IM~M9u;lM.HLHH$PL9<$rESH HHH&HLL9H$;\ wL9<$;L,$t39AǍ@ z @9hA^ID$ƃI$Hc<2'hHFH\$E1HfI$HL)I<0'u LD9yH\$It$HI<$H|$ HH4$H1LHD$ M~M9LLl$ 1H|$ \$[Ll$l$HމI;FId;)ID$ƃ[HL,$9IWHvI7H|$@H|$(tiL$( @L1@IWI7H|$@gH|$(u^I7LL @L @y|$<MD$<L$( @L1QIWI7HL$pH|$@McH|$pHD$ L$H @H|$(XI7LL$pE1 @LE1H|$ptel$\Hl$  @IL;t$psAL ;JtLHD$pLHI9u @Y봋l$\Ht$ H|$@4]|$<MD$<AvH= ʾ"@1HH @H|$(u'I7LD @L1L$( @L1뿋L$( @L1|$<H IX#@1H[Hٺ @4Hٺ!#@Hٺ @Hٺ @Hٺ @Hٺ#@1HT$HLyHHD$dH3%(u.H []A\HLH¾H5f.@AWAAVIAUIATL% UH- SL)1HHHtLLDAHH9uH[]A\A]A^A_ff.fHHamerican1.6.0 -a lists alternatives. -l lists misspellings. -m is ignored. -L displays line numbers. rb'* %u * # %u & %u %u:,en_USbrazilianpt_BRbritishen_GBbulgarianbgcatalacacatalandanishdadanskdeutschdedutchnlellhnikaelespanolesperantoeoestonianetfaeroesefofinnishfifrancaisfrfrenchgalicianglgermanhungarianhuinterlinguaiairishgaitalianitlietuviultlithuanianmlatinnederlandsnonorwegiannynorsknnpolishplportuguesptportugueserussianrusardinianscslovakslovenianslslovenskospanishsuomisvenskasvswedishswissde_CHukrainianukyiddish-yivoyi-%c does not take any parameters. @(#) International Ispell Version 3.1.20 (but really Enchant %s) Usage: %s [options] -a|-d dict|-l|-L|-m|-v[v]| -d dict uses dictionary . -v displays program version. Error: Could not open the file "%s" for reading. Couldn't create a dictionary for %s p @!@!@!@!@!@$!@.!@1!@8!@;!@8!@C!@J!@M!@J!@S!@[!@^!@d!@g!@p!@s!@S"@{!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@[!@!@!@!@!@!@!@!@!@"@5!@"@ "@ "@ "@"@5!@"@d!@9"@*"@-"@*"@7"@?"@B"@I"@L"@V"@Y"@V"@d"@l"@o"@y"@|"@P!@"@"@"@"@"@S"@"@!@"@"@"@"@"@"@"@"@"@"@;<X8zRx *zRx $pFJ w?;*3$"4D(BGN D@X  AABI L| BBJ J(A0A8G 8A0A(B BBBA DPeBEE E(H0H8M@l8A0A(B BBBx@@_o @ D @-`-`o@x@@ r 0` @ @x o` @oo @-`@@@@&@6@F@V@f@v@@@@@@@@@@@&@6@F@V@f@v@@@@@@@@@@@&@6@enchant.debug~r7zXZִF!t/1]?Eh=ڊ̓N{^r; څї؍(6+b +i`(ە[ѪSä l+d>%|F9HQ >fGE"`zoHNLUTY"y  j`/vp-8Jpw$11i DbiUҘ2Z`ydW,LqK:(',^o9雝>GIX0|(r0G3|qoRΤ<1% z=HSZ~i@n0Tޟ ctddЍIQqm9ח"lͣ,5YϱC,/lEH]G~%T4B4 p~\߼ Y<5`eJZ'PDS:/`0<ڍ],v=C9\fof=o,BSR-žNzn1ޟG`8zbܘƌ~F8Zy\~C1yplfr8={NXC Fvc?"?2vgȆoy֑y=^ubĊUxԴ+(Cљ!gJkʊőnc=?#`gŵU_"yڅx^ ) 5$[bн0V|/VS'j/Oǚ͢xef,ΡB\ӥ:P Cz> J2W9zp -TxŽzMp}!gYZ.shstrtab.interp.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.jcr.dynamic.got.got.plt.data.bss.gnu_debuglink.gnu_debugdata 8@8T@T !t@t$4o@l> @pFx@xrNo @ t[o` @` @j @ xt @  ~@y@p@@@ D @D ` @`  @'@@'<'@'\-`--`--`--`-/`/0`0HH1`H1P1`L1(L1`1t4 enchant.ordering000064400000000247147221300360007720 0ustar00*:myspell,aspell,ispell fi:voikko,ispell,myspell,aspell fi_FI:voikko,ispell,myspell,aspell he:hspell,myspell he_IL:hspell,myspell yi:uspell tr:zemberek tr_TR:zemberek enchant.c000064400000062010147577127720006352 0ustar00/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available at through the world-wide-web at | | http://www.php.net/license/3_0.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Pierre-Alain Joye | | Ilia Alshanetsky | +----------------------------------------------------------------------+ $Id: 2b1a7a0910b094a8f56f81d474ff1837c4389a28 $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" #include #include "php_enchant.h" typedef EnchantBroker * EnchantBrokerPtr; typedef struct _broker_struct enchant_broker; typedef struct _dict_struct enchant_dict; typedef enchant_broker * enchant_brokerPtr; typedef enchant_dict * enchant_dictPtr; typedef struct _broker_struct { EnchantBroker *pbroker; enchant_dict **dict; unsigned int dictcnt; long rsrc_id; } _enchant_broker; typedef struct _dict_struct { unsigned int id; EnchantDict *pdict; enchant_broker *pbroker; long rsrc_id; enchant_dict *next; enchant_dict *prev; } _enchant_dict; /* True global resources - no need for thread safety here */ static int le_enchant_broker; static int le_enchant_dict; /* If you declare any globals in php_enchant.h uncomment this:*/ /*ZEND_DECLARE_MODULE_GLOBALS(enchant)*/ #define PHP_ENCHANT_MYSPELL 1 #define PHP_ENCHANT_ISPELL 2 /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO(arginfo_enchant_broker_init, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_enchant_broker_free, 0, 0, 1) ZEND_ARG_INFO(0, broker) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_enchant_broker_set_dict_path, 0, 0, 3) ZEND_ARG_INFO(0, broker) ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_enchant_broker_get_dict_path, 0, 0, 2) ZEND_ARG_INFO(0, broker) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_enchant_broker_request_dict, 0, 0, 2) ZEND_ARG_INFO(0, broker) ZEND_ARG_INFO(0, tag) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_enchant_broker_request_pwl_dict, 0, 0, 2) ZEND_ARG_INFO(0, broker) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_enchant_broker_free_dict, 0, 0, 1) ZEND_ARG_INFO(0, dict) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_enchant_broker_set_ordering, 0, 0, 3) ZEND_ARG_INFO(0, broker) ZEND_ARG_INFO(0, tag) ZEND_ARG_INFO(0, ordering) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_enchant_dict_quick_check, 0, 0, 2) ZEND_ARG_INFO(0, dict) ZEND_ARG_INFO(0, word) ZEND_ARG_INFO(1, suggestions) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_enchant_dict_check, 0, 0, 2) ZEND_ARG_INFO(0, dict) ZEND_ARG_INFO(0, word) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_enchant_dict_store_replacement, 0, 0, 3) ZEND_ARG_INFO(0, dict) ZEND_ARG_INFO(0, mis) ZEND_ARG_INFO(0, cor) ZEND_END_ARG_INFO() /* }}} */ /* {{{ enchant_functions[] * * Every user visible function must have an entry in enchant_functions[]. */ zend_function_entry enchant_functions[] = { PHP_FE(enchant_broker_init, arginfo_enchant_broker_init) PHP_FE(enchant_broker_free, arginfo_enchant_broker_free) PHP_FE(enchant_broker_get_error, arginfo_enchant_broker_free) PHP_FE(enchant_broker_set_dict_path, arginfo_enchant_broker_set_dict_path) PHP_FE(enchant_broker_get_dict_path, arginfo_enchant_broker_get_dict_path) PHP_FE(enchant_broker_list_dicts, arginfo_enchant_broker_free) PHP_FE(enchant_broker_request_dict, arginfo_enchant_broker_request_dict) PHP_FE(enchant_broker_request_pwl_dict, arginfo_enchant_broker_request_pwl_dict) PHP_FE(enchant_broker_free_dict, arginfo_enchant_broker_free_dict) PHP_FE(enchant_broker_dict_exists, arginfo_enchant_broker_request_dict) PHP_FE(enchant_broker_set_ordering, arginfo_enchant_broker_set_ordering) PHP_FE(enchant_broker_describe, arginfo_enchant_broker_free) PHP_FE(enchant_dict_check, arginfo_enchant_dict_check) PHP_FE(enchant_dict_suggest, arginfo_enchant_dict_check) PHP_FE(enchant_dict_add_to_personal, arginfo_enchant_dict_check) PHP_FE(enchant_dict_add_to_session, arginfo_enchant_dict_check) PHP_FE(enchant_dict_is_in_session, arginfo_enchant_dict_check) PHP_FE(enchant_dict_store_replacement, arginfo_enchant_dict_store_replacement) PHP_FE(enchant_dict_get_error, arginfo_enchant_broker_free_dict) PHP_FE(enchant_dict_describe, arginfo_enchant_broker_free_dict) PHP_FE(enchant_dict_quick_check, arginfo_enchant_dict_quick_check) PHP_FE_END }; /* }}} */ /* {{{ enchant_module_entry */ zend_module_entry enchant_module_entry = { #if ZEND_MODULE_API_NO >= 20010901 STANDARD_MODULE_HEADER, #endif "enchant", enchant_functions, PHP_MINIT(enchant), PHP_MSHUTDOWN(enchant), NULL, /* Replace with NULL if there's nothing to do at request start */ NULL, /* Replace with NULL if there's nothing to do at request end */ PHP_MINFO(enchant), #if ZEND_MODULE_API_NO >= 20010901 PHP_ENCHANT_VERSION, #endif STANDARD_MODULE_PROPERTIES }; /* }}} */ #ifdef COMPILE_DL_ENCHANT ZEND_GET_MODULE(enchant) #endif static void enumerate_providers_fn (const char * const name, const char * const desc, const char * const file, void * ud) /* {{{ */ { zval *zdesc = (zval *) ud; zval *tmp_array; MAKE_STD_ZVAL(tmp_array); array_init(tmp_array); add_assoc_string(tmp_array, "name", (char *)name, 1); add_assoc_string(tmp_array, "desc", (char *)desc, 1); add_assoc_string(tmp_array, "file", (char *)file, 1); if (Z_TYPE_P(zdesc)!=IS_ARRAY) { array_init(zdesc); } add_next_index_zval(zdesc, tmp_array); } /* }}} */ static void describe_dict_fn (const char * const lang, const char * const name, const char * const desc, const char * const file, void * ud) /* {{{ */ { zval *zdesc = (zval *) ud; array_init(zdesc); add_assoc_string(zdesc, "lang", (char *)lang, 1); add_assoc_string(zdesc, "name", (char *)name, 1); add_assoc_string(zdesc, "desc", (char *)desc, 1); add_assoc_string(zdesc, "file", (char *)file, 1); } /* }}} */ static void php_enchant_list_dicts_fn( const char * const lang_tag, const char * const provider_name, const char * const provider_desc, const char * const provider_file, void * ud) /* {{{ */ { zval *zdesc = (zval *) ud; zval *tmp_array; MAKE_STD_ZVAL(tmp_array); array_init(tmp_array); add_assoc_string(tmp_array, "lang_tag", (char *)lang_tag, 1); add_assoc_string(tmp_array, "provider_name", (char *)provider_name, 1); add_assoc_string(tmp_array, "provider_desc", (char *)provider_desc, 1); add_assoc_string(tmp_array, "provider_file", (char *)provider_file, 1); if (Z_TYPE_P(zdesc) != IS_ARRAY) { array_init(zdesc); } add_next_index_zval(zdesc, tmp_array); } /* }}} */ static void php_enchant_broker_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ { if (rsrc->ptr) { enchant_broker *broker = (enchant_broker *)rsrc->ptr; if (broker) { if (broker->pbroker) { if (broker->dictcnt && broker->dict) { if (broker->dict) { int total; total = broker->dictcnt-1; do { zend_list_delete(broker->dict[total]->rsrc_id); efree(broker->dict[total]); total--; } while (total>=0); } efree(broker->dict); broker->dict = NULL; } enchant_broker_free(broker->pbroker); } efree(broker); } } } /* }}} */ static void php_enchant_dict_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ { if (rsrc->ptr) { enchant_dict *pdict = (enchant_dict *)rsrc->ptr; if (pdict) { if (pdict->pdict && pdict->pbroker) { enchant_broker_free_dict(pdict->pbroker->pbroker, pdict->pdict); if (pdict->id) { pdict->pbroker->dict[pdict->id-1]->next = NULL; } zend_list_delete(pdict->pbroker->rsrc_id); } } } } /* }}} */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(enchant) { le_enchant_broker = zend_register_list_destructors_ex(php_enchant_broker_free, NULL, "enchant_broker", module_number); le_enchant_dict = zend_register_list_destructors_ex(php_enchant_dict_free, NULL, "enchant_dict", module_number); REGISTER_LONG_CONSTANT("ENCHANT_MYSPELL", PHP_ENCHANT_MYSPELL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("ENCHANT_ISPELL", PHP_ENCHANT_ISPELL, CONST_CS | CONST_PERSISTENT); return SUCCESS; } /* }}} */ /* {{{ PHP_MSHUTDOWN_FUNCTION */ PHP_MSHUTDOWN_FUNCTION(enchant) { return SUCCESS; } /* }}} */ static void __enumerate_providers_fn (const char * const name, const char * const desc, const char * const file, void * ud) /* {{{ */ { php_info_print_table_row(3, name, desc, file); } /* }}} */ /* {{{ PHP_MINFO_FUNCTION */ PHP_MINFO_FUNCTION(enchant) { EnchantBroker *pbroker; pbroker = enchant_broker_init(); php_info_print_table_start(); php_info_print_table_header(2, "enchant support", "enabled"); php_info_print_table_row(2, "Version", PHP_ENCHANT_VERSION); #ifdef ENCHANT_VERSION_STRING php_info_print_table_row(2, "Libenchant Version", ENCHANT_VERSION_STRING); #elif defined(HAVE_ENCHANT_BROKER_SET_PARAM) php_info_print_table_row(2, "Libenchant Version", "1.5.0 or later"); #endif php_info_print_table_row(2, "Revision", "$Id: 2b1a7a0910b094a8f56f81d474ff1837c4389a28 $"); php_info_print_table_end(); php_info_print_table_start(); enchant_broker_describe(pbroker, __enumerate_providers_fn, NULL); php_info_print_table_end(); enchant_broker_free(pbroker); } /* }}} */ #define PHP_ENCHANT_GET_BROKER \ ZEND_FETCH_RESOURCE(pbroker, enchant_broker *, &broker, -1, "enchant_broker", le_enchant_broker); \ if (!pbroker || !pbroker->pbroker) { \ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Resource broker invalid"); \ RETURN_FALSE; \ } #define PHP_ENCHANT_GET_DICT \ ZEND_FETCH_RESOURCE(pdict, enchant_dict *, &dict, -1, "enchant_dict", le_enchant_dict); \ if (!pdict || !pdict->pdict) { \ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Invalid dictionary resource."); \ RETURN_FALSE; \ } /* {{{ proto resource enchant_broker_init() create a new broker object capable of requesting */ PHP_FUNCTION(enchant_broker_init) { enchant_broker *broker; EnchantBroker *pbroker; if (zend_parse_parameters_none() == FAILURE) { return; } pbroker = enchant_broker_init(); if (pbroker) { broker = (enchant_broker *) emalloc(sizeof(enchant_broker)); broker->pbroker = pbroker; broker->dict = NULL; broker->dictcnt = 0; broker->rsrc_id = ZEND_REGISTER_RESOURCE(return_value, broker, le_enchant_broker); } else { RETURN_FALSE; } } /* }}} */ /* {{{ proto boolean enchant_broker_free(resource broker) Destroys the broker object and its dictionnaries */ PHP_FUNCTION(enchant_broker_free) { zval *broker; enchant_broker *pbroker; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_BROKER; zend_list_delete(Z_RESVAL_P(broker)); RETURN_TRUE; } /* }}} */ /* {{{ proto string enchant_broker_get_error(resource broker) Returns the last error of the broker */ PHP_FUNCTION(enchant_broker_get_error) { zval *broker; enchant_broker *pbroker; char *msg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_BROKER; msg = enchant_broker_get_error(pbroker->pbroker); if (msg) { RETURN_STRING((char *)msg, 1); } RETURN_FALSE; } /* }}} */ #if HAVE_ENCHANT_BROKER_SET_PARAM /* {{{ proto bool enchant_broker_set_dict_path(resource broker, int dict_type, string value) Set the directory path for a given backend, works with ispell and myspell */ PHP_FUNCTION(enchant_broker_set_dict_path) { zval *broker; enchant_broker *pbroker; long dict_type; char *value; int value_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls", &broker, &dict_type, &value, &value_len) == FAILURE) { RETURN_FALSE; } if (!value_len) { RETURN_FALSE; } PHP_ENCHANT_GET_BROKER; switch (dict_type) { case PHP_ENCHANT_MYSPELL: PHP_ENCHANT_GET_BROKER; enchant_broker_set_param(pbroker->pbroker, "enchant.myspell.dictionary.path", (const char *)value); RETURN_TRUE; break; case PHP_ENCHANT_ISPELL: PHP_ENCHANT_GET_BROKER; enchant_broker_set_param(pbroker->pbroker, "enchant.ispell.dictionary.path", (const char *)value); RETURN_TRUE; break; default: RETURN_FALSE; } } /* }}} */ /* {{{ proto string enchant_broker_get_dict_path(resource broker, int dict_type) Get the directory path for a given backend, works with ispell and myspell */ PHP_FUNCTION(enchant_broker_get_dict_path) { zval *broker; enchant_broker *pbroker; long dict_type; char *value; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &broker, &dict_type) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_BROKER; switch (dict_type) { case PHP_ENCHANT_MYSPELL: PHP_ENCHANT_GET_BROKER; value = enchant_broker_get_param(pbroker->pbroker, "enchant.myspell.dictionary.path"); break; case PHP_ENCHANT_ISPELL: PHP_ENCHANT_GET_BROKER; value = enchant_broker_get_param(pbroker->pbroker, "enchant.ispell.dictionary.path"); break; default: RETURN_FALSE; } RETURN_STRING(value, 1); } /* }}} */ #else /* {{{ proto bool enchant_broker_set_dict_path(resource broker, int dict_type, string value) Set the directory path for a given backend, works with ispell and myspell */ PHP_FUNCTION(enchant_broker_set_dict_path) { RETURN_FALSE; } /* }}} */ /* {{{ proto string enchant_broker_get_dict_path(resource broker, int dict_type) Get the directory path for a given backend, works with ispell and myspell */ PHP_FUNCTION(enchant_broker_get_dict_path) { RETURN_FALSE; } /* }}} */ #endif /* {{{ proto string enchant_broker_list_dicts(resource broker) Lists the dictionaries available for the given broker */ PHP_FUNCTION(enchant_broker_list_dicts) { zval *broker; enchant_broker *pbroker; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_BROKER; enchant_broker_list_dicts(pbroker->pbroker, php_enchant_list_dicts_fn, (void *)return_value); } /* }}} */ /* {{{ proto resource enchant_broker_request_dict(resource broker, string tag) create a new dictionary using tag, the non-empty language tag you wish to request a dictionary for ("en_US", "de_DE", ...) */ PHP_FUNCTION(enchant_broker_request_dict) { zval *broker; enchant_broker *pbroker; enchant_dict *dict; EnchantDict *d; char *tag; int taglen; int pos; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_BROKER; if (taglen == 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tag cannot be empty"); RETURN_FALSE; } d = enchant_broker_request_dict(pbroker->pbroker, (const char *)tag); if (d) { pos = pbroker->dictcnt++; if (pbroker->dictcnt) { pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt); } else { pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *)); pos = 0; } dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict)); dict->id = pos; dict->pbroker = pbroker; dict->pdict = d; dict->prev = pos ? pbroker->dict[pos-1] : NULL; dict->next = NULL; pbroker->dict[pos] = dict; if (pos) { pbroker->dict[pos-1]->next = dict; } dict->rsrc_id = ZEND_REGISTER_RESOURCE(return_value, dict, le_enchant_dict); zend_list_addref(pbroker->rsrc_id); } else { RETURN_FALSE; } } /* }}} */ /* {{{ proto resource enchant_broker_request_pwl_dict(resource broker, string filename) creates a dictionary using a PWL file. A PWL file is personal word file one word per line. It must exist before the call.*/ PHP_FUNCTION(enchant_broker_request_pwl_dict) { zval *broker; enchant_broker *pbroker; enchant_dict *dict; EnchantDict *d; char *pwl; int pwllen; int pos; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &broker, &pwl, &pwllen) == FAILURE) { RETURN_FALSE; } #if PHP_API_VERSION < 20100412 if ((PG(safe_mode) && (!php_checkuid(pwl, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(pwl TSRMLS_CC)) { #else if (php_check_open_basedir(pwl TSRMLS_CC)) { #endif RETURN_FALSE; } PHP_ENCHANT_GET_BROKER; d = enchant_broker_request_pwl_dict(pbroker->pbroker, (const char *)pwl); if (d) { pos = pbroker->dictcnt++; if (pbroker->dictcnt) { pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt); } else { pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *)); pos = 0; } dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict)); dict->id = pos; dict->pbroker = pbroker; dict->pdict = d; dict->prev = pos?pbroker->dict[pos-1]:NULL; dict->next = NULL; pbroker->dict[pos] = dict; if (pos) { pbroker->dict[pos-1]->next = dict; } dict->rsrc_id = ZEND_REGISTER_RESOURCE(return_value, dict, le_enchant_dict); } else { RETURN_FALSE; } } /* }}} */ /* {{{ proto resource enchant_broker_free_dict(resource dict) Free the dictionary resource */ PHP_FUNCTION(enchant_broker_free_dict) { zval *dict; enchant_dict *pdict; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_DICT; zend_list_delete(Z_RESVAL_P(dict)); RETURN_TRUE; } /* }}} */ /* {{{ proto bool enchant_broker_dict_exists(resource broker, string tag) Whether a dictionary exists or not. Using non-empty tag */ PHP_FUNCTION(enchant_broker_dict_exists) { zval *broker; char *tag; int taglen; enchant_broker * pbroker; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_BROKER; RETURN_BOOL(enchant_broker_dict_exists(pbroker->pbroker, tag)); } /* }}} */ /* {{{ proto bool enchant_broker_set_ordering(resource broker, string tag, string ordering) Declares a preference of dictionaries to use for the language described/referred to by 'tag'. The ordering is a comma delimited list of provider names. As a special exception, the "*" tag can be used as a language tag to declare a default ordering for any language that does not explicitly declare an ordering. */ PHP_FUNCTION(enchant_broker_set_ordering) { zval *broker; char *pordering; int porderinglen; char *ptag; int ptaglen; enchant_broker * pbroker; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &broker, &ptag, &ptaglen, &pordering, &porderinglen) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_BROKER; enchant_broker_set_ordering(pbroker->pbroker, ptag, pordering); RETURN_TRUE; } /* }}} */ /* {{{ proto array enchant_broker_describe(resource broker) Enumerates the Enchant providers and tells you some rudimentary information about them. The same info is provided through phpinfo() */ PHP_FUNCTION(enchant_broker_describe) { EnchantBrokerDescribeFn describetozval = enumerate_providers_fn; zval *broker; enchant_broker * pbroker; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_BROKER; enchant_broker_describe(pbroker->pbroker, describetozval, (void *)return_value); } /* }}} */ /* {{{ proto bool enchant_dict_quick_check(resource dict, string word [, array &suggestions]) If the word is correctly spelled return true, otherwise return false, if suggestions variable is provided, fill it with spelling alternatives. */ PHP_FUNCTION(enchant_dict_quick_check) { zval *dict, *sugg = NULL; char *word; int wordlen; enchant_dict *pdict; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|z/", &dict, &word, &wordlen, &sugg) == FAILURE) { RETURN_FALSE; } if (sugg) { zval_dtor(sugg); array_init(sugg); } PHP_ENCHANT_GET_DICT; if (enchant_dict_check(pdict->pdict, word, wordlen) > 0) { int n_sugg; size_t n_sugg_st; char **suggs; if (!sugg && ZEND_NUM_ARGS() == 2) { RETURN_FALSE; } suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg_st); memcpy(&n_sugg, &n_sugg_st, sizeof(n_sugg)); if (suggs && n_sugg) { int i; for (i = 0; i < n_sugg; i++) { add_next_index_string(sugg, suggs[i], 1); } enchant_dict_free_suggestions(pdict->pdict, suggs); } RETURN_FALSE; } RETURN_TRUE; } /* }}} */ /* {{{ proto bool enchant_dict_check(resource dict, string word) If the word is correctly spelled return true, otherwise return false */ PHP_FUNCTION(enchant_dict_check) { zval *dict; char *word; int wordlen; enchant_dict *pdict; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_DICT; RETURN_BOOL(!enchant_dict_check(pdict->pdict, word, wordlen)); } /* }}} */ /* {{{ proto array enchant_dict_suggest(resource dict, string word) Will return a list of values if any of those pre-conditions are not met.*/ PHP_FUNCTION(enchant_dict_suggest) { zval *dict; char *word; int wordlen; char **suggs; enchant_dict *pdict; int n_sugg; size_t n_sugg_st; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_DICT; suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg_st); memcpy(&n_sugg, &n_sugg_st, sizeof(n_sugg)); if (suggs && n_sugg) { int i; array_init(return_value); for (i = 0; i < n_sugg; i++) { add_next_index_string(return_value, suggs[i], 1); } enchant_dict_free_suggestions(pdict->pdict, suggs); } } /* }}} */ /* {{{ proto void enchant_dict_add_to_personal(resource dict, string word) add 'word' to personal word list */ PHP_FUNCTION(enchant_dict_add_to_personal) { zval *dict; char *word; int wordlen; enchant_dict *pdict; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_DICT; enchant_dict_add_to_personal(pdict->pdict, word, wordlen); } /* }}} */ /* {{{ proto void enchant_dict_add_to_session(resource dict, string word) add 'word' to this spell-checking session */ PHP_FUNCTION(enchant_dict_add_to_session) { zval *dict; char *word; int wordlen; enchant_dict *pdict; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_DICT; enchant_dict_add_to_session(pdict->pdict, word, wordlen); } /* }}} */ /* {{{ proto bool enchant_dict_is_in_session(resource dict, string word) whether or not 'word' exists in this spelling-session */ PHP_FUNCTION(enchant_dict_is_in_session) { zval *dict; char *word; int wordlen; enchant_dict *pdict; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_DICT; RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen)); } /* }}} */ /* {{{ proto void enchant_dict_store_replacement(resource dict, string mis, string cor) add a correction for 'mis' using 'cor'. Notes that you replaced @mis with @cor, so it's possibly more likely that future occurrences of @mis will be replaced with @cor. So it might bump @cor up in the suggestion list.*/ PHP_FUNCTION(enchant_dict_store_replacement) { zval *dict; char *mis, *cor; int mislen, corlen; enchant_dict *pdict; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &dict, &mis, &mislen, &cor, &corlen) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_DICT; enchant_dict_store_replacement(pdict->pdict, mis, mislen, cor, corlen); } /* }}} */ /* {{{ proto string enchant_dict_get_error(resource dict) Returns the last error of the current spelling-session */ PHP_FUNCTION(enchant_dict_get_error) { zval *dict; enchant_dict *pdict; char *msg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_DICT; msg = enchant_dict_get_error(pdict->pdict); if (msg) { RETURN_STRING((char *)msg, 1); } RETURN_FALSE; } /* }}} */ /* {{{ proto array enchant_dict_describe(resource dict) Describes an individual dictionary 'dict' */ PHP_FUNCTION(enchant_dict_describe) { zval *dict; enchant_dict *pdict; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) { RETURN_FALSE; } PHP_ENCHANT_GET_DICT; enchant_dict_describe(pdict->pdict, describe_dict_fn, (void *)return_value); } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */