summaryrefslogtreecommitdiff
path: root/examples/loadables/truefalse.c
blob: e77c74ca06d94a3afd9e6faa450bd823c99e1013 (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
/* true and false builtins */

#include "bashtypes.h"
#include "shell.h"
#include "builtins.h"

true_builtin (list)
     WORD_LIST *list;
{
  return EXECUTION_SUCCESS;
}

false_builtin (list)
     WORD_LIST *list;
{
  return EXECUTION_FAILURE;
}

static char *true_doc[] = {
	"Return a successful result.",
	(char *)NULL
};

static char *false_doc[] = {
	"Return an unsuccessful result.",
	(char *)NULL
};

struct builtin true_struct = {
	"true",
	true_builtin,
	BUILTIN_ENABLED,
	true_doc,
	"true",
	0
};

struct builtin false_struct = {
	"false",
	false_builtin,
	BUILTIN_ENABLED,
	false_doc,
	"false",
	0
};