-/* local functions */
-int is_dir P((char *fname));
-int is_emptyfile P((char *fname));
-int is_datestr P((char *fname));
-int non_empty P((char *fname));
-void free_holding_list P(( sl_t *holding_list));
-sl_t *get_flush(sl_t *dateargs, char *datestamp, int amflush, int verbose);
-sl_t *pick_datestamp P((int verbose));
-sl_t *pick_all_datestamp P((int verbose));
-filetype_t get_amanda_names P((char *fname,
- char **hostname,
- char **diskname,
- int *level));
-void get_dumpfile P((char *fname, dumpfile_t *file));
-long size_holding_files P((char *holding_file, int strip_headers));
-int unlink_holding_files P((char *holding_file));
-int rename_tmp_holding P((char *holding_file, int complete));
-void cleanup_holdingdisk P((char *diskdir, int verbose));
-int mkholdingdir P((char *diskdir));
+/*
+ * Verbosity
+ */
+
+/* Set verbose flag for holding-disk functions
+ *
+ * @param verbose: if true, log verbosely to stdout
+ * @returns: old verbosity
+ */
+int
+holding_set_verbosity(int verbose);
+
+/*
+ * Holding disks
+ *
+ * Use getconf_holdingdisks() to access the list of holding disks.
+ */
+
+/*
+ * Holding directories
+ */
+
+/* Get a list of holding directories, optionally limited to a single
+ * holding disk. Can return a list either of full pathnames or of
+ * bare directory names (datestamps).
+ *
+ * @param hdisk: holding disk to enumerate, or NULL for all
+ * @param date_list: Limit to thes timestamps.
+ * @param fullpaths: if true, return full pathnames
+ * @returns: newly allocated sl_t of matching directories
+ */
+sl_t *
+holding_get_directories(char *hdisk,
+ sl_t *date_list,
+ int fullpaths);
+
+/*
+ * Holding files
+ */
+
+/* Get a list of holding files, optionally limited to a single holding
+ * directory. Can return a list either of full pathnames or of
+ * bare file names.
+ *
+ * @param hdir: holding directory to enumerate, or NULL for all
+ * @param date_list: Limit to thes timestamps.
+ * @param fullpaths: if true, return full pathnames
+ * @returns: newly allocated sl_t of matching files
+ */
+sl_t *
+holding_get_files(char *hdir,
+ sl_t *date_list,
+ int fullpaths);
+
+/* Get a list of holding files that should be flushed, optionally
+ * matching only certain datestamps. This function filters out
+ * files for host/disks that are no longer in the disklist.
+ *
+ * @param dateargs: sl_t of datestamps to dump, or NULL for all
+ * @param interactive: if true, be interactive
+ * @returns: a newly allocated sl_t listing all matching holding
+ * files
+ */
+sl_t *
+holding_get_files_for_flush(sl_t *dateargs,
+ int interactive);
+
+/* Get the total size of a holding file, including all holding
+ * file chunks, in kilobytes.
+ *
+ * @param holding_file: full pathname of holding file
+ * @param strip_headers: if true, don't count the headers in the
+ * total size
+ * @returns: total size of the holding file, or -1 in an error
+ */
+off_t
+holding_file_size(char *holding_file,
+ int strip_headers);
+
+/* Unlink a holding file, including all holding file chunks.
+ *
+ * @param holding_file: full pathname of holding file
+ * @returns: 1 on success, else 0
+ */
+int
+holding_file_unlink(char *holding_file);
+
+/* Given a pathname of a holding file, extract the hostname, diskname,
+ * level, and filetype from the header.
+ *
+ * Caller is responsible for freeing memory for hostname and diskname.
+ * None of the result parameters can be NULL.
+ *
+ * @param fname: full pathname of holding file
+ * @param hostname: (result) hostname
+ * @param diskname: (result) diskname
+ * @param level: (result) level
+ * @param datestamp: (result) datestamp of the dump
+ * @returns: filetype (see common-src/fileheader.h)
+ */
+filetype_t
+holding_file_read_header(char *fname,
+ char **hostname,
+ char **diskname,
+ int *level,
+ char **datestamp);
+
+/* Given a pathname of a holding file, read the file header.
+ * the result parameter may be altered even if an error is
+ * returned.
+ *
+ * @param fname: full pathname of holding file
+ * @param file: (result) dumpfile_t structure
+ * @returns: 1 on success, else 0
+ */
+int
+holding_file_get_dumpfile(char *fname,
+ dumpfile_t *file);
+
+/*
+ * Holding file chunks
+ */
+
+/* Get a list of holding files chunks in the given holding
+ * file. Always returns full paths.
+ *
+ * @param hfile: holding file to enumerate
+ * @returns: newly allocated sl_t of matching holding file chunks
+ */
+sl_t *
+holding_get_file_chunks(char *hfile);
+
+/*
+ * application-specific support
+ */
+
+/* Allow the user to select a set of datestamps from those in
+ * holding disks.
+ *
+ * @param verbose: verbose logging to stdout
+ * @returns: a new sl_t listing all matching datestamps
+ */
+sl_t *
+pick_datestamp(int verbose);
+
+/* Similar to pick_datestamp, but always select all available
+ * datestamps. Non-interactive, but outputs progress to stdout.
+ *
+ * @param verbose: verbose logging to stdout
+ * @returns: a new sl_t listing all matching datestamps
+ */
+sl_t *
+pick_all_datestamp(int verbose);