summaryrefslogtreecommitdiffstats
path: root/gnu/usr.sbin/isdn/nsplit
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.sbin/isdn/nsplit')
-rw-r--r--gnu/usr.sbin/isdn/nsplit/Makefile5
-rw-r--r--gnu/usr.sbin/isdn/nsplit/nsplit.c102
2 files changed, 0 insertions, 107 deletions
diff --git a/gnu/usr.sbin/isdn/nsplit/Makefile b/gnu/usr.sbin/isdn/nsplit/Makefile
deleted file mode 100644
index d79b840..0000000
--- a/gnu/usr.sbin/isdn/nsplit/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-PROG= nsplit
-CFLAGS+= -DBSD -O
-NOMAN= yes
-
-.include <bsd.prog.mk>
diff --git a/gnu/usr.sbin/isdn/nsplit/nsplit.c b/gnu/usr.sbin/isdn/nsplit/nsplit.c
deleted file mode 100644
index 2502a58..0000000
--- a/gnu/usr.sbin/isdn/nsplit/nsplit.c
+++ /dev/null
@@ -1,102 +0,0 @@
-static char rcsid[] = "@(#)$Id: nsplit.c,v 1.1 1995/01/25 14:06:18 jkr Exp jkr $";
-/*******************************************************************************
- * II - Version 0.1 $Revision: 1.1 $ $State: Exp $
- *
- * Copyright 1994 Dietmar Friede
- *******************************************************************************
- * Bug reports, patches, comments, suggestions should be sent to:
- *
- * jkr@saarlink.de or jkrause@guug.de
- *
- *******************************************************************************
- * $Log: nsplit.c,v $
- *
- ******************************************************************************/
-
-#include <sys/types.h>
-#undef BSD
-#include <sys/param.h>
-#include <machine/endian.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/file.h>
-#include <time.h>
-#include "../../../../sys/gnu/i386/isa/niccyreg.h"
-
-struct head head;
-
-void
-main(int argc, char **argv)
-{
- FILE *f;
- int n;
- argv++;
-
- if (!*argv)
- {
- process(stdin);
- } else
- while (*argv)
- {
- if ((f = fopen(*argv, "r")) == NULL)
- {
- perror(*argv);
- exit(1);
- } else
- {
- process(f);
- fclose(f);
- }
- argv++;
- }
- exit(0);
-}
-
-process(FILE * f)
-{
- long off = 0;
- long size, rest;
- int len;
- char buf[1024];
- int ex;
- int no = 0;
- char nbuf[16];
- FILE *fout;
-
- while ((len = fread(buf, 1, 1024, f)) >= 0x16)
- {
- head = *(struct head *) buf;
- size = rest = ntohl(head.len);
- ex = len == rest;
-
- sprintf(nbuf, "o%.2d", no);
- if ((fout = fopen(nbuf, "w")) == NULL)
- {
- perror(nbuf);
- exit(1);
- } else
- printf("%d\t %x %.8s %.5s %x\n",
- rest, head.sig, head.nam, head.ver, head.typ);
-
- do
- {
- fwrite(buf, 1, MIN(len, rest), fout);
- rest -= MIN(len, rest);
-
- if (rest > 0)
- len = fread(buf, 1, MIN(rest, 1024), f);
- }
- while (rest > 0);
-
- if (ex)
- break;
- no++;
-
- off += size;
- if ((size < 1024) && (size > 0x16))
- fseek(f, off, SEEK_SET);
- }
- printf("done\n");
-
-}
OpenPOWER on IntegriCloud