* mu: add the 'mu stats' command (WIP) + some refactoring
This commit is contained in:
@ -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
|
||||
|
||||
29
lib/mu-str.c
29
lib/mu-str.c
@ -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);
|
||||
}
|
||||
|
||||
11
lib/mu-str.h
11
lib/mu-str.h
@ -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__*/
|
||||
|
||||
Reference in New Issue
Block a user