NeoMutt  2024-04-25-1-g3de005
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
render.c File Reference

Render Expandos using Data. More...

#include "config.h"
#include "render.h"
#include "node.h"
+ Include dependency graph for render.c:

Go to the source code of this file.

Functions

int node_tree_render (const struct ExpandoNode *node, const struct ExpandoRenderData *rdata, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags)
 Render a tree of ExpandoNodes into a string.
 

Detailed Description

Render Expandos using Data.

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 render.c.

Function Documentation

◆ node_tree_render()

int node_tree_render ( const struct ExpandoNode node,
const struct ExpandoRenderData rdata,
struct Buffer buf,
int  max_cols,
void *  data,
MuttFormatFlags  flags 
)

Render a tree of ExpandoNodes into a string.

Parameters
nodeRoot of tree
rdataExpando Render data
bufBuffer for the result
max_colsMaximum number of screen columns to use
dataPrivate data
flagsFlags to control behaviour
Return values
numNumber of screen columns used

Definition at line 45 of file render.c.

48{
49 int total_cols = 0;
50
51 for (; node && (total_cols < max_cols); node = node->next)
52 {
53 if (!node->render)
54 continue;
55
56 total_cols += node->render(node, rdata, buf, max_cols - total_cols, data, flags);
57 }
58
59 return total_cols;
60}
struct ExpandoNode * next
Linked list.
Definition: node.h:71
+ Here is the caller graph for this function: