aboutsummaryrefslogtreecommitdiff
path: root/lib/nullmap.c
blob: 00ad8dd1f88925d0a41278498debdec0bb720327 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/* This file is part of Eclat.
   Copyright (C) 2012-2023 Sergey Poznyakoff.
 
   Eclat 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, or (at your option)
   any later version.
 
   Eclat 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 Eclat.  If not, see <http://www.gnu.org/licenses/>. */

#include "libeclat.h"
#include <errno.h>

static struct grecs_keyword nullmap_kw[] = {
	{ "type", "'null", "Set map type", grecs_type_null },
	{ "key", "<arg: string>", "key expression", grecs_type_null },
	{ NULL }
};

static void
nullmap_confhelp()
{
	static struct grecs_keyword nullmap_top[] = {
		{ "map", "name: string",
		  "Configuration for a null map",
		  grecs_type_section, GRECS_INAC, NULL, 0, NULL, NULL,
		  nullmap_kw },
		{ NULL }
	};
	grecs_print_statement_array(nullmap_top, 1, 0, stdout);
}

static void
nullmap_free(int dbg, void *data)
{
	struct nullmap *nullmap = data;
	free(nullmap);
}

static int
nullmap_config(int dbg, struct grecs_node *node, void *data)
{
	return eclat_map_ok;
}

static int
nullmap_open(int dbg, void *data)
{
	return eclat_map_ok;
}

	
static int
nullmap_close(int dbg, void *data)
{
	return eclat_map_ok;
}

static int
nullmap_get(int dbg, int dir, void *data, const char *key, char **return_value)
{
	*return_value = grecs_strdup(key);
	return eclat_map_ok;
}

struct eclat_map_drv eclat_map_drv_null = {
	"null",
	nullmap_config,
	nullmap_open,
	nullmap_close,
	nullmap_get,
	nullmap_free,
	nullmap_confhelp
};

Return to:

Send suggestions and report system problems to the System administrator.