94 _ (
"Unindexing at %llu/%llu (%s remaining)\n"),
95 (
unsigned long long)
info->value.unindex.completed,
96 (
unsigned long long)
info->value.unindex.size,
103 _ (
"Error unindexing: %s.\n"),
104 info->value.unindex.specifics.error.message);
109 fprintf (stdout,
"%s",
_ (
"Unindexing done.\n"));
118 fprintf (stderr,
_ (
"Unexpected status: %d\n"),
info->status);
140 if ((
args[0] == NULL) || (
args[1] != NULL))
142 printf (
_ (
"You must specify one and only one filename for unindexing.\n"));
155 fprintf (stderr,
_ (
"Could not initialize `%s' subsystem.\n"),
"FS");
162 fprintf (stderr,
"%s",
_ (
"Could not start unindex operation.\n"));
178main (
int argc,
char *
const *argv)
193 "gnunet-unindex [OPTIONS] FILENAME",
195 "Unindex a file that was previously indexed with gnunet-publish."),
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
struct GNUNET_GETOPT_CommandLineOption options[]
static mp_limb_t u[(((256)+GMP_NUMB_BITS - 1)/GMP_NUMB_BITS)]
#define gettext_noop(String)
static unsigned int verbose
static const struct GNUNET_CONFIGURATION_Handle * cfg
static struct GNUNET_FS_UnindexContext * uc
static void cleanup_task(void *cls)
static void shutdown_task(void *cls)
static void * progress_cb(void *cls, const struct GNUNET_FS_ProgressInfo *info)
Called by FS client to give information about the progress of an operation.
static struct GNUNET_FS_Handle * ctx
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
Main function that will be run by the scheduler.
int main(int argc, char *const *argv)
The main function to unindex content.
API for file sharing via GNUnet.
void GNUNET_FS_unindex_stop(struct GNUNET_FS_UnindexContext *uc)
Clean up after completion of an unindex operation.
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,...)
Setup a connection to the file-sharing service.
void GNUNET_FS_stop(struct GNUNET_FS_Handle *h)
Close our connection with the file-sharing service.
struct GNUNET_FS_UnindexContext * GNUNET_FS_unindex_start(struct GNUNET_FS_Handle *h, const char *filename, void *cctx)
Unindex a file.
@ GNUNET_FS_FLAGS_NONE
No special flags set.
@ GNUNET_FS_OPTIONS_END
Last option in the VARARG list.
@ GNUNET_FS_STATUS_UNINDEX_PROGRESS
Notification that we made progress unindexing a file.
@ GNUNET_FS_STATUS_UNINDEX_START
Notification that we started to unindex a file.
@ GNUNET_FS_STATUS_UNINDEX_STOPPED
Notification that the unindexing of this file was stopped (final event for this action).
@ GNUNET_FS_STATUS_UNINDEX_COMPLETED
Notification that the unindexing of this file was completed.
@ GNUNET_FS_STATUS_UNINDEX_ERROR
Notification that we encountered an error unindexing a file.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_verbose(unsigned int *level)
Define the '-V' verbosity option.
#define GNUNET_free_nz(ptr)
Wrapper around free.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls)
Run a standard GNUnet command startup sequence (initialize loggers and configuration,...
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received,...
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
enum GNUNET_GenericReturnValue GNUNET_STRINGS_get_utf8_args(int argc, char *const *argv, int *u8argc, char *const **u8argv)
Returns utf-8 encoded arguments.
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
Master context for most FS operations.
Argument given to the progress callback with information about what is going on.
Handle for controlling an unindexing operation.
Definition of a command line option.