/* Jungle Monkey
 * Copyright (C) 1999-2001  The Regents of the University of Michigan
 *
 * This program 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 of the License, or
 * (at your option) any later version.
 *
 * This program 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 this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */


/**

   Jungle Monkey Multicast Search client

   This is a handy wrapper around jmmsp and the handlers.  When a
   group is joined or created, handlers are also created for it.

*/


#ifndef _JMMSEARCH_H
#define _JMMSEARCH_H

#include "jmmsp.h"
#include "jmmsp_cache.h"
#include "jmmsp_search.h"
#include "jmmsp_vfs.h"


typedef struct _JMMSearch
{
  JMMSP* 	jmmsp;
  JMMSPCache*	jmmsp_cache;
  JMMSPSearch*	jmmsp_search;
  JMMSPVFS*	jmmsp_vfs;

} JMMSearch;


#define    jmmsearch_create(BPEER, NAME) jmmsearch_create_full(BPEER, NAME, NULL, NULL, NULL)
#define    jmmsearch_join(BPEER, URL)    jmmsearch_join_full(BPEER, URL, NULL, NULL, NULL)
#define    jmmsearch_setup(BPEER, URL)    jmmsearch_setup_full(BPEER, URL, NULL, NULL, NULL)

JMMSearch* jmmsearch_create_full (BPeer* bpeer, const gchar* name, JMMSPCache* jmmsp_cache,
				  JMMSPSearch* jmmsp_search, JMMSPVFS* jmmsp_vfs);
JMMSearch* jmmsearch_join_full (BPeer* bpeer, const GURL* url, JMMSPCache* jmmsp_cache,
				JMMSPSearch* jmmsp_search, JMMSPVFS* jmmsp_vfs);
JMMSearch* jmmsearch_setup_full (BPeer* bpeer, const GURL* url, JMMSPCache* jmmsp_cache,
				JMMSPSearch* jmmsp_search, JMMSPVFS* jmmsp_vfs);

#define    jmmsearch_rejoin(J) (jmmsp_rejoin((J)->jmmsp))
#define	   jmmsearch_leave(J)  (jmmsp_leave((J)->jmmsp))
void	   jmmsearch_delete (JMMSearch* jmmsearch);
 
#define    jmmsearch_is_up(J)    (jmmsp_is_up((J)->jmmsp))
#define    jmmsearch_is_down(J)  (jmmsp_is_down((J)->jmmsp))
#define    jmmsearch_is_local(J) ((J)->jmmsp->is_local)


#endif /* _JMMSEARCH_H */


syntax highlighted by Code2HTML, v. 0.9.1