* mu_maildir_mkmdir => mu_maildir_mkdir

This commit is contained in:
Dirk-Jan C. Binnema 2010-12-05 15:40:40 +02:00
parent badc37d3b5
commit 8321f6718a
4 changed files with 12 additions and 9 deletions

View File

@ -47,7 +47,7 @@ mu_cmd_mkdir (MuConfigOptions *opts)
i = 1;
while (opts->params[i]) {
if (!mu_maildir_mkmdir (opts->params[i], opts->dirmode,
if (!mu_maildir_mkdir (opts->params[i], opts->dirmode,
FALSE))
return FALSE;
++i;

View File

@ -106,11 +106,11 @@ create_noindex (const char *path)
}
gboolean
mu_maildir_mkmdir (const char* path, mode_t mode, gboolean noindex)
mu_maildir_mkdir (const char* path, mode_t mode, gboolean noindex)
{
g_return_val_if_fail (path, FALSE);
MU_WRITE_LOG ("mu_maildir_mkdir (%s, %o, %s)",
MU_WRITE_LOG ("%s (%s, %o, %s)", __FUNCTION__,
path, mode, noindex ?"TRUE":"FALSE");
if (!create_maildir (path, mode))

View File

@ -25,6 +25,7 @@
#include <sys/types.h> /* for mode_t */
#include "mu-result.h" /* for MuResult */
G_BEGIN_DECLS
/**
* create a new maildir. Note, if the function fails 'halfway', it
@ -39,7 +40,7 @@
*
* @return TRUE if creation succeeded, FALSE otherwise
*/
gboolean mu_maildir_mkmdir (const char* path, mode_t mode, gboolean noindex);
gboolean mu_maildir_mkdir (const char* path, mode_t mode, gboolean noindex);
/**
@ -72,7 +73,7 @@ typedef MuResult (*MuMaildirWalkMsgCallback)
* with 'enter' being TRUE upon entering, FALSE otherwise
*/
typedef MuResult (*MuMaildirWalkDirCallback)
(const char* fullpath, gboolean enter, void *user_data);
(const char* fullpath, gboolean enter, void *user_data);
/**
* start a recursive walk of a maildir; for each file found, we call
@ -109,4 +110,6 @@ MuResult mu_maildir_walk (const char *path, MuMaildirWalkMsgCallback cb_msg,
*/
gboolean mu_maildir_clear_links (const gchar* dir);
G_END_DECLS
#endif /*__MU_MAILDIR_H__*/

View File

@ -42,7 +42,7 @@ test_mu_maildir_mkmdir_01 (void)
mdir = g_strdup_printf ("%s%c%s", tmpdir, G_DIR_SEPARATOR,
"cuux");
g_assert_cmpuint (mu_maildir_mkmdir (mdir, 0755, FALSE),
g_assert_cmpuint (mu_maildir_mkdir (mdir, 0755, FALSE),
==, TRUE);
for (i = 0; i != G_N_ELEMENTS(subs); ++i) {
@ -76,7 +76,7 @@ test_mu_maildir_mkmdir_02 (void)
mdir = g_strdup_printf ("%s%c%s", tmpdir, G_DIR_SEPARATOR,
"cuux");
g_assert_cmpuint (mu_maildir_mkmdir (mdir, 0755, TRUE),
g_assert_cmpuint (mu_maildir_mkdir (mdir, 0755, TRUE),
==, TRUE);
for (i = 0; i != G_N_ELEMENTS(subs); ++i) {
@ -113,7 +113,7 @@ test_mu_maildir_mkmdir_03 (void)
/* this must fail */
g_test_log_set_fatal_handler ((GTestLogFatalFunc)ignore_error, NULL);
g_assert_cmpuint (mu_maildir_mkmdir (NULL, 0755, TRUE),
g_assert_cmpuint (mu_maildir_mkdir (NULL, 0755, TRUE),
==, FALSE);
}