summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--examples/lsf.c2
-rw-r--r--include/mailutils/cpp/folder.h4
-rw-r--r--include/mailutils/folder.h9
-rw-r--r--libmailutils/mailbox/folder.c8
-rw-r--r--libmailutils/mailbox/fsfolder.c12
-rw-r--r--libmailutils/tests/fsfolder.c8
-rw-r--r--libmu_cpp/folder.cc8
-rw-r--r--libproto/imap/folder.c4
-rw-r--r--libproto/imap/genlist.c12
-rw-r--r--libproto/imap/tests/imapfolder.c2
-rw-r--r--libproto/nntp/folder.c2
-rw-r--r--mu/libexec/imap.c2
-rw-r--r--python/2/libmu_py/folder.c8
-rw-r--r--python/2/mailutils/folder.py4
-rw-r--r--python/3/libmu_py/folder.c10
-rw-r--r--python/3/mailutils/folder.py4
16 files changed, 50 insertions, 49 deletions
diff --git a/examples/lsf.c b/examples/lsf.c
index cba79d3..c386893 100644
--- a/examples/lsf.c
+++ b/examples/lsf.c
@@ -31,3 +31,3 @@ enumfun (mu_folder_t folder, struct mu_list_response *resp, void *data)
resp->separator,
- resp->level,
+ resp->depth,
resp->name);
diff --git a/include/mailutils/cpp/folder.h b/include/mailutils/cpp/folder.h
index fe4ed77..97c6d0f 100644
--- a/include/mailutils/cpp/folder.h
+++ b/include/mailutils/cpp/folder.h
@@ -45,5 +45,5 @@ class Folder
- List& list (const std::string& dirname, void* pattern, size_t max_level);
+ List& list (const std::string& dirname, void* pattern, size_t max_depth);
List& enumerate (const std::string& name, void* pattern,
- int flags, size_t max_level,
+ int flags, size_t max_depth,
mu_folder_enumerate_fp enumfun, void* enumdata);
diff --git a/include/mailutils/folder.h b/include/mailutils/folder.h
index 4ca4b92..ceb54dd 100644
--- a/include/mailutils/folder.h
+++ b/include/mailutils/folder.h
@@ -29,5 +29,5 @@ struct mu_list_response
int type; /* MU_FOLDER_ATTRIBUTE_.* flags */
- int level;
- int separator;
- char *name;
+ int depth; /* Item depth within the hierarchy */
+ int separator; /* Directory separator character */
+ char *name; /* Item name */
mu_record_t format; /* Associated mailbox format record */
@@ -68,3 +68,4 @@ struct mu_folder_scanner
int match_flags; /* Matching flags */
- size_t max_level; /* Max. nesting level to descend */
+ size_t max_depth; /* Max. depth to descend
+ (1-based, 0 means 'unlimited') */
mu_folder_enumerate_fp enumfun; /* Enumeration function */
diff --git a/libmailutils/mailbox/folder.c b/libmailutils/mailbox/folder.c
index 8a474c8..d22bb33 100644
--- a/libmailutils/mailbox/folder.c
+++ b/libmailutils/mailbox/folder.c
@@ -358,3 +358,3 @@ int
mu_folder_list (mu_folder_t folder, const char *dirname, void *pattern,
- size_t max_level,
+ size_t max_depth,
mu_list_t *pflist)
@@ -362,3 +362,3 @@ mu_folder_list (mu_folder_t folder, const char *dirname, void *pattern,
return mu_folder_enumerate (folder, dirname, pattern,
- MU_FOLDER_ATTRIBUTE_ALL, max_level,
+ MU_FOLDER_ATTRIBUTE_ALL, max_depth,
pflist, NULL, NULL);
@@ -369,3 +369,3 @@ mu_folder_enumerate (mu_folder_t folder, const char *name,
void *pattern, int flags,
- size_t max_level,
+ size_t max_depth,
mu_list_t *pflist,
@@ -385,3 +385,3 @@ mu_folder_enumerate (mu_folder_t folder, const char *name,
scn.match_flags = flags;
- scn.max_level = max_level;
+ scn.max_depth = max_depth;
scn.enumfun = enumfun;
diff --git a/libmailutils/mailbox/fsfolder.c b/libmailutils/mailbox/fsfolder.c
index 553c9fd..4afdbd6 100644
--- a/libmailutils/mailbox/fsfolder.c
+++ b/libmailutils/mailbox/fsfolder.c
@@ -296,3 +296,3 @@ list_helper (struct mu_folder_scanner *scn,
struct inode_list *ilist,
- const char *dirname, size_t level)
+ const char *dirname, size_t depth)
{
@@ -302,3 +302,3 @@ list_helper (struct mu_folder_scanner *scn,
- if (scn->max_level && level >= scn->max_level)
+ if (scn->max_depth && depth >= scn->max_depth)
return 0;
@@ -379,3 +379,3 @@ list_helper (struct mu_folder_scanner *scn,
resp->name = fname;
- resp->level = level;
+ resp->depth = depth;
resp->separator = '/';
@@ -423,3 +423,3 @@ list_helper (struct mu_folder_scanner *scn,
stop = list_helper (scn, data, &idata, refname,
- level + 1);
+ depth + 1);
}
@@ -433,3 +433,3 @@ list_helper (struct mu_folder_scanner *scn,
idata.next = ilist;
- stop = list_helper (scn, data, &idata, fname, level + 1);
+ stop = list_helper (scn, data, &idata, fname, depth + 1);
}
@@ -510,3 +510,3 @@ _fsfolder_lsub (mu_folder_t folder, const char *ref, const char *name,
resp->type = MU_FOLDER_ATTRIBUTE_FILE;
- resp->level = 0;
+ resp->depth = 0;
resp->separator = '/';
diff --git a/libmailutils/tests/fsfolder.c b/libmailutils/tests/fsfolder.c
index 5a4d9df..e6c45b7 100644
--- a/libmailutils/tests/fsfolder.c
+++ b/libmailutils/tests/fsfolder.c
@@ -46,5 +46,5 @@ compare_response (void const *a, void const *b)
- if (ra->level < rb->level)
+ if (ra->depth < rb->depth)
return -1;
- if (ra->level > rb->level)
+ if (ra->depth > rb->depth)
return 1;
@@ -62,3 +62,3 @@ _print_list_entry (void *item, void *data)
resp->separator ? resp->separator : ' ',
- resp->level,
+ resp->depth,
resp->name + len);
@@ -175,3 +175,3 @@ com_scan (int argc, char **argv, mu_assoc_t options, void *env)
errno = 0;
- scn.max_level = strtoul (s, &p, 10);
+ scn.max_depth = strtoul (s, &p, 10);
if (errno || *p)
diff --git a/libmu_cpp/folder.cc b/libmu_cpp/folder.cc
index ebc7401..cf6857f 100644
--- a/libmu_cpp/folder.cc
+++ b/libmu_cpp/folder.cc
@@ -84,3 +84,3 @@ List&
Folder :: list (const std::string& dirname, void* pattern,
- size_t max_level = 0)
+ size_t max_depth = 0)
{
@@ -89,3 +89,3 @@ Folder :: list (const std::string& dirname, void* pattern,
int status = mu_folder_list (folder, dirname.c_str (), pattern,
- max_level, &c_list);
+ max_depth, &c_list);
if (status)
@@ -98,3 +98,3 @@ List&
Folder :: enumerate (const std::string& name, void* pattern,
- int flags, size_t max_level,
+ int flags, size_t max_depth,
mu_folder_enumerate_fp enumfun, void* enumdata)
@@ -104,3 +104,3 @@ Folder :: enumerate (const std::string& name, void* pattern,
int status = mu_folder_enumerate (folder, name.c_str (), pattern,
- flags, max_level, &c_list,
+ flags, max_depth, &c_list,
enumfun, enumdata);
diff --git a/libproto/imap/folder.c b/libproto/imap/folder.c
index 5e43312..9e23847 100644
--- a/libproto/imap/folder.c
+++ b/libproto/imap/folder.c
@@ -274,3 +274,3 @@ _mu_imap_folder_list (mu_folder_t folder, struct mu_folder_scanner *scn)
- if (scn->max_level
+ if (scn->max_depth
|| (scn->match_flags & MU_FOLDER_ATTRIBUTE_ALL) != MU_FOLDER_ATTRIBUTE_ALL)
@@ -294,3 +294,3 @@ _mu_imap_folder_list (mu_folder_t folder, struct mu_folder_scanner *scn)
if (!(rp->type & scn->match_flags)
- || (scn->max_level && rp->level > scn->max_level))
+ || (scn->max_depth && rp->depth > scn->max_depth))
mu_iterator_ctl (itr, mu_itrctl_delete, NULL);
diff --git a/libproto/imap/genlist.c b/libproto/imap/genlist.c
index 1e2de88..13352b6 100644
--- a/libproto/imap/genlist.c
+++ b/libproto/imap/genlist.c
@@ -39,5 +39,5 @@ struct list_closure
static int
-count_level (const char *name, int delim)
+count_depth (const char *name, int delim)
{
- int level = 0;
+ int depth = 0;
@@ -45,4 +45,4 @@ count_level (const char *name, int delim)
if (*name++ == delim)
- level++;
- return level;
+ depth++;
+ return depth;
}
@@ -111,3 +111,3 @@ list_untagged_handler (mu_imap_t imap, mu_list_t resp, void *data)
rp->separator = 0;
- rp->level = 0;
+ rp->depth = 0;
}
@@ -118,3 +118,3 @@ list_untagged_handler (mu_imap_t imap, mu_list_t resp, void *data)
rp->separator = elt->v.string[0];
- rp->level = count_level (rp->name, rp->separator);
+ rp->depth = count_depth (rp->name, rp->separator);
}
diff --git a/libproto/imap/tests/imapfolder.c b/libproto/imap/tests/imapfolder.c
index 8d3f6ce..2de8506 100644
--- a/libproto/imap/tests/imapfolder.c
+++ b/libproto/imap/tests/imapfolder.c
@@ -39,3 +39,3 @@ _print_list_entry (void *item, void *data)
resp->separator ? resp->separator : ' ',
- resp->level,
+ resp->depth,
resp->name);
diff --git a/libproto/nntp/folder.c b/libproto/nntp/folder.c
index bdc16f5..8919a03 100644
--- a/libproto/nntp/folder.c
+++ b/libproto/nntp/folder.c
@@ -191,3 +191,3 @@ static int
nntp_folder_list (mu_folder_t folder, const char *ref, void *pat, int flags,
- size_t max_level, mu_list_t flist,
+ size_t max_depth, mu_list_t flist,
mu_folder_enumerate_fp efp, void *edp)
diff --git a/mu/libexec/imap.c b/mu/libexec/imap.c
index 3496e5b..8136f4b 100644
--- a/mu/libexec/imap.c
+++ b/mu/libexec/imap.c
@@ -1126,3 +1126,3 @@ print_list_item (void *item, void *data)
resp->separator : MU_HIERARCHY_DELIMITER,
- resp->level,
+ resp->depth,
resp->name);
diff --git a/python/2/libmu_py/folder.c b/python/2/libmu_py/folder.c
index cf1ae69..20b731f 100644
--- a/python/2/libmu_py/folder.c
+++ b/python/2/libmu_py/folder.c
@@ -205,3 +205,3 @@ api_folder_list (PyObject *self, PyObject *args)
int status = 0;
- Py_ssize_t max_level = 0;
+ Py_ssize_t max_depth = 0;
char *dirname, *pattern;
@@ -212,5 +212,5 @@ api_folder_list (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "O!zs|n", &PyFolderType, &py_folder,
- &dirname, &pattern, &max_level))
+ &dirname, &pattern, &max_depth))
return NULL;
- if (max_level < 0)
+ if (max_depth < 0)
{
@@ -219,3 +219,3 @@ api_folder_list (PyObject *self, PyObject *args)
}
- status = mu_folder_list (py_folder->folder, dirname, pattern, max_level,
+ status = mu_folder_list (py_folder->folder, dirname, pattern, max_depth,
&c_list);
diff --git a/python/2/mailutils/folder.py b/python/2/mailutils/folder.py
index ecd3fc9..8e33d65 100644
--- a/python/2/mailutils/folder.py
+++ b/python/2/mailutils/folder.py
@@ -68,4 +68,4 @@ class Folder:
- def list (self, dirname, pattern, max_level=0):
- status, lst = folder.list (self.folder, dirname, pattern, max_level)
+ def list (self, dirname, pattern, max_depth=0):
+ status, lst = folder.list (self.folder, dirname, pattern, max_depth)
if status:
diff --git a/python/3/libmu_py/folder.c b/python/3/libmu_py/folder.c
index 8b3dc93..b24bd0b 100644
--- a/python/3/libmu_py/folder.c
+++ b/python/3/libmu_py/folder.c
@@ -164,3 +164,3 @@ folderdata_extractor (void *data, PyObject **dst)
PyTuple_SetItem (*dst, 0, PyUnicode_FromString (attr));
- PyTuple_SetItem (*dst, 1, PyLong_FromLong (resp->level));
+ PyTuple_SetItem (*dst, 1, PyLong_FromLong (resp->depth));
PyTuple_SetItem (*dst, 2, PyUnicode_FromString (separator));
@@ -174,3 +174,3 @@ api_folder_list (PyObject *self, PyObject *args)
int status = 0;
- Py_ssize_t max_level = 0;
+ Py_ssize_t max_depth = 0;
char *dirname, *pattern;
@@ -181,5 +181,5 @@ api_folder_list (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "O!zs|n", &PyFolderType, &py_folder,
- &dirname, &pattern, &max_level))
+ &dirname, &pattern, &max_depth))
return NULL;
- if (max_level < 0)
+ if (max_depth < 0)
{
@@ -188,3 +188,3 @@ api_folder_list (PyObject *self, PyObject *args)
}
- status = mu_folder_list (py_folder->folder, dirname, pattern, max_level,
+ status = mu_folder_list (py_folder->folder, dirname, pattern, max_depth,
&c_list);
diff --git a/python/3/mailutils/folder.py b/python/3/mailutils/folder.py
index ecd3fc9..8e33d65 100644
--- a/python/3/mailutils/folder.py
+++ b/python/3/mailutils/folder.py
@@ -68,4 +68,4 @@ class Folder:
- def list (self, dirname, pattern, max_level=0):
- status, lst = folder.list (self.folder, dirname, pattern, max_level)
+ def list (self, dirname, pattern, max_depth=0):
+ status, lst = folder.list (self.folder, dirname, pattern, max_depth)
if status:

Return to:

Send suggestions and report system problems to the System administrator.