Main Page | Modules | Data Structures | Directories | File List | Data Fields | Examples

search.h

00001 /*
00002  *  This library is free software; you can redistribute it and/or
00003  *  modify it under the terms of the GNU Lesser General Public
00004  *  License as published by the Free Software Foundation; either
00005  *  version 2 of the License, or (at your option) any later version.
00006  *
00007  *  This library is distributed in the hope that it will be useful,
00008  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00010  *  Lesser General Public License for more details.
00011  *
00012  *  You should have received a copy of the GNU General Public License
00013  *  along with this program; if not, write to the Free Software
00014  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00015  *  
00016  *  Copyright (C) 2005 Liam Girdwood, Radu Corlan  
00017  */
00018 
00019 #ifndef __LNC_SEARCH_H
00020 #define __LNC_SEARCH_H
00021 
00022 #include <libncat/libncat.h>
00023 #include <libncat/list.h>
00024 #include <libncat/catalog.h>
00025 #include <libncat/dset.h>
00026 
00034 /* compares <data> with <value> using <comparator> */
00035 typedef int (*_lnc_comp)(void* data, void* value);
00036 
00037 /* operation on  nodes / lists */
00038 typedef int (*_lnc_op)(void* object, lnc_slist* l);
00039 
00040 struct _lnc_node {
00041         _lnc_comp c;                    
00042         int offset;                             
00043         void* value;                    
00044 };
00045 
00046 struct _lnc_nop {
00047         lnc_slist* l;                   
00048         _lnc_op lop;                    
00049         unsigned int type;              
00050 };
00051 
00056 struct lnc_search {
00057         int tests;                  
00058         int hits;               
00059         lnc_dataset* dset;      
00060         lnc_slist* root;                
00061         lnc_slist* op_orphans;  
00062         lnc_slist* comp_orphans;
00063         struct _lnc_nop* ostart;
00064         int num_s;                              
00065         lnc_slist* free_list;   
00066         lnc_slist* free_slist;  
00067 };
00068 
00069 #endif

Generated on Tue Jul 5 14:34:14 2005 for libncat by  doxygen 1.4.2