Expando Node for Text. More...
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | NTE_NO_FLAGS 0 |
No flags are set. | |
#define | NTE_AMPERSAND (1 << 0) |
'&' Ampersand | |
#define | NTE_GREATER (1 << 1) |
'>' Greater than | |
#define | NTE_QUESTION (1 << 2) |
'?' Question mark | |
Typedefs | |
typedef uint8_t | NodeTextTermFlags |
Special characters that end a text string. | |
Functions | |
struct ExpandoNode * | node_text_new (const char *text) |
Create a new Text ExpandoNode. | |
struct ExpandoNode * | node_text_parse (const char *str, NodeTextTermFlags term_chars, const char **parsed_until) |
Extract a block of text. | |
Expando Node for Text.
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.
#define NTE_NO_FLAGS 0 |
No flags are set.
Definition at line 33 of file node_text.h.
#define NTE_AMPERSAND (1 << 0) |
'&' Ampersand
Definition at line 34 of file node_text.h.
#define NTE_GREATER (1 << 1) |
'>' Greater than
Definition at line 35 of file node_text.h.
#define NTE_QUESTION (1 << 2) |
'?' Question mark
Definition at line 36 of file node_text.h.
typedef uint8_t NodeTextTermFlags |
Special characters that end a text string.
Flags, e.g. NTE_NO_FLAGS
Definition at line 32 of file node_text.h.
struct ExpandoNode * node_text_new | ( | const char * | text | ) |
Create a new Text ExpandoNode.
text | Text to store |
ptr | New Text ExpandoNode |
Definition at line 59 of file node_text.c.
struct ExpandoNode * node_text_parse | ( | const char * | str, |
NodeTextTermFlags | term_chars, | ||
const char ** | parsed_until | ||
) |
Extract a block of text.
[in] | str | String to parse |
[in] | term_chars | Terminator characters, e.g. NTE_GREATER |
[out] | parsed_until | First character after parsed text |
ptr | New Text ExpandoNode |
Parse as much text as possible until the end of the line, or a terminator character is matched.
May return NULL if a terminator character is found immediately.
\
before a character makes it literal %%
is interpreted as a literal %
character Definition at line 86 of file node_text.c.