mirror of https://github.com/djcb/mu.git
* mu_maildir_mkmdir => mu_maildir_mkdir
This commit is contained in:
parent
badc37d3b5
commit
8321f6718a
|
@ -47,7 +47,7 @@ mu_cmd_mkdir (MuConfigOptions *opts)
|
||||||
|
|
||||||
i = 1;
|
i = 1;
|
||||||
while (opts->params[i]) {
|
while (opts->params[i]) {
|
||||||
if (!mu_maildir_mkmdir (opts->params[i], opts->dirmode,
|
if (!mu_maildir_mkdir (opts->params[i], opts->dirmode,
|
||||||
FALSE))
|
FALSE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
++i;
|
++i;
|
||||||
|
|
|
@ -106,11 +106,11 @@ create_noindex (const char *path)
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
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);
|
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");
|
path, mode, noindex ?"TRUE":"FALSE");
|
||||||
|
|
||||||
if (!create_maildir (path, mode))
|
if (!create_maildir (path, mode))
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <sys/types.h> /* for mode_t */
|
#include <sys/types.h> /* for mode_t */
|
||||||
#include "mu-result.h" /* for MuResult */
|
#include "mu-result.h" /* for MuResult */
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a new maildir. Note, if the function fails 'halfway', it
|
* create a new maildir. Note, if the function fails 'halfway', it
|
||||||
|
@ -39,7 +40,7 @@
|
||||||
*
|
*
|
||||||
* @return TRUE if creation succeeded, FALSE otherwise
|
* @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
|
* with 'enter' being TRUE upon entering, FALSE otherwise
|
||||||
*/
|
*/
|
||||||
typedef MuResult (*MuMaildirWalkDirCallback)
|
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
|
* 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);
|
gboolean mu_maildir_clear_links (const gchar* dir);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /*__MU_MAILDIR_H__*/
|
#endif /*__MU_MAILDIR_H__*/
|
||||||
|
|
|
@ -42,7 +42,7 @@ test_mu_maildir_mkmdir_01 (void)
|
||||||
mdir = g_strdup_printf ("%s%c%s", tmpdir, G_DIR_SEPARATOR,
|
mdir = g_strdup_printf ("%s%c%s", tmpdir, G_DIR_SEPARATOR,
|
||||||
"cuux");
|
"cuux");
|
||||||
|
|
||||||
g_assert_cmpuint (mu_maildir_mkmdir (mdir, 0755, FALSE),
|
g_assert_cmpuint (mu_maildir_mkdir (mdir, 0755, FALSE),
|
||||||
==, TRUE);
|
==, TRUE);
|
||||||
|
|
||||||
for (i = 0; i != G_N_ELEMENTS(subs); ++i) {
|
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,
|
mdir = g_strdup_printf ("%s%c%s", tmpdir, G_DIR_SEPARATOR,
|
||||||
"cuux");
|
"cuux");
|
||||||
|
|
||||||
g_assert_cmpuint (mu_maildir_mkmdir (mdir, 0755, TRUE),
|
g_assert_cmpuint (mu_maildir_mkdir (mdir, 0755, TRUE),
|
||||||
==, TRUE);
|
==, TRUE);
|
||||||
|
|
||||||
for (i = 0; i != G_N_ELEMENTS(subs); ++i) {
|
for (i = 0; i != G_N_ELEMENTS(subs); ++i) {
|
||||||
|
@ -113,7 +113,7 @@ test_mu_maildir_mkmdir_03 (void)
|
||||||
/* this must fail */
|
/* this must fail */
|
||||||
g_test_log_set_fatal_handler ((GTestLogFatalFunc)ignore_error, NULL);
|
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);
|
==, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue