diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 15:32:58 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 15:32:58 -0400 |
| commit | 5cb84ec742fd33f78c8022863fadaa8d0d93e176 (patch) | |
| tree | 1a81ca3665e6153923e40db7b0d988f8573ab59c /static/netbsd/tools/pages.c | |
| parent | a59214f344567c037d5776879bcfc5fcc1d4d5f6 (diff) | |
feat: Added NetBSD man pages
Diffstat (limited to 'static/netbsd/tools/pages.c')
| -rw-r--r-- | static/netbsd/tools/pages.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/static/netbsd/tools/pages.c b/static/netbsd/tools/pages.c new file mode 100644 index 00000000..fe2304ec --- /dev/null +++ b/static/netbsd/tools/pages.c @@ -0,0 +1,36 @@ +/* $NetBSD: pages.c,v 1.2 1998/01/09 08:05:09 perry Exp $ */ + +#include <stdio.h> + +#define T_INIT 0100 +#define T_STOP 0111 + +long charin; /* number of input character */ + +main(argc, argv) +char **argv; +{ + + int npages = 0; + register int c; + + while((c=getchar()) != EOF) { + charin++; + c &= 0377; + if(c != T_INIT) + continue; + else { + c=getchar(); + c &= 0377; + if(c == T_STOP) { + npages++; + charin++; + } + } + } + if(charin<5) { + fprintf(stderr, "%s: no input\n", argv[0]); + exit(1); + } + printf("%d\n", npages); +} |
