diff options
-rw-r--r-- | src/include/gnunet_fs_service.h | 92 |
1 files changed, 42 insertions, 50 deletions
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 179a56529..f8a20c75b 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h | |||
@@ -2601,45 +2601,44 @@ GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, | |||
2601 | */ | 2601 | */ |
2602 | enum GNUNET_FS_DirScannerProgressUpdateReason | 2602 | enum GNUNET_FS_DirScannerProgressUpdateReason |
2603 | { | 2603 | { |
2604 | /** | ||
2605 | * FIXME | ||
2606 | */ | ||
2607 | GNUNET_FS_DIRSCANNER_FIRST = 0, | ||
2608 | 2604 | ||
2609 | /** | 2605 | /** |
2610 | * FIXME | 2606 | * We've started processing a file or directory. |
2611 | */ | 2607 | */ |
2612 | GNUNET_FS_DIRSCANNER_NEW_FILE = 1, | 2608 | GNUNET_FS_DIRSCANNER_FILE_START = 0, |
2613 | 2609 | ||
2614 | /** | 2610 | /** |
2615 | * FIXME | 2611 | * We've finished processing a subtree in the pre-pass. |
2616 | */ | 2612 | */ |
2617 | GNUNET_FS_DIRSCANNER_DOES_NOT_EXIST = 2, | 2613 | GNUNET_FS_DIRSCANNER_SUBTREE_COUNTED, |
2618 | 2614 | ||
2619 | /** | 2615 | /** |
2620 | * FIXME | 2616 | * We've found all files (in the pre-pass). |
2621 | */ | 2617 | */ |
2622 | GNUNET_FS_DIRSCANNER_ASKED_TO_STOP = 3, | 2618 | GNUNET_FS_DIRSCANNER_ALL_COUNTED, |
2623 | 2619 | ||
2624 | /** | 2620 | /** |
2625 | * FIXME | 2621 | * We've finished extracting meta data from a file. |
2626 | */ | 2622 | */ |
2627 | GNUNET_FS_DIRSCANNER_FINISHED = 4, | 2623 | GNUNET_FS_DIRSCANNER_EXTRACT_FINISHED, |
2628 | 2624 | ||
2629 | /** | 2625 | /** |
2630 | * FIXME | 2626 | * Last call to the progress function: we have finished scanning |
2627 | * the directory. | ||
2631 | */ | 2628 | */ |
2632 | GNUNET_FS_DIRSCANNER_PROTOCOL_ERROR = 5, | 2629 | GNUNET_FS_DIRSCANNER_FINISHED, |
2633 | 2630 | ||
2634 | /** | 2631 | /** |
2635 | * FIXME | 2632 | * We're having trouble accessing a file (soft-error); it will |
2633 | * be ignored. | ||
2636 | */ | 2634 | */ |
2637 | GNUNET_FS_DIRSCANNER_SHUTDOWN = 6, | 2635 | GNUNET_FS_DIRSCANNER_DOES_NOT_EXIST, |
2638 | 2636 | ||
2639 | /** | 2637 | /** |
2640 | * FIXME | 2638 | * There was an internal error. Application should abort the scan. |
2641 | */ | 2639 | */ |
2642 | GNUNET_FS_DIRSCANNER_LAST = 7 | 2640 | GNUNET_FS_DIRSCANNER_INTERNAL_ERROR |
2641 | |||
2643 | }; | 2642 | }; |
2644 | 2643 | ||
2645 | 2644 | ||
@@ -2650,14 +2649,16 @@ enum GNUNET_FS_DirScannerProgressUpdateReason | |||
2650 | * @param cls closure | 2649 | * @param cls closure |
2651 | * @param ds handle to the directory scanner (NEEDED!?) | 2650 | * @param ds handle to the directory scanner (NEEDED!?) |
2652 | * @param filename which file we are making progress on | 2651 | * @param filename which file we are making progress on |
2653 | * @param is_directory GNUNET_YES if this is a directory | 2652 | * @param is_directory GNUNET_YES if this is a directory, |
2653 | * GNUNET_NO if this is a file | ||
2654 | * GNUNET_SYSERR if it is neither (or unknown) | ||
2654 | * @param reason kind of progress we are making | 2655 | * @param reason kind of progress we are making |
2655 | */ | 2656 | */ |
2656 | typedef int (*GNUNET_FS_DirScannerProgressCallback) (void *cls, | 2657 | typedef void (*GNUNET_FS_DirScannerProgressCallback) (void *cls, |
2657 | struct GNUNET_FS_DirScanner *ds, | 2658 | struct GNUNET_FS_DirScanner *ds, |
2658 | const char *filename, | 2659 | const char *filename, |
2659 | int is_directory, | 2660 | int is_directory, |
2660 | enum GNUNET_FS_DirScannerProgressUpdateReason reason); | 2661 | enum GNUNET_FS_DirScannerProgressUpdateReason reason); |
2661 | 2662 | ||
2662 | 2663 | ||
2663 | /** | 2664 | /** |
@@ -2733,7 +2734,7 @@ struct GNUNET_FS_DirScanner; | |||
2733 | 2734 | ||
2734 | 2735 | ||
2735 | /** | 2736 | /** |
2736 | * Start a directory scanner thread. | 2737 | * Start a directory scanner. |
2737 | * | 2738 | * |
2738 | * @param filename name of the directory to scan | 2739 | * @param filename name of the directory to scan |
2739 | * @param GNUNET_YES to not to run libextractor on files (only build a tree) | 2740 | * @param GNUNET_YES to not to run libextractor on files (only build a tree) |
@@ -2751,52 +2752,43 @@ GNUNET_FS_directory_scan_start (const char *filename, | |||
2751 | 2752 | ||
2752 | 2753 | ||
2753 | /** | 2754 | /** |
2754 | * Signals the scanner to finish the scan as fast as possible. Does | 2755 | * Abort the scan. |
2755 | * not block. Can close the pipe if asked to, but that is only used | ||
2756 | * by the internal call to this function during cleanup. The client | ||
2757 | * must understand the consequences of closing the pipe too early. | ||
2758 | * | 2756 | * |
2759 | * @param ds directory scanner structure | 2757 | * @param ds directory scanner structure |
2760 | * @param close_pipe GNUNET_YES to close | ||
2761 | */ | 2758 | */ |
2762 | void | 2759 | void |
2763 | GNUNET_FS_directory_scan_finish (struct GNUNET_FS_DirScanner *ds, | 2760 | GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds); |
2764 | int close_pipe); | ||
2765 | 2761 | ||
2766 | 2762 | ||
2767 | /** | 2763 | /** |
2768 | * Signals the scanner thread to finish (in case it isn't finishing | 2764 | * Obtain the result of the scan after the scan has signalled |
2769 | * already) and joins the scanner thread. Closes the pipes, frees the | 2765 | * completion. Must not be called prior to completion. The 'ds' is |
2770 | * scanner contexts (both of them), returns the results of the scan. | 2766 | * freed as part of this call. |
2771 | * Results are valid (and have to be freed) even if the scanner had | ||
2772 | * an error or was rushed to finish prematurely. | ||
2773 | * Blocks until the scanner is finished. | ||
2774 | * | 2767 | * |
2775 | * @param ds directory scanner structure | 2768 | * @param ds directory scanner structure |
2776 | * @return the results of the scan (a directory tree) | 2769 | * @return the results of the scan (a directory tree) |
2777 | */ | 2770 | */ |
2778 | struct GNUNET_FS_ShareTreeItem * | 2771 | struct GNUNET_FS_ShareTreeItem * |
2779 | GNUNET_FS_directory_scan_cleanup (struct GNUNET_FS_DirScanner *ds); | 2772 | GNUNET_FS_directory_scan_get_result (struct GNUNET_FS_DirScanner *ds); |
2780 | 2773 | ||
2781 | 2774 | ||
2782 | /** | 2775 | /** |
2783 | * opaque | ||
2784 | */ | ||
2785 | struct GNUNET_FS_ProcessMetadataContext; | ||
2786 | |||
2787 | /** | ||
2788 | * Process a share item tree, moving frequent keywords up and | 2776 | * Process a share item tree, moving frequent keywords up and |
2789 | * copying frequent metadata up. | 2777 | * copying frequent metadata up. |
2790 | * | 2778 | * |
2791 | * @param toplevel toplevel directory in the tree, returned by the scanner | 2779 | * @param toplevel toplevel directory in the tree, returned by the scanner |
2792 | * @param cb called after processing is done | ||
2793 | * @param cls closure for 'cb' | ||
2794 | * @return FIXME: what would this handle be used for? | ||
2795 | */ | 2780 | */ |
2796 | struct GNUNET_FS_ProcessMetadataContext * | 2781 | void |
2797 | GNUNET_FS_trim_share_tree (struct GNUNET_FS_ShareTreeItem *toplevel, | 2782 | GNUNET_FS_share_tree_trim (struct GNUNET_FS_ShareTreeItem *toplevel); |
2798 | GNUNET_SCHEDULER_Task cb, void *cls); | 2783 | |
2799 | 2784 | ||
2785 | /** | ||
2786 | * Release memory of a share item tree. | ||
2787 | * | ||
2788 | * @param toplevel toplevel of the tree to be freed | ||
2789 | */ | ||
2790 | void | ||
2791 | GNUNET_FS_share_tree_free (struct GNUNET_FS_ShareTreeItem *toplevel); | ||
2800 | 2792 | ||
2801 | 2793 | ||
2802 | #if 0 /* keep Emacsens' auto-indent happy */ | 2794 | #if 0 /* keep Emacsens' auto-indent happy */ |