NeoMutt  2024-10-02-37-gfa9146
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 86 of file node_container.c.

87{
88 struct ExpandoNode *node = node_new();
89
90 node->type = ENT_CONTAINER;
92
93 return node;
94}
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 140 of file node_container.c.

141{
142 if (!ptr || !*ptr)
143 return;
144
145 struct ExpandoNode *parent = *ptr;
146
147 struct ExpandoNode **np = NULL;
148 ARRAY_FOREACH(np, &parent->children)
149 {
151 }
152
154}
#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: