projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use Suffix Extensions in Makefiles (doc, src/{arm,dht,integration,statistics}) for...
[oweals/gnunet.git]
/
src
/
fs
/
fs_dirmetascan.c
diff --git
a/src/fs/fs_dirmetascan.c
b/src/fs/fs_dirmetascan.c
index 1df07a01cbebca92ba5b434b600446f15aaf8daf..7b9f178fdcf511a17f0fb9a373aeb0a9b2e53fd6 100644
(file)
--- a/
src/fs/fs_dirmetascan.c
+++ b/
src/fs/fs_dirmetascan.c
@@
-1,6
+1,6
@@
/*
This file is part of GNUnet
/*
This file is part of GNUnet
- (C) 2005-2012 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2005-2012 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@
-14,8
+14,8
@@
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 5
9 Temple Place - Suite 330
,
- Boston, MA 0211
1-1307
, USA.
+ Free Software Foundation, Inc., 5
1 Franklin Street, Fifth Floor
,
+ Boston, MA 0211
0-1301
, USA.
*/
/**
*/
/**
@@
-80,7
+80,7
@@
struct GNUNET_FS_DirScanner
/**
* Task scheduled when we are done.
*/
/**
* Task scheduled when we are done.
*/
-
GNUNET_SCHEDULER_TaskIdentifier
stop_task;
+
struct GNUNET_SCHEDULER_Task *
stop_task;
/**
* Arguments for helper.
/**
* Arguments for helper.
@@
-90,7
+90,6
@@
struct GNUNET_FS_DirScanner
};
};
-
/**
* Abort the scan. Must not be called from within the progress_callback
* function.
/**
* Abort the scan. Must not be called from within the progress_callback
* function.
@@
-107,7
+106,7
@@
GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds)
/* free resources */
if (NULL != ds->toplevel)
GNUNET_FS_share_tree_free (ds->toplevel);
/* free resources */
if (NULL != ds->toplevel)
GNUNET_FS_share_tree_free (ds->toplevel);
- if (
GNUNET_SCHEDULER_NO_TASK
!= ds->stop_task)
+ if (
NULL
!= ds->stop_task)
GNUNET_SCHEDULER_cancel (ds->stop_task);
GNUNET_free_non_null (ds->ex_arg);
GNUNET_free (ds->filename_expanded);
GNUNET_SCHEDULER_cancel (ds->stop_task);
GNUNET_free_non_null (ds->ex_arg);
GNUNET_free (ds->filename_expanded);
@@
-197,7
+196,7
@@
expand_tree (struct GNUNET_FS_ShareTreeItem *parent,
struct GNUNET_FS_ShareTreeItem *chld;
size_t slen;
struct GNUNET_FS_ShareTreeItem *chld;
size_t slen;
- chld = GNUNET_
malloc (sizeof (struct GNUNET_FS_ShareTreeItem)
);
+ chld = GNUNET_
new (struct GNUNET_FS_ShareTreeItem
);
chld->parent = parent;
chld->filename = GNUNET_strdup (filename);
GNUNET_asprintf (&chld->short_filename,
chld->parent = parent;
chld->filename = GNUNET_strdup (filename);
GNUNET_asprintf (&chld->short_filename,
@@
-223,15
+222,13
@@
expand_tree (struct GNUNET_FS_ShareTreeItem *parent,
* Task run last to shut everything down.
*
* @param cls the 'struct GNUNET_FS_DirScanner'
* Task run last to shut everything down.
*
* @param cls the 'struct GNUNET_FS_DirScanner'
- * @param tc unused
*/
static void
*/
static void
-finish_scan (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+finish_scan (void *cls)
{
struct GNUNET_FS_DirScanner *ds = cls;
{
struct GNUNET_FS_DirScanner *ds = cls;
- ds->stop_task =
GNUNET_SCHEDULER_NO_TASK
;
+ ds->stop_task =
NULL
;
if (NULL != ds->helper)
{
GNUNET_HELPER_stop (ds->helper, GNUNET_NO);
if (NULL != ds->helper)
{
GNUNET_HELPER_stop (ds->helper, GNUNET_NO);
@@
-248,12
+245,10
@@
finish_scan (void *cls,
* Calls the scanner progress handler.
*
* @param cls the closure (directory scanner object)
* Calls the scanner progress handler.
*
* @param cls the closure (directory scanner object)
- * @param client always NULL
* @param msg message from the helper process
*/
static int
process_helper_msgs (void *cls,
* @param msg message from the helper process
*/
static int
process_helper_msgs (void *cls,
- void *client,
const struct GNUNET_MessageHeader *msg)
{
struct GNUNET_FS_DirScanner *ds = cls;
const struct GNUNET_MessageHeader *msg)
{
struct GNUNET_FS_DirScanner *ds = cls;
@@
-428,7
+423,7
@@
helper_died_cb (void *cls)
struct GNUNET_FS_DirScanner *ds = cls;
ds->helper = NULL;
struct GNUNET_FS_DirScanner *ds = cls;
ds->helper = NULL;
- if (
GNUNET_SCHEDULER_NO_TASK
!= ds->stop_task)
+ if (
NULL
!= ds->stop_task)
return; /* normal death, was finished */
ds->progress_callback (ds->progress_callback_cls,
NULL, GNUNET_SYSERR,
return; /* normal death, was finished */
ds->progress_callback (ds->progress_callback_cls,
NULL, GNUNET_SYSERR,
@@
-440,7
+435,8
@@
helper_died_cb (void *cls)
* Start a directory scanner thread.
*
* @param filename name of the directory to scan
* Start a directory scanner thread.
*
* @param filename name of the directory to scan
- * @param disable_extractor #GNUNET_YES to not to run libextractor on files (only build a tree)
+ * @param disable_extractor #GNUNET_YES to not run libextractor on files (only
+ * build a tree)
* @param ex if not NULL, must be a list of extra plugins for extractor
* @param cb the callback to call when there are scanning progress messages
* @param cb_cls closure for 'cb'
* @param ex if not NULL, must be a list of extra plugins for extractor
* @param cb the callback to call when there are scanning progress messages
* @param cb_cls closure for 'cb'
@@
-464,7
+460,7
@@
GNUNET_FS_directory_scan_start (const char *filename,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting to scan directory `%s'\n",
filename_expanded);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting to scan directory `%s'\n",
filename_expanded);
- ds = GNUNET_
malloc (sizeof (struct GNUNET_FS_DirScanner)
);
+ ds = GNUNET_
new (struct GNUNET_FS_DirScanner
);
ds->progress_callback = cb;
ds->progress_callback_cls = cb_cls;
ds->filename_expanded = filename_expanded;
ds->progress_callback = cb;
ds->progress_callback_cls = cb_cls;
ds->filename_expanded = filename_expanded;