mirror of https://github.com/djcb/mu.git
* mu-util: remove unneeded argv->gslist conversion funcs
This commit is contained in:
parent
390b3db86f
commit
1cff4534b8
|
@ -52,37 +52,6 @@ mu_util_dir_expand (const char *path)
|
|||
|
||||
|
||||
|
||||
GSList *
|
||||
mu_util_strlist_from_args (int argc, char *argv[])
|
||||
{
|
||||
GSList *lst;
|
||||
int i;
|
||||
|
||||
g_return_val_if_fail (argc >= 0, NULL);
|
||||
if (argc == 0)
|
||||
return NULL;
|
||||
g_return_val_if_fail (argv, NULL);
|
||||
|
||||
/* we prepend args in opposite direction;
|
||||
* prepending is faster
|
||||
*/
|
||||
for (i = argc - 1, lst = NULL; i >= 0; --i) {
|
||||
if (!argv[i])
|
||||
continue;
|
||||
lst = g_slist_prepend (lst, g_strdup(argv[i]));
|
||||
}
|
||||
return lst;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
mu_util_strlist_free (GSList *lst)
|
||||
{
|
||||
g_slist_foreach (lst, (GFunc)g_free, NULL);
|
||||
g_slist_free (lst);
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
_is_readable_dir (const gchar* path)
|
||||
{
|
||||
|
|
|
@ -44,27 +44,6 @@ char* mu_util_dir_expand (const char* path);
|
|||
*/
|
||||
char* mu_util_guess_maildir (void);
|
||||
|
||||
/**
|
||||
* take a char*[] and turn it into a GSList
|
||||
*
|
||||
* @param argc numbers of strings
|
||||
* @param argv array of strings
|
||||
*
|
||||
* @return a newly allocated GSList of the arguments; or NULL in case
|
||||
* of error. use mu_exprs_helpers_strlist_free when done with the list
|
||||
*/
|
||||
GSList *mu_util_strlist_from_args (int argc, char *argv[]);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* free a list of strings, as produced by mu_expr_helpers_strlist_from_args or
|
||||
* mu_expr_helpers_strlist_from_str
|
||||
*
|
||||
* @param lst a list or NULL
|
||||
*/
|
||||
void mu_util_strlist_free (GSList *lst);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
Loading…
Reference in New Issue