]> granicus.if.org Git - php/commitdiff
- MnoGoSearch extension updated to fix compilation issues with
authorSergey Kartashoff <gluke@php.net>
Sun, 28 Nov 2004 20:03:05 +0000 (20:03 +0000)
committerSergey Kartashoff <gluke@php.net>
Sun, 28 Nov 2004 20:03:05 +0000 (20:03 +0000)
  mnogosearch-3.2.25+

ext/mnogosearch/php_mnogo.c

index e88ed4201a465fa9f0c072b0c0765939970d487c..a54b8765a313d34e5338742ff34efe4ff69a6340 100644 (file)
@@ -1214,43 +1214,48 @@ DLEXPORT PHP_FUNCTION(udm_load_ispell_data)
 #endif
 
                case UDM_ISPELL_TYPE_AFFIX: 
-#if UDM_VERSION_ID < 30200             
+#if UDM_VERSION_ID < 30200
                        Agent->Conf->ispell_mode &= ~UDM_ISPELL_MODE_DB;
-
 #if UDM_VERSION_ID > 30111
                        Agent->Conf->ispell_mode &= ~UDM_ISPELL_MODE_SERVER;
 #endif
-                       
                        if (UdmImportAffixes(Agent->Conf,val1,val2,NULL,0)) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load affix file %s",val2);
                                RETURN_FALSE;
                        }
-#else
+#elif UDM_VERSION_ID < 30225
                        if (UdmImportAffixes(Agent->Conf,val1,charset,val2)) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load affix file %s",val2);
                                RETURN_FALSE;
                        }
-    
+#else
+                       if(UdmAffixListListAdd(&Agent->Conf->Affixes,val1,charset,val2)) {
+                               php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load affix file %s",val2);
+                               RETURN_FALSE;
+                       }
 #endif
                        break;
                        
                case UDM_ISPELL_TYPE_SPELL: 
 #if UDM_VERSION_ID < 30200                             
                        Agent->Conf->ispell_mode &= ~UDM_ISPELL_MODE_DB;
-                       
 #if UDM_VERSION_ID > 30111
                        Agent->Conf->ispell_mode &= ~UDM_ISPELL_MODE_SERVER;
 #endif
-                       
                        if (UdmImportDictionary(Agent->Conf,val1,val2,1,"")) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load spell file %s",val2);
                                RETURN_FALSE;
                        }
-#else
+#elif UDM_VERSION_ID < 30225
                        if (UdmImportDictionary(Agent->Conf,val1,charset,val2,0,"")) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load spell file %s",val2);
                                RETURN_FALSE;
                        }
+#else
+                       if(UdmSpellListListAdd(&Agent->Conf->Spells,val1,charset,val2)) {
+                               php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load spell file %s",val2);
+                               RETURN_FALSE;
+                       }
 #endif
                        break;
 
@@ -1262,6 +1267,7 @@ DLEXPORT PHP_FUNCTION(udm_load_ispell_data)
        }
        
        if (flag) {
+#if UDM_VERSION_ID < 30225
 #if UDM_VERSION_ID >= 30204
                if(Agent->Conf->Spells.nspell) {
                        UdmSortDictionary(&Agent->Conf->Spells);
@@ -1272,6 +1278,7 @@ DLEXPORT PHP_FUNCTION(udm_load_ispell_data)
                        UdmSortDictionary(Agent->Conf);
                        UdmSortAffixes(Agent->Conf);
                }
+#endif
 #endif
        }
        
@@ -1297,8 +1304,11 @@ DLEXPORT PHP_FUNCTION(udm_free_ispell_data)
                        break;
        }
        ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", le_link);
-
-#if UDM_VERSION_ID >= 30204
+       
+#if UDM_VERSION_ID >= 30225
+       UdmSpellListListFree(&Agent->Conf->Spells); 
+       UdmAffixListListFree(&Agent->Conf->Affixes);
+#elif UDM_VERSION_ID >= 30204
        UdmSpellListFree(&Agent->Conf->Spells);
        UdmAffixListFree(&Agent->Conf->Affixes);
 #elif UDM_VERSION_ID > 30111