~ubuntu-branches/ubuntu/intrepid/gnunet/intrepid

« back to all changes in this revision

Viewing changes to src/include/gnunet_uritrack_lib.h

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-01-31 17:40:18 UTC
  • mfrom: (1.2.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20080131174018-sfnbb8wv7p4nmut1
Tags: 0.7.3-2ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/rules:
    = Make use of code from cdbs' clean-la.mk file to clear the
      dependency_libs field in all .la files in the gnunet-dev package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
/**
41
41
 * Toggle tracking URIs.
42
42
 *
43
 
 * @param onOff YES to enable tracking, NO to disable
 
43
 * @param onOff GNUNET_YES to enable tracking, GNUNET_NO to disable
44
44
 *  disabling tracking
45
45
 */
46
 
void URITRACK_trackURIS (struct GE_Context *ectx, struct GC_Configuration *cfg, int onOff);     /* file_info.c */
 
46
void GNUNET_URITRACK_toggle_tracking (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration *cfg, int onOff);  /* file_info.c */
47
47
 
48
48
/**
49
49
 * Deletes all entries in the URITRACK tracking cache.
50
50
 */
51
 
void URITRACK_clearTrackedURIS (struct GE_Context *ectx, struct GC_Configuration *cfg); /* file_info.c */
 
51
void GNUNET_URITRACK_clear (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration *cfg);       /* file_info.c */
52
52
 
53
53
/**
54
54
 * Get the URITRACK URI tracking status.
55
55
 *
56
 
 * @return YES of tracking is enabled, NO if not
 
56
 * @return GNUNET_YES of tracking is enabled, GNUNET_NO if not
57
57
 */
58
 
int URITRACK_trackStatus (struct GE_Context *ectx, struct GC_Configuration *cfg);       /* file_info.c */
 
58
int GNUNET_URITRACK_get_tracking_status (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration *cfg);  /* file_info.c */
59
59
 
60
60
/**
61
61
 * Makes a URI available for directory building.  This function is
62
62
 * automatically called by all URITRACK functions and only in the
63
63
 * interface for clients that call ECRS directly.
64
64
 */
65
 
void URITRACK_trackURI (struct GE_Context *ectx, struct GC_Configuration *cfg, const ECRS_FileInfo * fi);       /* file_info.c */
 
65
void GNUNET_URITRACK_track (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration *cfg, const GNUNET_ECRS_FileInfo * fi);      /* file_info.c */
66
66
 
67
67
/**
68
68
 * List all URIs.
69
69
 *
70
 
 * @param need_metadata YES if metadata should be
71
 
 *        provided, NO if metadata is not needed (faster)
 
70
 * @param need_metadata GNUNET_YES if metadata should be
 
71
 *        provided, GNUNET_NO if metadata is not needed (faster)
72
72
 */
73
 
int URITRACK_listURIs (struct GE_Context *ectx, struct GC_Configuration *cfg, int need_metadata, ECRS_SearchProgressCallback iterator, void *closure);  /* file_info.c */
 
73
int GNUNET_URITRACK_list (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration *cfg, int need_metadata, GNUNET_ECRS_SearchResultProcessor iterator, void *closure);   /* file_info.c */
74
74
 
75
75
/**
76
76
 * Register a handler that is called whenever
78
78
 * the database, the callback will be called
79
79
 * for all existing URIs as well.
80
80
 */
81
 
int URITRACK_registerTrackCallback (struct GE_Context *ectx, struct GC_Configuration *cfg, ECRS_SearchProgressCallback iterator, void *closure);        /* callbacks.c */
 
81
int GNUNET_URITRACK_register_track_callback (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration *cfg, GNUNET_ECRS_SearchResultProcessor iterator, void *closure);   /* callbacks.c */
82
82
 
83
83
/**
84
84
 * Unregister a URI callback.
85
85
 */
86
 
int URITRACK_unregisterTrackCallback (ECRS_SearchProgressCallback iterator, void *closure);     /* callbacks.c */
 
86
int GNUNET_URITRACK_unregister_track_callback (GNUNET_ECRS_SearchResultProcessor iterator, void *closure);      /* callbacks.c */
87
87
 
88
88
/**
89
89
 * Possible ways in which a given URI has been used or encountered.
90
90
 * Note that we only have 8-bits when storing this on the disk,
91
91
 * so do not add additional entries (without changing uri_info).
92
92
 */
93
 
enum URITRACK_STATE
 
93
enum GNUNET_URITRACK_STATE
94
94
{
95
 
  URITRACK_FRESH = 0,
96
 
  URITRACK_INSERTED = 1,
97
 
  URITRACK_INDEXED = 2,
98
 
  URITRACK_DIRECTORY_ADDED = 4,
99
 
  URITRACK_DOWNLOAD_STARTED = 8,
100
 
  URITRACK_DOWNLOAD_ABORTED = 16,
101
 
  URITRACK_DOWNLOAD_COMPLETED = 32,
102
 
  URITRACK_SEARCH_RESULT = 64,
103
 
  URITRACK_DIRECTORY_FOUND = 128,
 
95
  GNUNET_URITRACK_FRESH = 0,
 
96
  GNUNET_URITRACK_INSERTED = 1,
 
97
  GNUNET_URITRACK_INDEXED = 2,
 
98
  GNUNET_URITRACK_DIRECTORY_ADDED = 4,
 
99
  GNUNET_URITRACK_DOWNLOAD_STARTED = 8,
 
100
  GNUNET_URITRACK_DOWNLOAD_ABORTED = 16,
 
101
  GNUNET_URITRACK_DOWNLOAD_COMPLETED = 32,
 
102
  GNUNET_URITRACK_SEARCH_RESULT = 64,
 
103
  GNUNET_URITRACK_DIRECTORY_FOUND = 128,
104
104
};
105
105
 
106
106
/**
107
107
 * Find out what we know about a given URI's past.  Note that we only
108
108
 * track the states for a (finite) number of URIs and that the
109
109
 * information that we give back maybe inaccurate (returning
110
 
 * URITRACK_FRESH if the URI did not fit into our bounded-size map,
 
110
 * GNUNET_URITRACK_FRESH if the URI did not fit into our bounded-size map,
111
111
 * even if the URI is not fresh anymore; also, if the URI has a
112
 
 * hash-collision in the map, there is a 1:256 chance that we will
 
112
 * GNUNET_hash-collision in the map, there is a 1:256 chance that we will
113
113
 * return information from the wrong URI without detecting it).
114
114
 */
115
 
enum URITRACK_STATE
116
 
URITRACK_getState (struct GE_Context *ectx,
117
 
                   struct GC_Configuration *cfg, const struct ECRS_URI *uri);
 
115
enum GNUNET_URITRACK_STATE
 
116
GNUNET_URITRACK_get_state (struct GNUNET_GE_Context *ectx,
 
117
                           struct GNUNET_GC_Configuration *cfg,
 
118
                           const struct GNUNET_ECRS_URI *uri);
118
119
 
119
120
/**
120
121
 * Add additional information about a given URI's past.
121
122
 */
122
 
void URITRACK_addState (struct GE_Context *ectx,
123
 
                        struct GC_Configuration *cfg,
124
 
                        const struct ECRS_URI *uri,
125
 
                        enum URITRACK_STATE state);
 
123
void GNUNET_URITRACK_add_state (struct GNUNET_GE_Context *ectx,
 
124
                                struct GNUNET_GC_Configuration *cfg,
 
125
                                const struct GNUNET_ECRS_URI *uri,
 
126
                                enum GNUNET_URITRACK_STATE state);
126
127
 
127
128
#if 0                           /* keep Emacsens' auto-indent happy */
128
129
{