The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
skip.h
Go to the documentation of this file.
1#pragma once
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16 */
17
18/** Preparse input by skipping known tokens
19 *
20 * @file src/lib/util/skip.h
21 *
22 * @copyright 2001,2006 The FreeRADIUS server project
23 */
24RCSIDH(skip_h, "$Id: 454b2be2e4dea94522833f61e4bb02d6790b1875 $")
25
26#include <sys/types.h>
27#include <stdbool.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33/** Skip whitespace ('\\t', '\\n', '\\v', '\\f', '\\r', ' ')
34 *
35 * @param[in,out] _p string to skip over.
36 */
37#define fr_skip_whitespace(_p) while(isspace((uint8_t)*(_p))) _p++
38
39/** Skip whitespace, stopping at end ('\\t', '\\n', '\\v', '\\f', '\\r', ' ')
40 *
41 * @param[in,out] _p string to skip over.
42 * @param[in] _e pointer to end of string.
43 */
44#define fr_bskip_whitespace(_p, _e) while((_p < _e) && isspace((uint8_t)*(_p))) _p++
45
46/** Skip everything that's not whitespace ('\\t', '\\n', '\\v', '\\f', '\\r', ' ')
47 *
48 * @param[in,out] _p string to skip over.
49 */
50#define fr_skip_not_whitespace(_p) while(*_p && !isspace((uint8_t)*(_p))) _p++
51
52ssize_t fr_skip_string(char const *start, char const *end) CC_HINT(nonnull(1));
53
54ssize_t fr_skip_xlat(char const *start, char const *end) CC_HINT(nonnull(1));
55
56ssize_t fr_skip_condition(char const *start, char const *end, bool const terminal[static UINT8_MAX + 1],
57 bool *eol) CC_HINT(nonnull(1,3));
58#ifdef __cplusplus
59}
60#endif
#define RCSIDH(h, id)
Definition build.h:486
long int ssize_t
#define UINT8_MAX
ssize_t fr_skip_condition(char const *start, char const *end, bool const terminal[static UINT8_MAX+1], bool *eol))
Skip a conditional expression.
Definition skip.c:264
ssize_t fr_skip_string(char const *start, char const *end))
Skip a quoted string.
Definition skip.c:37
ssize_t fr_skip_xlat(char const *start, char const *end))
Skip an xlat expression.
Definition skip.c:128
int nonnull(2, 5))