summaryrefslogtreecommitdiff
path: root/addon.c
diff options
context:
space:
mode:
authortgoodwin <tgoodwin>1998-07-08 17:00:32 +0000
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:23:06 +0100
commit4163c691dfb2e1b681a2036c49c0663cae1d7f59 (patch)
treee6ae6da4b8d15cc256bb8b380ea442f35db29959 /addon.c
parent279e7fc70338626ed540163afa7e1450ae4ce866 (diff)
completely revamp to use my `+' example
Diffstat (limited to 'addon.c')
-rw-r--r--addon.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/addon.c b/addon.c
index df3fcd7..b6ddc61 100644
--- a/addon.c
+++ b/addon.c
@@ -1,22 +1,16 @@
/*
- This file contains the implementations of any locally defined
- builtins.
+ This file is NOT BUILT by default. Together with addon.h, it
+ provides an example of how to add new builtins to rc.
*/
-#ifdef DWS
-
-/*
- This is what DaviD Sanderson (dws@cs.wisc.edu) uses.
-*/
-
-#include <sys/types.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-
-#include "rc.h" /* for bool TRUE, FALSE */
+#include "rc.h"
#include "addon.h"
-#include "addon/access.c"
-#include "addon/test.c"
+void b_add(char **av) {
+ long sum = 0;
-#endif
+ while (*++av)
+ sum += atol(*av);
+ fprint(1, "%ld\n", sum);
+ set(TRUE);
+}