NeoMutt  2024-12-12-19-ge4b57e
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
node_container.h File Reference

Expando Node for a Container. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct ExpandoNodenode_container_new (void)
 Create a new Container ExpandoNode.
 
void node_container_collapse_all (struct ExpandoNode **ptr)
 Remove unnecessary Containers.
 

Detailed Description

Expando Node for a Container.

Authors
  • Tóth János
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file node_container.h.

Function Documentation

◆ node_container_new()

struct ExpandoNode * node_container_new ( void  )

Create a new Container ExpandoNode.

Return values
ptrNew Container ExpandoNode

Definition at line 94 of file node_container.c.

95{
96 struct ExpandoNode *node = node_new();
97
98 node->type = ENT_CONTAINER;
100
101 return node;
102}
int node_container_render(const struct ExpandoNode *node, const struct ExpandoRenderCallback *erc, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags)
Callback for a Container Node - Implements ExpandoNode::render() -.
struct ExpandoNode * node_new(void)
Create a new empty ExpandoNode.
Definition: node.c:39
@ ENT_CONTAINER
Container for other nodes.
Definition: node.h:44
Basic Expando Node.
Definition: node.h:67
int(* render)(const struct ExpandoNode *node, const struct ExpandoRenderCallback *erc, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags)
Definition: node.h:92
enum ExpandoNodeType type
Type of Node, e.g. ENT_EXPANDO.
Definition: node.h:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ node_container_collapse_all()

void node_container_collapse_all ( struct ExpandoNode **  ptr)

Remove unnecessary Containers.

Parameters
ptrPointer to the parent node

Definition at line 148 of file node_container.c.

149{
150 if (!ptr || !*ptr)
151 return;
152
153 struct ExpandoNode *parent = *ptr;
154
155 struct ExpandoNode **np = NULL;
156 ARRAY_FOREACH(np, &parent->children)
157 {
159 }
160
162}
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition: array.h:212
void node_container_collapse_all(struct ExpandoNode **ptr)
Remove unnecessary Containers.
void node_container_collapse(struct ExpandoNode **ptr)
Remove an unnecessary Container.
struct ExpandoNodeArray children
Children nodes.
Definition: node.h:75
+ Here is the call graph for this function:
+ Here is the caller graph for this function: