-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddon.h
31 lines (21 loc) · 816 Bytes
/
addon.h
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
/*
This file is NOT BUILT by default. Together with addon.c, it
provides an example of how to add new builtins to rc.
To define a new builtin, it must appear in the macro ADDONS, which
is a comma-separated list of pairs of function pointers (the
implementation of the new builtin) and string literals (the name of
the new builtin).
Any new builtin functions must also have proper prototypes in this
file. This is always of the same form.
void b_NAME(char **av);
The first argument, av[0], is the name of the builtin. The last
argument is followed by a NULL pointer.
Builtins report their exit status using set(TRUE) or set(FALSE).
*/
#if RC_ADDON
#define ADDONS \
{ b_sum, "+" }, \
{ b_prod, "x" },
extern void b_sum(char **av);
extern void b_prod(char **av);
#endif