mailbox-tree.c revision 2ac5f36aa7c2e7a07ba8815d43a6d7483f62e74c
/* Copyright (c) 2003-2016 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "str.h"
#include "mailbox-tree.h"
struct mailbox_tree_context {
char separator;
bool parents_nonexistent;
bool sorted;
unsigned int node_size;
struct mailbox_node *nodes;
};
struct mailbox_tree_iterate_context {
unsigned int flags_mask;
char separator;
bool first_child:1;
};
{
}
struct mailbox_tree_context *
{
struct mailbox_tree_context *tree;
return tree;
}
{
}
char separator)
{
}
{
}
{
}
{
}
{
const char *name;
continue;
str_truncate(str, 0);
/* find the node */
break;
}
/* not found, create it */
if (!create)
break;
if (tree->parents_nonexistent)
}
if (*path == '\0')
break;
}
return *node;
}
struct mailbox_node *
bool *created_r)
{
struct mailbox_node *node;
bool created;
T_BEGIN {
} T_END;
return node;
}
struct mailbox_node *
{
struct mailbox_node *node;
bool created;
T_BEGIN {
} T_END;
return node;
}
struct mailbox_tree_iterate_context *
{
struct mailbox_tree_iterate_context *ctx;
return ctx;
}
static void
{
struct mailbox_node *const *nodes;
unsigned int i, count;
} else {
for (i = count; i != 0; i--) {
i--;
if (ctx->parent_pos != 0)
ctx->parent_pos--;
break;
}
}
}
}
struct mailbox_node *
const char **path_r)
{
struct mailbox_node *node;
do {
return NULL;
if (ctx->first_child) {
ctx->parent_pos++;
}
}
return node;
}
{
}
struct mailbox_node *dest_parent,
const struct mailbox_node *src)
{
}
return dest_nodes;
}
{
struct mailbox_tree_context *dest;
/* for now we don't need to support extra data */
return dest;
}
struct mailbox_node *const *node2)
{
}
{
return;
/* first put the nodes into an array and sort it */
/* update the node pointers */
}
/* sort the children */
}
{
return;
T_BEGIN {
} T_END;
}