139 EXTRACTOR_METAFORMAT_C_STRING,
199 if (
ret->meta == NULL)
205 ret->data.file.file_size = length;
253 if ((ent->
dir != NULL) || (ent->
next != NULL) ||
260 ent->
next =
dir->data.dir.entries;
261 dir->data.dir.entries = ent;
262 dir->data.dir.dir_size = 0;
294 :
dir->data.file.file_size,
303 pos =
dir->data.dir.entries;
353 cleaner (cleaner_cls,
373 cleaner (cleaner_cls,
395 if (NULL != fi->
meta)
void * GNUNET_FS_make_file_reader_context_(const char *filename)
Create the closure for the GNUNET_FS_data_reader_file_() callback.
size_t GNUNET_FS_data_reader_copy_(void *cls, uint64_t offset, size_t max, void *buf, char **emsg)
Function that provides data by copying from a buffer.
size_t GNUNET_FS_data_reader_file_(void *cls, uint64_t offset, size_t max, void *buf, char **emsg)
Function that provides data by reading from a file.
shared definitions for the FS library
void GNUNET_FS_tree_encoder_finish(struct GNUNET_FS_TreeEncoder *te, char **emsg)
Clean up a tree encoder and return information about possible errors.
Merkle-tree-ish-CHK file encoding for GNUnet.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
static int ret
Final status code.
static char * dir
Set to the directory where runtime files are stored.
static char * data
The data to insert into the dht.
static struct GNUNET_FS_MetaData * meta
Meta-data provided via command-line option.
static struct GNUNET_FS_BlockOptions bo
Options we set for published blocks.
API for file sharing via GNUnet.
enum GNUNET_GenericReturnValue GNUNET_DISK_file_size(const char *filename, uint64_t *size, int include_symbolic_links, int single_file_mode)
Get the size of the file (or directory) of the given file (in bytes).
struct GNUNET_FS_Uri * GNUNET_FS_uri_dup(const struct GNUNET_FS_Uri *uri)
Duplicate URI.
#define EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME
const char * GNUNET_FS_file_information_get_filename(const struct GNUNET_FS_FileInformation *s)
Obtain the filename from the file information structure.
int(* GNUNET_FS_FileInformationProcessor)(void *cls, struct GNUNET_FS_FileInformation *fi, uint64_t length, struct GNUNET_FS_MetaData *meta, struct GNUNET_FS_Uri **uri, struct GNUNET_FS_BlockOptions *bo, int *do_index, void **client_info)
Function called on entries in a struct GNUNET_FS_FileInformation iteration.
size_t(* GNUNET_FS_DataReader)(void *cls, uint64_t offset, size_t max, void *buf, char **emsg)
Function that provides data.
int GNUNET_FS_file_information_add(struct GNUNET_FS_FileInformation *dir, struct GNUNET_FS_FileInformation *ent)
Add an entry to a directory in a publish-structure.
void GNUNET_FS_file_information_inspect(struct GNUNET_FS_FileInformation *dir, GNUNET_FS_FileInformationProcessor proc, void *proc_cls)
Inspect a file or directory in a publish-structure.
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_FS_MetaData *meta, const struct GNUNET_FS_BlockOptions *bo, const char *filename)
Create an entry for an empty directory in a publish-structure.
void GNUNET_FS_uri_destroy(struct GNUNET_FS_Uri *uri)
Free URI.
void GNUNET_FS_file_information_set_filename(struct GNUNET_FS_FileInformation *s, const char *filename)
Set the filename in the file information structure.
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_FS_MetaData *meta, int do_index, const struct GNUNET_FS_BlockOptions *bo)
Create an entry for a file in a publish-structure.
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_FS_MetaData *meta, int do_index, const struct GNUNET_FS_BlockOptions *bo)
Create an entry for a file in a publish-structure.
int GNUNET_FS_file_information_is_directory(const struct GNUNET_FS_FileInformation *ent)
Test if a given entry represents a directory.
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_FS_MetaData *meta, int do_index, const struct GNUNET_FS_BlockOptions *bo)
Create an entry for a file in a publish-structure.
void GNUNET_FS_file_information_destroy(struct GNUNET_FS_FileInformation *fi, GNUNET_FS_FileInformationProcessor cleaner, void *cleaner_cls)
Destroy publish-structure.
const char * GNUNET_FS_file_information_get_id(struct GNUNET_FS_FileInformation *s)
Obtain the name under which this file information structure is stored on disk.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
#define GNUNET_log_strerror_file(level, cmd, filename)
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the mess...
@ GNUNET_ERROR_TYPE_WARNING
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
Closure for GNUNET_FS_data_reader_file_().
Settings for publishing a block (which may of course also apply to an entire directory or file).
Master context for most FS operations.
A Universal Resource Identifier (URI), opaque.