/* Josh Pieper, (c) 2000 */

/* This file is distributed under the GPL, see file COPYING for details */

#ifndef SHARE_H
#define SHARE_H

#include "Gnut_List.h"
#include "gnut_lib.h"

typedef struct _share_item share_item;

struct _share_item {
  char *path;   /* the pretty path to display */
  char *upath;  /* the pretty path tolower'd for searching */
  char *fpath;  /* the full path for accessing the file */
  int size;
  int ref;
  time_t mtime;
};

#ifdef __cplusplus
extern "C" {
#endif

  extern Gnut_List *share_root;

  void free_si(share_item **x, int bugnum);
  void make_lc(char *str);
  int is_match_tok(char *query, char *str, int and, int ignorecase);
  int share_scan_dir(char *path, int verbose);
  share_item *share_find(int ref);
  int share_clear();
  int share_clear_list(Gnut_List *l);
  Gnut_List * share_search(char *query, int max);
  int share_totals(int *num, int *size);
  Gnut_List *share_get_root();
  int share_delete(void *data, void *user_data);
  Gnut_List *share_copy_list(Gnut_List *);

#define OUR_MAX_PATH 2048

#ifdef __cplusplus
}
#endif

#endif
