aboutsummaryrefslogtreecommitdiff
path: root/include/argot/lex.h
blob: f0699d2aa6e95ad17739d3cd34629a4d6cf86d7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* argot - Gray's Extensible Configuration System -*- c -*-
   Copyright (C) 2007-2016 Sergey Poznyakoff

   Grecs is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 3 of the License, or (at your
   option) any later version.

   Grecs 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 Grecs. If not, see <http://www.gnu.org/licenses/>. */

#ifndef _ARGOT_LEX_H
#define _ARGOT_LEX_H

int argot_lex_begin(const char*, int);  
void argot_lex_end(int err);

char *argot_install_text(const char *str);
void argot_destroy_text(void);
struct argot_symtab *argot_text_table(void);

void argot_parse_line_directive(char *text, argot_locus_t *ploc,
				struct argot_locus_point *ppoint, 
				size_t *pxlines);
void argot_parse_line_directive_cpp(char *text, argot_locus_t *ploc,
				    struct argot_locus_point *ppoint, 
				    size_t *pxlines);

void argot_line_acc_create(void);
void argot_line_acc_free(void);
void argot_line_acc_grow_char(int c);
int argot_line_acc_grow_char_unescape(int c);
void argot_line_acc_grow(const char *text, size_t len);
void argot_line_acc_grow_unescape_last(char *text, size_t len,
                                       argot_locus_t const *loc);

void argot_line_begin(void);
#define argot_line_add argot_line_acc_grow
char *argot_line_finish(void);

int argot_str_is_ipv4(const char *addr);
int argot_str_is_num(const char *s);
int argot_str_is_ipv6(const char *addr);
int argot_str_is_num(const char *s);
int argot_str_is_ipaddr(const char *addr);

#endif

Return to:

Send suggestions and report system problems to the System administrator.