WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
SPDX-License-Identifier: AGPL3.0-or-later
-*/
+ */
/**
* @author Christian Grothoff
*
* How often do we signal applications that a probe for a particular
* search result is running? (used to visualize probes).
*/
-#define GNUNET_FS_PROBE_UPDATE_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 250)
+#define GNUNET_FS_PROBE_UPDATE_FREQUENCY GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 250)
/**
* A Universal Resource Identifier (URI), opaque.
* @return #GNUNET_OK on success
*/
int
-GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri,
- struct GNUNET_HashCode *key);
+GNUNET_FS_uri_to_key(const struct GNUNET_FS_Uri *uri,
+ struct GNUNET_HashCode *key);
/**
* @return the UTF-8 string
*/
char *
-GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri);
+GNUNET_FS_uri_to_string(const struct GNUNET_FS_Uri *uri);
/**
* @return string with the keywords
*/
char *
-GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri);
+GNUNET_FS_uri_ksk_to_string_fancy(const struct GNUNET_FS_Uri *uri);
/**
* @param is_mandatory is this keyword mandatory?
*/
void
-GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri,
- const char *keyword,
- int is_mandatory);
+GNUNET_FS_uri_ksk_add_keyword(struct GNUNET_FS_Uri *uri,
+ const char *keyword,
+ int is_mandatory);
/**
* @param keyword keyword to add
*/
void
-GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri,
- const char *keyword);
+GNUNET_FS_uri_ksk_remove_keyword(struct GNUNET_FS_Uri *uri,
+ const char *keyword);
/**
* @return NULL on error
*/
struct GNUNET_FS_Uri *
-GNUNET_FS_uri_parse (const char *uri,
- char **emsg);
+GNUNET_FS_uri_parse(const char *uri,
+ char **emsg);
/**
* @param uri uri to free
*/
void
-GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri);
+GNUNET_FS_uri_destroy(struct GNUNET_FS_Uri *uri);
/**
* @return 0 if this is not a keyword URI
*/
unsigned int
-GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri);
+GNUNET_FS_uri_ksk_get_keyword_count(const struct GNUNET_FS_Uri *uri);
/**
* keywords iterated over until iterator aborted
*/
int
-GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri,
- GNUNET_FS_KeywordIterator iterator,
- void *iterator_cls);
+GNUNET_FS_uri_ksk_get_keywords(const struct GNUNET_FS_Uri *uri,
+ GNUNET_FS_KeywordIterator iterator,
+ void *iterator_cls);
/**
* @return #GNUNET_SYSERR if this is not a location URI, otherwise #GNUNET_OK
*/
int
-GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri,
- struct GNUNET_PeerIdentity *peer);
+GNUNET_FS_uri_loc_get_peer_identity(const struct GNUNET_FS_Uri *uri,
+ struct GNUNET_PeerIdentity *peer);
/**
* @return NULL if argument is not a location URI
*/
struct GNUNET_FS_Uri *
-GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri *uri);
+GNUNET_FS_uri_loc_get_uri(const struct GNUNET_FS_Uri *uri);
/**
* @return expiration time of the URI
*/
struct GNUNET_TIME_Absolute
-GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri);
+GNUNET_FS_uri_loc_get_expiration(const struct GNUNET_FS_Uri *uri);
/**
* @return the location URI, NULL on error
*/
struct GNUNET_FS_Uri *
-GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *base_uri,
- const struct GNUNET_CRYPTO_EddsaPrivateKey *sign_key,
- struct GNUNET_TIME_Absolute expiration_time);
+GNUNET_FS_uri_loc_create(const struct GNUNET_FS_Uri *base_uri,
+ const struct GNUNET_CRYPTO_EddsaPrivateKey *sign_key,
+ struct GNUNET_TIME_Absolute expiration_time);
/**
* @return merged URI, NULL on error
*/
struct GNUNET_FS_Uri *
-GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1,
- const struct GNUNET_FS_Uri *u2);
+GNUNET_FS_uri_ksk_merge(const struct GNUNET_FS_Uri *u1,
+ const struct GNUNET_FS_Uri *u2);
/**
* @return copy of the URI
*/
struct GNUNET_FS_Uri *
-GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri);
+GNUNET_FS_uri_dup(const struct GNUNET_FS_Uri *uri);
/**
* if keywords is not legal (i.e. empty).
*/
struct GNUNET_FS_Uri *
-GNUNET_FS_uri_ksk_create (const char *keywords,
- char **emsg);
+GNUNET_FS_uri_ksk_create(const char *keywords,
+ char **emsg);
/**
* if keywords is not legal (i.e. empty).
*/
struct GNUNET_FS_Uri *
-GNUNET_FS_uri_ksk_create_from_args (unsigned int argc,
- const char **argv);
+GNUNET_FS_uri_ksk_create_from_args(unsigned int argc,
+ const char **argv);
/**
* @return #GNUNET_YES if the URIs are equal
*/
int
-GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
- const struct GNUNET_FS_Uri *u2);
+GNUNET_FS_uri_test_equal(const struct GNUNET_FS_Uri *u1,
+ const struct GNUNET_FS_Uri *u2);
/**
* @return #GNUNET_YES if this is an SKS uri
*/
int
-GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri);
+GNUNET_FS_uri_test_sks(const struct GNUNET_FS_Uri *uri);
/**
* @return an FS URI for the given namespace and identifier
*/
struct GNUNET_FS_Uri *
-GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EcdsaPublicKey *ns,
- const char *id);
+GNUNET_FS_uri_sks_create(const struct GNUNET_CRYPTO_EcdsaPublicKey *ns,
+ const char *id);
/**
* @return #GNUNET_OK on success
*/
int
-GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri,
- struct GNUNET_CRYPTO_EcdsaPublicKey *pseudonym);
+GNUNET_FS_uri_sks_get_namespace(const struct GNUNET_FS_Uri *uri,
+ struct GNUNET_CRYPTO_EcdsaPublicKey *pseudonym);
/**
* @return NULL on error (not a valid SKS URI)
*/
char *
-GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri);
+GNUNET_FS_uri_sks_get_content_id(const struct GNUNET_FS_Uri *uri);
/**
* @return #GNUNET_YES if this is a KSK uri
*/
int
-GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri);
+GNUNET_FS_uri_test_ksk(const struct GNUNET_FS_Uri *uri);
/**
* @return #GNUNET_YES if this is a CHK uri
*/
int
-GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri);
+GNUNET_FS_uri_test_chk(const struct GNUNET_FS_Uri *uri);
/**
* @return size of the file as specified in the CHK URI
*/
uint64_t
-GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri);
+GNUNET_FS_uri_chk_get_file_size(const struct GNUNET_FS_Uri *uri);
/**
* @return #GNUNET_YES if this is a LOC uri
*/
int
-GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri);
+GNUNET_FS_uri_test_loc(const struct GNUNET_FS_Uri *uri);
/**
* @return NULL on error, otherwise a KSK URI
*/
struct GNUNET_FS_Uri *
-GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData
- *md);
+GNUNET_FS_uri_ksk_create_from_meta_data(const struct GNUNET_CONTAINER_MetaData
+ *md);
/* ******************** command-line option parsing API *********************** */
* @param[out] topKeywords set to the desired value
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_FS_GETOPT_KEYWORDS (char shortName,
- const char *name,
- const char *argumentHelp,
- const char *description,
- struct GNUNET_FS_Uri **topKeywords);
+GNUNET_FS_GETOPT_KEYWORDS(char shortName,
+ const char *name,
+ const char *argumentHelp,
+ const char *description,
+ struct GNUNET_FS_Uri **topKeywords);
/**
* Allow user to specify metadata.
* @param[out] metadata set to the desired value
*/
struct GNUNET_GETOPT_CommandLineOption
-GNUNET_FS_GETOPT_METADATA (char shortName,
- const char *name,
- const char *argumentHelp,
- const char *description,
- struct GNUNET_CONTAINER_MetaData **meta);
+GNUNET_FS_GETOPT_METADATA(char shortName,
+ const char *name,
+ const char *argumentHelp,
+ const char *description,
+ struct GNUNET_CONTAINER_MetaData **meta);
/**
* Command-line option parser function that allows the user to specify
* @return #GNUNET_OK on success
*/
int
-GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
- void *scls,
- const char *option,
- const char *value);
+GNUNET_FS_getopt_set_metadata(struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
+ void *scls,
+ const char *option,
+ const char *value);
* are typically generated either due to explicit client requests
* or because of suspend/resume operations.
*/
-enum GNUNET_FS_Status
-{
+enum GNUNET_FS_Status {
/**
* Notification that we have started to publish a file structure.
*/
* Notification that we are making progress sharing a directory.
*/
GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY = 37
-
};
* Argument given to the progress callback with
* information about what is going on.
*/
-struct GNUNET_FS_ProgressInfo
-{
-
+struct GNUNET_FS_ProgressInfo {
/**
* Values that depend on the event type.
*/
- union
- {
-
+ union {
/**
* Values for all "GNUNET_FS_STATUS_PUBLISH_*" events.
*/
- struct
- {
-
+ struct {
/**
* Context for controlling the upload.
*/
/**
* Additional values for specific events.
*/
- union
- {
-
+ union {
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_PUBLISH_PROGRESS events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_PUBLISH_PROGRESS events.
+ */
+ struct {
/**
- * Data block we just published.
- */
+ * Data block we just published.
+ */
const void *data;
/**
- * At what offset in the file is "data"?
- */
+ * At what offset in the file is "data"?
+ */
uint64_t offset;
/**
- * Length of the data block.
- */
+ * Length of the data block.
+ */
uint64_t data_len;
/**
- * Depth of the given block in the tree;
- * 0 would be the lowest level (DBLOCKs).
- */
+ * Depth of the given block in the tree;
+ * 0 would be the lowest level (DBLOCKs).
+ */
unsigned int depth;
-
} progress;
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY events.
+ */
+ struct {
/**
- * How far are we along in the overall directory?
- */
+ * How far are we along in the overall directory?
+ */
uint64_t completed;
/**
- * How big do we estimate the entire directory to be?
- */
+ * How big do we estimate the entire directory to be?
+ */
uint64_t total;
/**
* "publish"-level of this struct.)
*/
struct GNUNET_TIME_Relative eta;
-
} progress_directory;
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_PUBLISH_RESUME events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_PUBLISH_RESUME events.
+ */
+ struct {
/**
- * Error message, NULL if no error was encountered so far.
- */
+ * Error message, NULL if no error was encountered so far.
+ */
const char *message;
/**
- * URI of the file (if the download had been completed)
- */
+ * URI of the file (if the download had been completed)
+ */
const struct GNUNET_FS_Uri *chk_uri;
/**
- * SKS URI of the file (if the download had been completed)
- */
+ * SKS URI of the file (if the download had been completed)
+ */
const struct GNUNET_FS_Uri *sks_uri;
-
} resume;
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_PUBLISH_COMPLETED events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_PUBLISH_COMPLETED events.
+ */
+ struct {
/**
- * CHK URI of the file.
- */
+ * CHK URI of the file.
+ */
const struct GNUNET_FS_Uri *chk_uri;
/**
- * SKS URI of the file (if the download had been completed)
- */
+ * SKS URI of the file (if the download had been completed)
+ */
const struct GNUNET_FS_Uri *sks_uri;
-
} completed;
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_PUBLISH_ERROR events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_PUBLISH_ERROR events.
+ */
+ struct {
/**
- * Error message, never NULL.
- */
+ * Error message, never NULL.
+ */
const char *message;
-
} error;
-
} specifics;
-
} publish;
/**
* Values for all "GNUNET_FS_STATUS_DOWNLOAD_*" events.
*/
- struct
- {
-
+ struct {
/**
* Context for controlling the download.
*/
/**
* Additional values for specific events.
*/
- union
- {
-
+ union {
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_DOWNLOAD_PROGRESS events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_DOWNLOAD_PROGRESS events.
+ */
+ struct {
/**
- * Data block we just obtained, can be NULL (even if
- * data_len > 0) if we found the entire block 'intact' on
- * disk. In this case, it is also possible for 'data_len'
- * to be larger than an individual (32k) block.
- */
+ * Data block we just obtained, can be NULL (even if
+ * data_len > 0) if we found the entire block 'intact' on
+ * disk. In this case, it is also possible for 'data_len'
+ * to be larger than an individual (32k) block.
+ */
const void *data;
/**
- * At what offset in the file is "data"?
- */
+ * At what offset in the file is "data"?
+ */
uint64_t offset;
/**
- * Length of the data block.
- */
+ * Length of the data block.
+ */
uint64_t data_len;
/**
- * How much time passed between us asking for this block and
+ * How much time passed between us asking for this block and
* actually getting it? #GNUNET_TIME_UNIT_FOREVER_REL if unknown.
- */
+ */
struct GNUNET_TIME_Relative block_download_duration;
/**
- * Depth of the given block in the tree;
- * 0 would be the lowest level (DBLOCKS).
- */
+ * Depth of the given block in the tree;
+ * 0 would be the lowest level (DBLOCKS).
+ */
unsigned int depth;
/**
- * How much respect did we offer for downloading this block? (estimate,
- * because we might have the same request pending for multiple clients,
- * and of course because a transmission may have failed at a lower
- * layer).
- */
+ * How much respect did we offer for downloading this block? (estimate,
+ * because we might have the same request pending for multiple clients,
+ * and of course because a transmission may have failed at a lower
+ * layer).
+ */
uint32_t respect_offered;
/**
- * How often did we transmit the request? (estimate,
- * because we might have the same request pending for multiple clients,
- * and of course because a transmission may have failed at a lower
- * layer).
- */
+ * How often did we transmit the request? (estimate,
+ * because we might have the same request pending for multiple clients,
+ * and of course because a transmission may have failed at a lower
+ * layer).
+ */
uint32_t num_transmissions;
-
} progress;
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_DOWNLOAD_START events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_DOWNLOAD_START events.
+ */
+ struct {
/**
- * Known metadata for the download.
- */
+ * Known metadata for the download.
+ */
const struct GNUNET_CONTAINER_MetaData *meta;
-
} start;
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_DOWNLOAD_RESUME events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_DOWNLOAD_RESUME events.
+ */
+ struct {
/**
- * Known metadata for the download.
- */
+ * Known metadata for the download.
+ */
const struct GNUNET_CONTAINER_MetaData *meta;
/**
- * Error message, NULL if we have not encountered any error yet.
- */
+ * Error message, NULL if we have not encountered any error yet.
+ */
const char *message;
-
} resume;
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_DOWNLOAD_ERROR events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_DOWNLOAD_ERROR events.
+ */
+ struct {
/**
- * Error message.
- */
+ * Error message.
+ */
const char *message;
-
} error;
-
} specifics;
-
} download;
/**
* Values for all "GNUNET_FS_STATUS_SEARCH_*" events.
*/
- struct
- {
-
+ struct {
/**
* Context for controlling the search, NULL for
* searches that were not explicitly triggered
/**
* Additional values for specific events.
*/
- union
- {
-
+ union {
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_SEARCH_RESULT events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_SEARCH_RESULT events.
+ */
+ struct {
/**
- * Metadata for the search result.
- */
+ * Metadata for the search result.
+ */
const struct GNUNET_CONTAINER_MetaData *meta;
/**
- * URI for the search result.
- */
+ * URI for the search result.
+ */
const struct GNUNET_FS_Uri *uri;
/**
- * Handle to the result (for starting downloads).
- */
+ * Handle to the result (for starting downloads).
+ */
struct GNUNET_FS_SearchResult *result;
/**
- * Applicability rank (the larger, the better the result
- * fits the search criteria).
- */
+ * Applicability rank (the larger, the better the result
+ * fits the search criteria).
+ */
uint32_t applicability_rank;
-
} result;
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_SEARCH_RESUME_RESULT events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_SEARCH_RESUME_RESULT events.
+ */
+ struct {
/**
- * Metadata for the search result.
- */
+ * Metadata for the search result.
+ */
const struct GNUNET_CONTAINER_MetaData *meta;
/**
- * URI for the search result.
- */
+ * URI for the search result.
+ */
const struct GNUNET_FS_Uri *uri;
/**
- * Handle to the result (for starting downloads).
- */
+ * Handle to the result (for starting downloads).
+ */
struct GNUNET_FS_SearchResult *result;
/**
- * Current availability rank (negative:
- * unavailable, positive: available)
- */
+ * Current availability rank (negative:
+ * unavailable, positive: available)
+ */
int32_t availability_rank;
/**
- * On how many total queries is the given
- * availability_rank based?
- */
+ * On how many total queries is the given
+ * availability_rank based?
+ */
uint32_t availability_certainty;
/**
- * Updated applicability rank (the larger,
- * the better the result fits the search
- * criteria).
- */
+ * Updated applicability rank (the larger,
+ * the better the result fits the search
+ * criteria).
+ */
uint32_t applicability_rank;
-
} resume_result;
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_SEARCH_UPDATE events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_SEARCH_UPDATE events.
+ */
+ struct {
/**
- * Private context set for for this result
- * during the "RESULT" event.
- */
+ * Private context set for for this result
+ * during the "RESULT" event.
+ */
void *cctx;
/**
- * Metadata for the search result.
- */
+ * Metadata for the search result.
+ */
const struct GNUNET_CONTAINER_MetaData *meta;
/**
- * URI for the search result.
- */
+ * URI for the search result.
+ */
const struct GNUNET_FS_Uri *uri;
/**
- * Current availability rank (negative:
- * unavailable, positive: available)
- */
+ * Current availability rank (negative:
+ * unavailable, positive: available)
+ */
int32_t availability_rank;
/**
- * On how many total queries is the given
- * availability_rank based?
- */
+ * On how many total queries is the given
+ * availability_rank based?
+ */
uint32_t availability_certainty;
/**
- * Updated applicability rank (the larger,
- * the better the result fits the search
- * criteria).
- */
+ * Updated applicability rank (the larger,
+ * the better the result fits the search
+ * criteria).
+ */
uint32_t applicability_rank;
- /**
- * How long has the current probe been active?
- */
- struct GNUNET_TIME_Relative current_probe_time;
-
+ /**
+ * How long has the current probe been active?
+ */
+ struct GNUNET_TIME_Relative current_probe_time;
} update;
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND events.
- * These events are automatically triggered for
- * each search result before the
- * #GNUNET_FS_STATUS_SEARCH_SUSPEND event. This
- * happens primarily to give the client a chance
- * to clean up the "cctx" (if needed).
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND events.
+ * These events are automatically triggered for
+ * each search result before the
+ * #GNUNET_FS_STATUS_SEARCH_SUSPEND event. This
+ * happens primarily to give the client a chance
+ * to clean up the "cctx" (if needed).
+ */
+ struct {
/**
- * Private context set for for this result
- * during the "RESULT" event.
- */
+ * Private context set for for this result
+ * during the "RESULT" event.
+ */
void *cctx;
/**
- * Metadata for the search result.
- */
+ * Metadata for the search result.
+ */
const struct GNUNET_CONTAINER_MetaData *meta;
/**
- * URI for the search result.
- */
+ * URI for the search result.
+ */
const struct GNUNET_FS_Uri *uri;
-
} result_suspend;
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_SEARCH_RESULT_STOPPED events.
- * These events are automatically triggered for
- * each search result before the
- * #GNUNET_FS_STATUS_SEARCH_STOPPED event. This
- * happens primarily to give the client a chance
- * to clean up the "cctx" (if needed).
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_SEARCH_RESULT_STOPPED events.
+ * These events are automatically triggered for
+ * each search result before the
+ * #GNUNET_FS_STATUS_SEARCH_STOPPED event. This
+ * happens primarily to give the client a chance
+ * to clean up the "cctx" (if needed).
+ */
+ struct {
/**
- * Private context set for for this result
- * during the "RESULT" event.
- */
+ * Private context set for for this result
+ * during the "RESULT" event.
+ */
void *cctx;
/**
- * Metadata for the search result.
- */
+ * Metadata for the search result.
+ */
const struct GNUNET_CONTAINER_MetaData *meta;
/**
- * URI for the search result.
- */
+ * URI for the search result.
+ */
const struct GNUNET_FS_Uri *uri;
-
} result_stopped;
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_SEARCH_RESUME events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_SEARCH_RESUME events.
+ */
+ struct {
/**
- * Error message, NULL if we have not encountered any error yet.
- */
+ * Error message, NULL if we have not encountered any error yet.
+ */
const char *message;
/**
- * Is this search currently paused?
- */
+ * Is this search currently paused?
+ */
int is_paused;
-
} resume;
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_SEARCH_ERROR events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_SEARCH_ERROR events.
+ */
+ struct {
/**
- * Error message.
- */
+ * Error message.
+ */
const char *message;
-
} error;
/**
- * Values for #GNUNET_FS_STATUS_SEARCH_RESULT_NAMESPACE events.
- */
- struct
- {
-
+ * Values for #GNUNET_FS_STATUS_SEARCH_RESULT_NAMESPACE events.
+ */
+ struct {
/**
- * Short, human-readable name of the namespace.
- */
+ * Short, human-readable name of the namespace.
+ */
const char *name;
/**
- * Root identifier for the namespace, can be NULL.
- */
+ * Root identifier for the namespace, can be NULL.
+ */
const char *root;
/**
- * Metadata for the namespace.
- */
+ * Metadata for the namespace.
+ */
const struct GNUNET_CONTAINER_MetaData *meta;
/**
- * Public key of the namespace.
- */
+ * Public key of the namespace.
+ */
struct GNUNET_CRYPTO_EcdsaPublicKey pseudonym;
-
} ns;
-
} specifics;
-
} search;
/**
* Values for all "GNUNET_FS_STATUS_UNINDEX_*" events.
*/
- struct
- {
-
+ struct {
/**
* Context for controlling the unindexing.
*/
/**
* Additional values for specific events.
*/
- union
- {
-
+ union {
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_UNINDEX_PROGRESS events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_UNINDEX_PROGRESS events.
+ */
+ struct {
/**
- * Data block we just unindexed.
- */
+ * Data block we just unindexed.
+ */
const void *data;
/**
- * At what offset in the file is "data"?
- */
+ * At what offset in the file is "data"?
+ */
uint64_t offset;
/**
- * Length of the data block.
- */
+ * Length of the data block.
+ */
uint64_t data_len;
/**
- * Depth of the given block in the tree;
- * 0 would be the lowest level (DBLOCKS).
- */
+ * Depth of the given block in the tree;
+ * 0 would be the lowest level (DBLOCKS).
+ */
unsigned int depth;
-
} progress;
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_UNINDEX_RESUME events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_UNINDEX_RESUME events.
+ */
+ struct {
/**
- * Error message, NULL if we have not encountered any error yet.
- */
+ * Error message, NULL if we have not encountered any error yet.
+ */
const char *message;
-
} resume;
/**
- * These values are only valid for
- * #GNUNET_FS_STATUS_UNINDEX_ERROR events.
- */
- struct
- {
-
+ * These values are only valid for
+ * #GNUNET_FS_STATUS_UNINDEX_ERROR events.
+ */
+ struct {
/**
- * Error message.
- */
+ * Error message.
+ */
const char *message;
-
} error;
-
} specifics;
-
} unindex;
-
} value;
/**
/**
* General (global) option flags for file-sharing.
*/
-enum GNUNET_FS_Flags
-{
+enum GNUNET_FS_Flags {
/**
* No special flags set.
*/
/**
* Options specified in the VARARGs portion of GNUNET_FS_start.
*/
-enum GNUNET_FS_OPTIONS
-{
-
+enum GNUNET_FS_OPTIONS {
/**
* Last option in the VARARG list.
*/
* Settings for publishing a block (which may of course also
* apply to an entire directory or file).
*/
-struct GNUNET_FS_BlockOptions
-{
-
+struct GNUNET_FS_BlockOptions {
/**
* At what time should the block expire? Data blocks (DBLOCKS and
* IBLOCKS) may still be used even if they are expired (however,
* first place).
*/
uint32_t replication_level;
-
};
* @return NULL on error
*/
struct GNUNET_FS_Handle *
-GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
- const char *client_name,
- GNUNET_FS_ProgressCallback upcb,
- void *upcb_cls,
- enum GNUNET_FS_Flags flags,
- ...);
+GNUNET_FS_start(const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *client_name,
+ GNUNET_FS_ProgressCallback upcb,
+ void *upcb_cls,
+ enum GNUNET_FS_Flags flags,
+ ...);
/**
* @param h handle that was returned from #GNUNET_FS_start()
*/
void
-GNUNET_FS_stop (struct GNUNET_FS_Handle *h);
+GNUNET_FS_stop(struct GNUNET_FS_Handle *h);
/**
* to read this fi-struct from disk.
*/
const char *
-GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s);
+GNUNET_FS_file_information_get_id(struct GNUNET_FS_FileInformation *s);
/**
* @return "filename" field of the structure (can be NULL)
*/
const char *
-GNUNET_FS_file_information_get_filename (struct GNUNET_FS_FileInformation *s);
+GNUNET_FS_file_information_get_filename(struct GNUNET_FS_FileInformation *s);
/**
* @param filename filename to set
*/
void
-GNUNET_FS_file_information_set_filename (struct GNUNET_FS_FileInformation *s,
- const char *filename);
+GNUNET_FS_file_information_set_filename(struct GNUNET_FS_FileInformation *s,
+ const char *filename);
/**
* @return publish structure entry for the file
*/
struct GNUNET_FS_FileInformation *
-GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h,
- void *client_info,
- const char *filename,
- const struct GNUNET_FS_Uri *keywords,
- const struct GNUNET_CONTAINER_MetaData *meta,
- int do_index,
- const struct GNUNET_FS_BlockOptions *bo);
+GNUNET_FS_file_information_create_from_file(struct GNUNET_FS_Handle *h,
+ void *client_info,
+ const char *filename,
+ const struct GNUNET_FS_Uri *keywords,
+ const struct GNUNET_CONTAINER_MetaData *meta,
+ int do_index,
+ const struct GNUNET_FS_BlockOptions *bo);
/**
* @return publish structure entry for the file
*/
struct GNUNET_FS_FileInformation *
-GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h,
- void *client_info,
- uint64_t length,
- void *data,
- const struct GNUNET_FS_Uri *keywords,
- const struct GNUNET_CONTAINER_MetaData *meta,
- int do_index,
- const struct GNUNET_FS_BlockOptions *bo);
+GNUNET_FS_file_information_create_from_data(struct GNUNET_FS_Handle *h,
+ void *client_info,
+ uint64_t length,
+ void *data,
+ const struct GNUNET_FS_Uri *keywords,
+ const struct GNUNET_CONTAINER_MetaData *meta,
+ int do_index,
+ const struct GNUNET_FS_BlockOptions *bo);
/**
* @return publish structure entry for the file
*/
struct GNUNET_FS_FileInformation *
-GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h,
- void *client_info,
- uint64_t length,
- GNUNET_FS_DataReader reader,
- void *reader_cls,
- const struct GNUNET_FS_Uri
- *keywords,
- const struct
- GNUNET_CONTAINER_MetaData *meta,
- int do_index,
- const struct
- GNUNET_FS_BlockOptions *bo);
+GNUNET_FS_file_information_create_from_reader(struct GNUNET_FS_Handle *h,
+ void *client_info,
+ uint64_t length,
+ GNUNET_FS_DataReader reader,
+ void *reader_cls,
+ const struct GNUNET_FS_Uri
+ *keywords,
+ const struct
+ GNUNET_CONTAINER_MetaData *meta,
+ int do_index,
+ const struct
+ GNUNET_FS_BlockOptions *bo);
/**
* @return publish structure entry for the directory , NULL on error
*/
struct GNUNET_FS_FileInformation *
-GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h,
- void *client_info,
- const struct GNUNET_FS_Uri
- *keywords,
- const struct
- GNUNET_CONTAINER_MetaData
- *meta,
- const struct
- GNUNET_FS_BlockOptions *bo,
- const char *filename);
+GNUNET_FS_file_information_create_empty_directory(struct GNUNET_FS_Handle *h,
+ void *client_info,
+ const struct GNUNET_FS_Uri
+ *keywords,
+ const struct
+ GNUNET_CONTAINER_MetaData
+ *meta,
+ const struct
+ GNUNET_FS_BlockOptions *bo,
+ const char *filename);
/**
* @return #GNUNET_YES if so, #GNUNET_NO if not
*/
int
-GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation
- *ent);
+GNUNET_FS_file_information_is_directory(const struct GNUNET_FS_FileInformation
+ *ent);
/**
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
int
-GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir,
- struct GNUNET_FS_FileInformation *ent);
+GNUNET_FS_file_information_add(struct GNUNET_FS_FileInformation *dir,
+ struct GNUNET_FS_FileInformation *ent);
/**
* @param proc_cls closure for @a proc
*/
void
-GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir,
- GNUNET_FS_FileInformationProcessor proc,
- void *proc_cls);
+GNUNET_FS_file_information_inspect(struct GNUNET_FS_FileInformation *dir,
+ GNUNET_FS_FileInformationProcessor proc,
+ void *proc_cls);
/**
* @param cleaner_cls closure for @a cleaner
*/
void
-GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi,
- GNUNET_FS_FileInformationProcessor cleaner,
- void *cleaner_cls);
+GNUNET_FS_file_information_destroy(struct GNUNET_FS_FileInformation *fi,
+ GNUNET_FS_FileInformationProcessor cleaner,
+ void *cleaner_cls);
/**
* Options for publishing. Compatible options
* can be OR'ed together.
*/
-enum GNUNET_FS_PublishOptions
-{
+enum GNUNET_FS_PublishOptions {
/**
* No options (use defaults for everything).
*/
* @return context that can be used to control the publish operation
*/
struct GNUNET_FS_PublishContext *
-GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
- struct GNUNET_FS_FileInformation *fi,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
- const char *nid,
- const char *nuid,
- enum GNUNET_FS_PublishOptions options);
+GNUNET_FS_publish_start(struct GNUNET_FS_Handle *h,
+ struct GNUNET_FS_FileInformation *fi,
+ const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
+ const char *nid,
+ const char *nuid,
+ enum GNUNET_FS_PublishOptions options);
/**
* @param pc context for the publication to stop
*/
void
-GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc);
+GNUNET_FS_publish_stop(struct GNUNET_FS_PublishContext *pc);
/**
* @return NULL on error (@a cont will still be called)
*/
struct GNUNET_FS_PublishKskContext *
-GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
- const struct GNUNET_FS_Uri *ksk_uri,
- const struct GNUNET_CONTAINER_MetaData *meta,
- const struct GNUNET_FS_Uri *uri,
- const struct GNUNET_FS_BlockOptions *bo,
- enum GNUNET_FS_PublishOptions options,
- GNUNET_FS_PublishContinuation cont, void *cont_cls);
+GNUNET_FS_publish_ksk(struct GNUNET_FS_Handle *h,
+ const struct GNUNET_FS_Uri *ksk_uri,
+ const struct GNUNET_CONTAINER_MetaData *meta,
+ const struct GNUNET_FS_Uri *uri,
+ const struct GNUNET_FS_BlockOptions *bo,
+ enum GNUNET_FS_PublishOptions options,
+ GNUNET_FS_PublishContinuation cont, void *cont_cls);
/**
* @param pkc context of the operation to abort.
*/
void
-GNUNET_FS_publish_ksk_cancel (struct GNUNET_FS_PublishKskContext *pkc);
+GNUNET_FS_publish_ksk_cancel(struct GNUNET_FS_PublishKskContext *pkc);
/**
* @return NULL on error (@a cont will still be called)
*/
struct GNUNET_FS_PublishSksContext *
-GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
- const char *identifier,
- const char *update,
- const struct GNUNET_CONTAINER_MetaData *meta,
- const struct GNUNET_FS_Uri *uri,
- const struct GNUNET_FS_BlockOptions *bo,
- enum GNUNET_FS_PublishOptions options,
- GNUNET_FS_PublishContinuation cont, void *cont_cls);
+GNUNET_FS_publish_sks(struct GNUNET_FS_Handle *h,
+ const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
+ const char *identifier,
+ const char *update,
+ const struct GNUNET_CONTAINER_MetaData *meta,
+ const struct GNUNET_FS_Uri *uri,
+ const struct GNUNET_FS_BlockOptions *bo,
+ enum GNUNET_FS_PublishOptions options,
+ GNUNET_FS_PublishContinuation cont, void *cont_cls);
/**
* @param psc context of the operation to abort.
*/
void
-GNUNET_FS_publish_sks_cancel (struct GNUNET_FS_PublishSksContext *psc);
+GNUNET_FS_publish_sks_cancel(struct GNUNET_FS_PublishSksContext *psc);
/**
* @return NULL on error (@a iterator is not called)
*/
struct GNUNET_FS_GetIndexedContext *
-GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h,
- GNUNET_FS_IndexedFileProcessor iterator,
- void *iterator_cls);
+GNUNET_FS_get_indexed_files(struct GNUNET_FS_Handle *h,
+ GNUNET_FS_IndexedFileProcessor iterator,
+ void *iterator_cls);
/**
* @param gic operation to cancel
*/
void
-GNUNET_FS_get_indexed_files_cancel (struct GNUNET_FS_GetIndexedContext *gic);
+GNUNET_FS_get_indexed_files_cancel(struct GNUNET_FS_GetIndexedContext *gic);
/**
* @return NULL on error, otherwise handle
*/
struct GNUNET_FS_UnindexContext *
-GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h,
- const char *filename,
- void *cctx);
+GNUNET_FS_unindex_start(struct GNUNET_FS_Handle *h,
+ const char *filename,
+ void *cctx);
/**
* @param uc handle
*/
void
-GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc);
+GNUNET_FS_unindex_stop(struct GNUNET_FS_UnindexContext *uc);
/**
* @param next_id identifier that should be used for updates
*/
typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls,
- const char *last_id,
+ const char *last_id,
const struct GNUNET_FS_Uri *last_uri,
const struct GNUNET_CONTAINER_MetaData *last_meta,
- const char *next_id);
+ const char *next_id);
/**
* @param ip_cls closure for @a ip
*/
void
-GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Handle *h,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
- const char *next_id,
- GNUNET_FS_IdentifierProcessor ip,
- void *ip_cls);
+GNUNET_FS_namespace_list_updateable(struct GNUNET_FS_Handle *h,
+ const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
+ const char *next_id,
+ GNUNET_FS_IdentifierProcessor ip,
+ void *ip_cls);
/**
* Options for searching. Compatible options
* can be OR'ed together.
*/
-enum GNUNET_FS_SearchOptions
-{
- /**
- * No options (use defaults for everything).
- */
+enum GNUNET_FS_SearchOptions {
+ /**
+ * No options (use defaults for everything).
+ */
GNUNET_FS_SEARCH_OPTION_NONE = 0,
- /**
- * Only search the local host, do not search remote systems (no P2P)
- */
+ /**
+ * Only search the local host, do not search remote systems (no P2P)
+ */
GNUNET_FS_SEARCH_OPTION_LOOPBACK_ONLY = 1
};
* @return context that can be used to control the search
*/
struct GNUNET_FS_SearchContext *
-GNUNET_FS_search_start (struct GNUNET_FS_Handle *h,
- const struct GNUNET_FS_Uri *uri, uint32_t anonymity,
- enum GNUNET_FS_SearchOptions options, void *cctx);
+GNUNET_FS_search_start(struct GNUNET_FS_Handle *h,
+ const struct GNUNET_FS_Uri *uri, uint32_t anonymity,
+ enum GNUNET_FS_SearchOptions options, void *cctx);
/**
* @param sc context for the search that should be paused
*/
void
-GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc);
+GNUNET_FS_search_pause(struct GNUNET_FS_SearchContext *sc);
/**
* @param sc context for the search that should be resumed
*/
void
-GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc);
+GNUNET_FS_search_continue(struct GNUNET_FS_SearchContext *sc);
/**
* @param sc context for the search that should be stopped
*/
void
-GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc);
+GNUNET_FS_search_stop(struct GNUNET_FS_SearchContext *sc);
/**
* @return the search result handle to access the probe activity
*/
struct GNUNET_FS_SearchResult *
-GNUNET_FS_probe (struct GNUNET_FS_Handle *h,
- const struct GNUNET_FS_Uri *uri,
- const struct GNUNET_CONTAINER_MetaData *meta,
- void *client_info,
- uint32_t anonymity);
+GNUNET_FS_probe(struct GNUNET_FS_Handle *h,
+ const struct GNUNET_FS_Uri *uri,
+ const struct GNUNET_CONTAINER_MetaData *meta,
+ void *client_info,
+ uint32_t anonymity);
/**
* @return the value of the 'client_info' pointer
*/
void *
-GNUNET_FS_probe_stop (struct GNUNET_FS_SearchResult *sr);
+GNUNET_FS_probe_stop(struct GNUNET_FS_SearchResult *sr);
/**
* Options for downloading. Compatible options
* can be OR'ed together.
*/
-enum GNUNET_FS_DownloadOptions
-{
+enum GNUNET_FS_DownloadOptions {
/**
* No options (use defaults for everything).
*/
* @return context that can be used to control this download
*/
struct GNUNET_FS_DownloadContext *
-GNUNET_FS_download_start (struct GNUNET_FS_Handle *h,
- const struct GNUNET_FS_Uri *uri,
- const struct GNUNET_CONTAINER_MetaData *meta,
- const char *filename, const char *tempname,
- uint64_t offset, uint64_t length, uint32_t anonymity,
- enum GNUNET_FS_DownloadOptions options, void *cctx,
- struct GNUNET_FS_DownloadContext *parent);
+GNUNET_FS_download_start(struct GNUNET_FS_Handle *h,
+ const struct GNUNET_FS_Uri *uri,
+ const struct GNUNET_CONTAINER_MetaData *meta,
+ const char *filename, const char *tempname,
+ uint64_t offset, uint64_t length, uint32_t anonymity,
+ enum GNUNET_FS_DownloadOptions options, void *cctx,
+ struct GNUNET_FS_DownloadContext *parent);
/**
* @return context that can be used to control this download
*/
struct GNUNET_FS_DownloadContext *
-GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h,
- struct GNUNET_FS_SearchResult *sr,
- const char *filename,
- const char *tempname, uint64_t offset,
- uint64_t length, uint32_t anonymity,
- enum GNUNET_FS_DownloadOptions options,
- void *cctx);
+GNUNET_FS_download_start_from_search(struct GNUNET_FS_Handle *h,
+ struct GNUNET_FS_SearchResult *sr,
+ const char *filename,
+ const char *tempname, uint64_t offset,
+ uint64_t length, uint32_t anonymity,
+ enum GNUNET_FS_DownloadOptions options,
+ void *cctx);
/**
* @param do_delete delete files of incomplete downloads
*/
void
-GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete);
+GNUNET_FS_download_stop(struct GNUNET_FS_DownloadContext *dc, int do_delete);
/**
* @param dc handle for the download
*/
void
-GNUNET_FS_download_suspend (struct GNUNET_FS_DownloadContext *dc);
+GNUNET_FS_download_suspend(struct GNUNET_FS_DownloadContext *dc);
/**
* @param dc handle for the download
*/
void
-GNUNET_FS_download_resume (struct GNUNET_FS_DownloadContext *dc);
+GNUNET_FS_download_resume(struct GNUNET_FS_DownloadContext *dc);
* we have no mime-type information (treat as #GNUNET_NO)
*/
int
-GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData
- *md);
+GNUNET_FS_meta_data_test_for_directory(const struct GNUNET_CONTAINER_MetaData
+ *md);
/**
* @param md metadata to add mimetype to
*/
void
-GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md);
+GNUNET_FS_meta_data_make_directory(struct GNUNET_CONTAINER_MetaData *md);
/**
* @return NULL if meta data is useless for suggesting a filename
*/
char *
-GNUNET_FS_meta_data_suggest_filename (const struct GNUNET_CONTAINER_MetaData *md);
+GNUNET_FS_meta_data_suggest_filename(const struct GNUNET_CONTAINER_MetaData *md);
/**
* #GNUNET_SYSERR if 'data' does not represent a directory
*/
int
-GNUNET_FS_directory_list_contents (size_t size, const void *data,
- uint64_t offset,
- GNUNET_FS_DirectoryEntryProcessor dep,
- void *dep_cls);
+GNUNET_FS_directory_list_contents(size_t size, const void *data,
+ uint64_t offset,
+ GNUNET_FS_DirectoryEntryProcessor dep,
+ void *dep_cls);
/**
* @param mdir metadata for the directory
*/
struct GNUNET_FS_DirectoryBuilder *
-GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData
- *mdir);
+GNUNET_FS_directory_builder_create(const struct GNUNET_CONTAINER_MetaData
+ *mdir);
/**
* by the uri
*/
void
-GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld,
- const struct GNUNET_FS_Uri *uri,
- const struct GNUNET_CONTAINER_MetaData *md,
- const void *data);
+GNUNET_FS_directory_builder_add(struct GNUNET_FS_DirectoryBuilder *bld,
+ const struct GNUNET_FS_Uri *uri,
+ const struct GNUNET_CONTAINER_MetaData *md,
+ const void *data);
/**
* @return #GNUNET_OK on success
*/
int
-GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld,
- size_t * rsize, void **rdata);
+GNUNET_FS_directory_builder_finish(struct GNUNET_FS_DirectoryBuilder *bld,
+ size_t * rsize, void **rdata);
/* ******************** DirScanner API *********************** */
/**
* Progress reasons of the directory scanner.
*/
-enum GNUNET_FS_DirScannerProgressUpdateReason
-{
-
+enum GNUNET_FS_DirScannerProgressUpdateReason {
/**
* We've started processing a file or directory.
*/
* There was an internal error. Application should abort the scan.
*/
GNUNET_FS_DIRSCANNER_INTERNAL_ERROR
-
};
* @param reason kind of progress we are making
*/
typedef void (*GNUNET_FS_DirScannerProgressCallback) (void *cls,
- const char *filename,
- int is_directory,
- enum GNUNET_FS_DirScannerProgressUpdateReason reason);
+ const char *filename,
+ int is_directory,
+ enum GNUNET_FS_DirScannerProgressUpdateReason reason);
/**
* A node of a directory tree (produced by dirscanner)
*/
-struct GNUNET_FS_ShareTreeItem
-{
+struct GNUNET_FS_ShareTreeItem {
/**
* This is a doubly-linked list
*/
* #GNUNET_YES if this is a directory
*/
int is_directory;
-
};
* @return directory scanner object to be used for controlling the scanner
*/
struct GNUNET_FS_DirScanner *
-GNUNET_FS_directory_scan_start (const char *filename,
- int disable_extractor,
- const char *ex,
- GNUNET_FS_DirScannerProgressCallback cb,
- void *cb_cls);
+GNUNET_FS_directory_scan_start(const char *filename,
+ int disable_extractor,
+ const char *ex,
+ GNUNET_FS_DirScannerProgressCallback cb,
+ void *cb_cls);
/**
* @param ds directory scanner structure
*/
void
-GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds);
+GNUNET_FS_directory_scan_abort(struct GNUNET_FS_DirScanner *ds);
/**
* @return the results of the scan (a directory tree)
*/
struct GNUNET_FS_ShareTreeItem *
-GNUNET_FS_directory_scan_get_result (struct GNUNET_FS_DirScanner *ds);
+GNUNET_FS_directory_scan_get_result(struct GNUNET_FS_DirScanner *ds);
/**
* @param toplevel toplevel directory in the tree, returned by the scanner
*/
void
-GNUNET_FS_share_tree_trim (struct GNUNET_FS_ShareTreeItem *toplevel);
+GNUNET_FS_share_tree_trim(struct GNUNET_FS_ShareTreeItem *toplevel);
/**
* @param toplevel toplevel of the tree to be freed
*/
void
-GNUNET_FS_share_tree_free (struct GNUNET_FS_ShareTreeItem *toplevel);
+GNUNET_FS_share_tree_free(struct GNUNET_FS_ShareTreeItem *toplevel);
#if 0 /* keep Emacsens' auto-indent happy */