Skip to main content.
home | support | download

Back to List Archive

patch for SwishGetStructure()

From: Antony Dovgal <antony(at)not-real.zend.com>
Date: Tue Jan 30 2007 - 21:21:31 GMT
This is a multi-part message in MIME format.
--------------090400070304040604030703
Content-Type: text/plain; charset=KOI8-R; format=flowed
Content-Transfer-Encoding: 7bit

Hello all.

Any objections for a function to get the value of search->structure?
See patch in attachment.


I would also like to have a similar function for search->PhraseDelimiter.
Something like this would work, I guess:

char SwishGetPhraseDelimiter(SEARCH_OBJECT *srch) {
    if ( srch ) {
        return srch->PhraseDelimiter;
    }
    return 0;
}

-- 
Wbr, 
Antony Dovgal

--------------090400070304040604030703
Content-Type: text/plain;
 name="get_structure.diff.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="get_structure.diff.txt"

Index: src/search.c
===================================================================
RCS file: /cvsroot/swishe/swish-e/src/search.c,v
retrieving revision 1.148
diff -u -p -d -r1.148 search.c
--- src/search.c	18 Oct 2006 15:07:51 -0000	1.148
+++ src/search.c	30 Jan 2007 21:12:06 -0000
@@ -290,6 +290,13 @@ void SwishSetStructure( SEARCH_OBJECT *s
         srch->structure = structure;
 }
 
+int SwishGetStructure( SEARCH_OBJECT *srch )
+{
+    if ( srch ) {
+        return srch->structure;
+	}
+	return -1;
+}
 
 void SwishPhraseDelimiter( SEARCH_OBJECT *srch, char delimiter )
 {
Index: src/swish-e.h
===================================================================
RCS file: /cvsroot/swishe/swish-e/src/swish-e.h,v
retrieving revision 1.15
diff -u -p -d -r1.15 swish-e.h
--- src/swish-e.h	14 Jul 2005 17:02:34 -0000	1.15
+++ src/swish-e.h	30 Jan 2007 21:12:06 -0000
@@ -129,6 +137,7 @@ void *SwishResult_parent( SW_RESULT resu
 void ResultsSetRefPtr( SW_RESULTS results, void *address );
 
 void SwishSetStructure( SW_SEARCH srch, int structure );
+int  SwishGetStructure( SW_SEARCH srch );
 void SwishPhraseDelimiter( SW_SEARCH srch, char delimiter );
 void SwishSetSort( SW_SEARCH srch, char *sort );
 void SwishSetQuery( SW_SEARCH srch, char *query );

--------------090400070304040604030703--
Received on Tue Jan 30 13:21:35 2007