/* This file is part of GNUnet (C) GNUnet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNUnet; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * @file include/gnunet_crawl_service.h * @brief API to the distributed HTTP crawl service * @author Christian Grothoff */ #ifndef GNUNET_CRAWL_SERVICE_H #define GNUNET_CRAWL_SERVICE_H #ifdef __cplusplus extern "C" { #if 0 /* keep Emacsens' auto-indent happy */ } #endif #endif /** * Version of the crawl API. */ #define GNUNET_CRAWL_VERSION 0x00000000 /** * Opaque handle. */ struct GNUNET_CrawlHandle; /** * Function called for each result found. * * @param cls closure * @param url url of the result * @param double ranking of the URL */ typedef void (*GNUNET_CRAWL_ResultProcessor)(void *cls, const char *url, double ranking); /** * Connect to crawl service and search the database for matches to a particular URL * * @param cfg configuration to use * @param query search query * @param proc function to call with result * @param proc_cls closure for proc * @return NULL on error */ struct GNUNET_CrawlHandle * GNUNET_CRAWL_query (struct GNUNET_CONFIGURATION_Handle *cfg, const char *query, GNUNET_CRAWL_ResultProcessor proc, void *proc_cls); /** * Stop a search and disconnect from the service. * * @param h crawl handle */ void GNUNET_CRAWL_query_stop (struct GNUNET_CrawlHandle *h); #if 0 /* keep Emacsens' auto-indent happy */ { #endif #ifdef __cplusplus } #endif #endif