61 u->data.ksk.keywordCount = 0;
62 u->data.ksk.keywords = NULL;
68 slen = strlen (
value);
76 if ((
value[1] ==
'"') && (slen > 3) && (
value[slen - 1] ==
'"'))
94 if ((
value[0] ==
'"') && (slen > 2) && (
value[slen - 1] ==
'"'))
102 val[slen - 1] =
'\0';
113 u->data.ksk.keywordCount,
140 .require_argument = 1,
169#if HAVE_EXTRACTOR_H && HAVE_LIBEXTRACTOR
170 enum EXTRACTOR_MetaType
type;
171 const char *
typename;
172 const char *typename_i18n;
189#if HAVE_EXTRACTOR_H && HAVE_LIBEXTRACTOR
190 type = EXTRACTOR_metatype_get_max ();
194 typename = EXTRACTOR_metatype_to_string (
type);
196 if ((strlen (tmp) >= strlen (
typename) + 1) &&
197 (tmp[strlen (
typename)] ==
':') &&
198 (0 == strncmp (
typename, tmp, strlen (
typename))))
201 EXTRACTOR_METAFORMAT_UTF8,
203 &tmp[strlen (
typename) + 1],
204 strlen (&tmp[strlen (
typename) + 1])
210 if ((strlen (tmp) >= strlen (typename_i18n) + 1) &&
211 (tmp[strlen (typename_i18n)] ==
':') &&
212 (0 == strncmp (typename_i18n, tmp, strlen (typename_i18n))))
215 EXTRACTOR_METAFORMAT_UTF8,
217 &tmp[strlen (typename_i18n) + 1],
219 [strlen (typename_i18n) + 1])
231 EXTRACTOR_METATYPE_UNKNOWN,
232 EXTRACTOR_METAFORMAT_UTF8,
"text/plain",
233 tmp, strlen (tmp) + 1);
237 "Unknown metadata type in metadata option `%s'. Using metadata type `unknown' instead.\n"),
265 .require_argument = 1,
267 .scls = (
void *)
meta
static mp_limb_t u[(((256)+GMP_NUMB_BITS - 1)/GMP_NUMB_BITS)]
shared definitions for the FS library
@ GNUNET_FS_URI_KSK
Keyword search key (query with keywords).
static int getopt_set_keywords(struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, void *scls, const char *option, const char *value)
Command-line option parser function that allows the user to specify one or more '-k' options with key...
static int getopt_set_metadata(struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, void *scls, const char *option, const char *value)
Command-line option parser function that allows the user to specify one or more '-m' options with met...
#define dgettext(Domainname, Msgid)
static struct GNUNET_FS_Handle * ctx
static char * name
Name (label) of the records to list.
static char * value
Value of the record to add/remove.
static uint32_t type
Type string converted to DNS type value.
static struct GNUNET_FS_Uri * uri
Value of URI provided on command-line (when not publishing a file but just creating UBlocks to refer ...
static struct GNUNET_FS_MetaData * meta
Meta-data provided via command-line option.
static struct GNUNET_FS_Uri * topKeywords
Keywords provided via command-line option.
API for file sharing via GNUnet.
struct GNUNET_GETOPT_CommandLineOption GNUNET_FS_GETOPT_METADATA(char shortName, const char *name, const char *argumentHelp, const char *description, struct GNUNET_FS_MetaData **meta)
Allow user to specify metadata.
struct GNUNET_GETOPT_CommandLineOption GNUNET_FS_GETOPT_KEYWORDS(char shortName, const char *name, const char *argumentHelp, const char *description, struct GNUNET_FS_Uri **topKeywords)
Allow user to specify keywords.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_array_append(arr, len, element)
Append an element to an array (growing the array by one).
#define GNUNET_free(ptr)
Wrapper around free.
A Universal Resource Identifier (URI), opaque.
Definition of a command line option.
const char * description
Help text for the option (description)
const char * argumentHelp
Name of the argument for the user in help text.
void * scls
Specific closure to pass to the processor.
const char shortName
Short name of the option.
General context for command line processors.