diff options
| author | tgoodwin <tgoodwin> | 1998-07-08 17:00:32 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:23:06 +0100 |
| commit | 4163c691dfb2e1b681a2036c49c0663cae1d7f59 (patch) | |
| tree | e6ae6da4b8d15cc256bb8b380ea442f35db29959 /addon.c | |
| parent | 279e7fc70338626ed540163afa7e1450ae4ce866 (diff) | |
completely revamp to use my `+' example
Diffstat (limited to 'addon.c')
| -rw-r--r-- | addon.c | 26 |
1 files changed, 10 insertions, 16 deletions
@@ -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); +} |