CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
lineparse.h
Go to the documentation of this file.
1
61
62#include <cx/closure/closure.h>
64
65CX_C_BEGIN
66
67typedef struct LineParser LineParser;
68
74
98
100
107void lparseDestroy(_Inout_ LineParser** lp);
108
114
115// Internal function - use lparseCreatePull() macro instead
116_Ret_valid_ LineParser* _lparseCreatePull(_Inout_ StreamBuffer* sb, flags_t flags);
117
143#define lparseCreatePull(sb, ...) _lparseCreatePull(sb, opt_flags(__VA_ARGS__))
144
153_Success_(return) _Check_return_ bool lparseLine(_Inout_ LineParser* lp, _Inout_ string* out);
154
156
162
171typedef bool (*lparseLineCB)(stvlist* cvars, _In_opt_ strref line);
172
173// Internal function - use lparseCreatePush() macro instead
174_Ret_opt_valid_ LineParser* _lparseCreatePush(_Inout_ StreamBuffer* sb, _In_ closure pline,
175 flags_t flags);
176
210#define lparseCreatePush(sb, pline, ...) _lparseCreatePush(sb, pline, opt_flags(__VA_ARGS__))
211
214
215CX_C_END
Basic closure functionality.
LINEPARSER_FLAGS_ENUM
Line parser configuration flags.
Definition lineparse.h:76
@ LPARSE_NoIncomplete
Definition lineparse.h:96
@ LPARSE_LF
Expect LF (Unix-style) line endings.
Definition lineparse.h:82
@ LPARSE_CRLF
Expect CR+LF (Windows-style) line endings.
Definition lineparse.h:80
@ LPARSE_IncludeEOL
Include the EOL markers in the returned line (by default they are stripped)
Definition lineparse.h:91
@ LPARSE_Auto
Auto-detect line ending style from first line found.
Definition lineparse.h:78
@ LPARSE_Mixed
Accept mixed CR+LF and LF line endings.
Definition lineparse.h:84
@ LPARSE_EOL_COUNT
Number of EOL modes (internal use)
Definition lineparse.h:88
@ LPARSE_EOL_MASK
Mask for extracting EOL mode.
Definition lineparse.h:86
bool lparseLine(LineParser *lp, string *out)
bool(* lparseLineCB)(stvlist *cvars, strref line)
Definition lineparse.h:171
void lparseDestroy(LineParser **lp)
Core stream buffer implementation for efficient data streaming.