* mu: add the 'mu stats' command (WIP) + some refactoring

This commit is contained in:
djcb
2012-10-19 00:51:04 +03:00
parent c1828ab2c8
commit 7915cafdee
9 changed files with 320 additions and 47 deletions

View File

@ -92,6 +92,7 @@ libmu_la_SOURCES= \
libmu_la_LIBADD= \
$(XAPIAN_LIBS) \
$(GMIME_LIBS) \
$(GLIB_LIBS)
$(GLIB_LIBS) \
$(GUILE_LIBS)
EXTRA_DIST=mu-msg-crypto.c

View File

@ -717,3 +717,32 @@ leave:
return nick;
}
gchar*
mu_str_quoted_from_strv (const gchar **params)
{
GString *str;
int i;
g_return_val_if_fail (params, NULL);
if (!params[0])
return g_strdup ("");
str = g_string_sized_new (64); /* just a guess */
for (i = 0; params[i]; ++i) {
if (i > 0)
g_string_append_c (str, ' ');
g_string_append_c (str, '"');
g_string_append (str, params[i]);
g_string_append_c (str, '"');
}
return g_string_free (str, FALSE);
}

View File

@ -359,6 +359,17 @@ gchar* mu_str_guess_first_name (const char* name)
gchar* mu_str_guess_last_name (const char* name)
G_GNUC_WARN_UNUSED_RESULT;
/**
* take a list of strings, and turn them in into their quoted
* concatenation
*
* @param params NULL-terminated array of strings
*
* @return the quoted concatenation of the strings
*/
gchar* mu_str_quoted_from_strv (const gchar **params);
G_END_DECLS
#endif /*__MU_STR_H__*/