NeoMutt  2024-04-25-92-gf10c0f
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
node_text.h File Reference

Expando Node for Text. More...

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

Go to the source code of this file.

Functions

struct ExpandoNodenode_text_new (const char *start, const char *end)
 Create a new Text ExpandoNode.
 
struct ExpandoNodenode_text_parse (const char *str, const char *end, const char **parsed_until)
 Extract a block of text.
 

Detailed Description

Expando Node for Text.

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_text.h.

Function Documentation

◆ node_text_new()

struct ExpandoNode * node_text_new ( const char *  start,
const char *  end 
)

Create a new Text ExpandoNode.

Parameters
startStart of text to store
endEnd of text to store
Return values
ptrNew Text ExpandoNode

Definition at line 57 of file node_text.c.

58{
59 struct ExpandoNode *node = node_new();
60
61 node->type = ENT_TEXT;
62 node->start = start;
63 node->end = end;
65
66 return node;
67}
static int node_text_render(const struct ExpandoNode *node, const struct ExpandoRenderData *rdata, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags)
Render a Text Node - Implements ExpandoNode::render() -.
Definition: node_text.c:41
struct ExpandoNode * node_new(void)
Create a new empty ExpandoNode.
Definition: node.c:39
@ ENT_TEXT
Plain text.
Definition: node.h:38
Basic Expando Node.
Definition: node.h:69
int(* render)(const struct ExpandoNode *node, const struct ExpandoRenderData *rdata, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags)
Definition: node.h:96
const char * end
End of string data.
Definition: node.h:80
enum ExpandoNodeType type
Type of Node, e.g. ENT_EXPANDO.
Definition: node.h:70
const char * start
Start of string data.
Definition: node.h:79
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ node_text_parse()

struct ExpandoNode * node_text_parse ( const char *  str,
const char *  end,
const char **  parsed_until 
)

Extract a block of text.

Parameters
strString to parse
endEnd of string
parsed_untilFirst character after parsed text
Return values
ptrNew Text ExpandoNode

Definition at line 103 of file node_text.c.

104{
105 const char *text_end = skip_until_ch_or_end(str, '%', end);
106 *parsed_until = text_end;
107 return node_text_new(str, text_end);
108}
struct ExpandoNode * node_text_new(const char *start, const char *end)
Create a new Text ExpandoNode.
Definition: node_text.c:57
static const char * skip_until_ch_or_end(const char *start, char terminator, const char *end)
Search for a terminator character.
Definition: node_text.c:76
+ Here is the call graph for this function:
+ Here is the caller graph for this function: