aboutsummaryrefslogtreecommitdiff
path: root/include/argot/node.h
blob: fcf542ec0ef1db938d77458b5e86dde10852186f (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
53
54
55
56
57
58
59
60
61
62
/* 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_NODE_H
#define _ARGOT_NODE_H

#include <argot/locus.h>
#include <argot/symtab.h>
#include <argot/value.h>

enum argot_node_type {
	argot_node_root,
	argot_node_stmt,
	argot_node_block
};

typedef struct argot_node {
	enum argot_node_type type;
	argot_locus_t locus;
	struct argot_node *up;
	struct argot_node *down;
	struct argot_node *next;
	struct argot_node *prev;
	char *ident;
	argot_locus_t idloc;
	union {
		argot_value_t *value;
		argot_symtab_ptr_t texttab;
	} v;
} argot_node_t;

void argot_node_free(struct argot_node *node);
struct argot_node *argot_node_create(enum argot_node_type type,
				     argot_locus_t *loc);
struct argot_node *argot_node_create_points(enum argot_node_type type,
					    struct argot_locus_point beg,
					    struct argot_locus_point end);
void argot_node_bind(struct argot_node *master, struct argot_node *node,
		     int dn);
int argot_node_eq(struct argot_node *a, struct argot_node *b);
int argot_node_unlink(struct argot_node *node);

struct argot_node *argot_node_from_path(const char *path, const char *value);
struct argot_node *argot_node_from_path_locus(const char *path,
					      const char *value,
					      argot_locus_t *locus,
					      argot_locus_t *vallocus);

#endif

Return to:

Send suggestions and report system problems to the System administrator.