NeoMutt  2024-11-14-34-g5aaf0d
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 95 of file node_container.c.

96{
97 struct ExpandoNode *node = node_new();
98
99 node->type = ENT_CONTAINER;
101
102 return node;
103}
int node_container_render(const struct ExpandoNode *node, const struct ExpandoRenderData *rdata, 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 ExpandoRenderData *rdata, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags)
Definition: node.h:91
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 149 of file node_container.c.

150{
151 if (!ptr || !*ptr)
152 return;
153
154 struct ExpandoNode *parent = *ptr;
155
156 struct ExpandoNode **np = NULL;
157 ARRAY_FOREACH(np, &parent->children)
158 {
160 }
161
163}
#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: