#include "user.h"
#include "select.cmdline.h"
+/** \cond */
/* global list */
#define GLOBAL_LIST_ATOMS \
ATOM(size, SIZE) \
enum user_summary_atoms {USER_SUMMARY_ATOMS};
#undef ATOM
+/** \endcond */
+
struct global_list_info {
uint32_t count;
int ret;
case user_summary_sort_arg_size:
comp = size_comp;
break;
+ default: /* this should never happen, but anyway */
+ comp = size_comp;
+ break;
}
sort_hash_table(comp);
ret = for_each_admissible_user(print_user_summary_line, &usli);
return 1;
}
+/**
+ * Execute a select query.
+ *
+ * \param admissible_uids User IDs to take into account.
+ * \param fi Format information.
+ *
+ * Called once in select mode or for each \a run command in interactive mode.
+ *
+ * Open the output stream and the dir table if not already open. For each
+ * admissible uid, the user table is opened if necessary. After these
+ * preparations, the output according to \a select_mode and \a fi is written to
+ * the output stream.
+ *
+ * \return Standard.
+ */
int run_select_query(struct uid_range *admissible_uids, struct format_info *fi)
{
int ret = open_output_stream();
return ret;
}
+/** Default format string for global_list mode. */
#define GLOBAL_LIST_DFLT_FMT "%(size:r:8) %(files:r:8) %(dirname)\n"
+/** Default format string for global_summary mode. */
#define GLOBAL_SUMMARY_DFLT_FMT "#directories: %(dirs), #files: %(files), size: %(size)\n\n"
+/** Default format string for user_list mode. */
#define USER_LIST_DFLT_FMT "%(size:r:5) %(files:r:5) %(dirname)\n"
+/** Default format string for user_summary mode. */
#define USER_SUMMARY_DFLT_FMT "%(pw_name:l:16) %(uid:r:5) %(dirs:r:5) %(files:r:5) %(size:r:5)\n"
static int setup_format_string(char *fmt, struct format_info **fi)
return 0;
}
+/**
+ * Main function for select mode.
+ *
+ * \return Standard.
+ */
int com_select(void)
{
struct uid_range *admissible_uids = NULL;