From 4163c691dfb2e1b681a2036c49c0663cae1d7f59 Mon Sep 17 00:00:00 2001 From: tgoodwin Date: Wed, 8 Jul 1998 17:00:32 +0000 Subject: completely revamp to use my `+' example --- addon.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'addon.c') 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 -#include -#include - -#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); +} -- cgit v1.2.3