cvs: php4 /ext/mnogosearch php_mnogo.c
| From: | Sergey Kartashoff | Date: | Sat, 03 Nov 2001 21:45:50 +0000 |
| Subject: | cvs: php4 /ext/mnogosearch php_mnogo.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-8068@lists.php.net to get a copy of this message | ||
gluke Sat Nov 3 16:45:50 2001 EDT
Modified files:
/php4/ext/mnogosearch php_mnogo.c
Log:
@- Some mnogosearch-3.2.x compilation bugs fixes.
@ Make crosswords and weight sections work with mnogosearch-3.2.x
@ UDM_PARAM_HLBEG, UDM_PARAM_HLEND mnoGoSearch Agent parameters
@ has been added (gluke)
- Some mnogosearch-3.2.x compilation bugs fixes.
Make crosswords and weight sections work with mnogosearch-3.2.x
UDM_PARAM_HLBEG, UDM_PARAM_HLEND mnoGoSearch Agent parameters
has been added (gluke)
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.41 php4/ext/mnogosearch/php_mnogo.c:1.42
--- php4/ext/mnogosearch/php_mnogo.c:1.41 Thu Oct 11 19:33:11 2001
+++ php4/ext/mnogosearch/php_mnogo.c Sat Nov 3 16:45:49 2001
@@ -1,5 +1,5 @@
/* $Source: /usr/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.41 2001/10/11 23:33:11 ssb Exp $ */
+/* $Id: php_mnogo.c,v 1.42 2001/11/03 21:45:49 gluke Exp $ */
/*
+----------------------------------------------------------------------+
@@ -69,6 +69,8 @@
#define UDM_PARAM_VARDIR 16
#define UDM_PARAM_LOCAL_CHARSET 17
#define UDM_PARAM_BROWSER_CHARSET 18
+#define UDM_PARAM_HLBEG 19
+#define UDM_PARAM_HLEND 20
/* udm_add_search_limit constants */
#define UDM_LIMIT_URL 1
@@ -250,6 +252,9 @@
REGISTER_LONG_CONSTANT("UDM_PARAM_VARDIR", UDM_PARAM_VARDIR,CONST_CS |
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_DATADIR", UDM_PARAM_VARDIR,CONST_CS |
CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("UDM_PARAM_HLBEG", UDM_PARAM_HLBEG,CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("UDM_PARAM_HLEND", UDM_PARAM_HLEND,CONST_CS | CONST_PERSISTENT);
+
/* udm_add_search_limit constants */
REGISTER_LONG_CONSTANT("UDM_LIMIT_CAT", UDM_LIMIT_CAT,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_LIMIT_URL", UDM_LIMIT_URL,CONST_CS | CONST_PERSISTENT);
@@ -602,7 +607,7 @@
#if UDM_VERSION_ID < 30200
Agent->Conf->ispell_mode |= UDM_ISPELL_USE_PREFIXES;
#else
- UdmAddIntVar(Env->vars, "IspellUsePrefixes", 1, UDM_VARSRC_GLOBAL);
+ UdmAddIntVar(Agent->Conf->vars, "IspellUsePrefixes", 1,
UDM_VARSRC_GLOBAL);
#endif
break;
@@ -610,7 +615,7 @@
#if UDM_VERSION_ID < 30200
Agent->Conf->ispell_mode &= ~UDM_ISPELL_USE_PREFIXES;
#else
- UdmAddIntVar(Env->vars, "IspellUsePrefixes", 0, UDM_VARSRC_GLOBAL);
+ UdmAddIntVar(Agent->Conf->vars, "IspellUsePrefixes", 0,
UDM_VARSRC_GLOBAL);
#endif
break;
@@ -619,7 +624,7 @@
#if UDM_VERSION_ID < 30200
Agent->Conf->ispell_mode |= UDM_ISPELL_USE_PREFIXES;
#else
- UdmAddIntVar(Env->vars, "IspellUsePrefixes", 1, UDM_VARSRC_GLOBAL);
+ UdmAddIntVar(Agent->Conf->vars, "IspellUsePrefixes", 1,
UDM_VARSRC_GLOBAL);
#endif
php_error(E_WARNING,"Udm_Set_Agent_Param: Unknown ispell prefixes mode");
RETURN_FALSE;
@@ -634,6 +639,7 @@
Agent->Conf->local_charset=UdmGetCharset(val);
Agent->charset=Agent->Conf->local_charset;
#else
+ Agent->Conf->local_charset=strdup(val);
UdmReplaceStrVar(Agent->Conf->vars,"LocalCharset",val,UDM_VARSRC_GLOBAL);
#endif
@@ -641,9 +647,21 @@
#if UDM_VERSION_ID >= 30200
case UDM_PARAM_BROWSER_CHARSET:
+ Agent->Conf->browser_charset=strdup(val);
UdmReplaceStrVar(Agent->Conf->vars,"BrowserCharset",val,UDM_VARSRC_GLOBAL);
break;
+
+ case UDM_PARAM_HLBEG:
+ UdmReplaceStrVar(Agent->Conf->vars,"HlBeg",val,UDM_VARSRC_GLOBAL);
+
+ break;
+
+ case UDM_PARAM_HLEND:
+ UdmReplaceStrVar(Agent->Conf->vars,"HlBeg",val,UDM_VARSRC_GLOBAL);
+
+ break;
+
#endif
case UDM_PARAM_STOPTABLE:
@@ -665,6 +683,23 @@
Agent->weight_factor=strdup(val);
#else
UdmReplaceStrVar(Agent->Conf->vars,"wf",val,UDM_VARSRC_GLOBAL);
+ {
+ size_t len;
+
+ len=strlen(val);
+ if((len>0)&&(len<256)){
+ const char *sec;
+ int sn;
+
+ for(sn=0;sn<256;sn++){
+ Agent->wf[sn]=0;
+ }
+
+ for(sec=val+len-1;sec>=val;sec--){
+ Agent->wf[len-(sec-val)]=UdmHex2Int(*sec);
+ }
+ }
+ }
#endif
break;
@@ -678,8 +713,6 @@
break;
-#if UDM_VERSION_ID > 30110
-
case UDM_PARAM_CROSS_WORDS:
switch (atoi(val)){
case UDM_CROSS_WORDS_ENABLED:
@@ -697,8 +730,6 @@
}
break;
-
-#endif
#if UDM_VERSION_ID > 30112