Don't depend on DragonFly keyword for shutdown scripts as well.
[dragonfly/netmp.git] / usr.bin / file2c / file2c.c
blob9ad70785d0e974ae6451c28a3cdc062de8261c9c
1 /*
2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@login.dknet.dk> wrote this file. As long as you retain this notice you
5 * can do whatever you want with this stuff. If we meet some day, and you think
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 * ----------------------------------------------------------------------------
9 * $FreeBSD: src/usr.bin/file2c/file2c.c,v 1.5 1999/08/28 01:01:10 peter Exp $
10 * $DragonFly: src/usr.bin/file2c/file2c.c,v 1.2 2003/06/17 04:29:26 dillon Exp $
14 #include <stdio.h>
16 int
17 main(int argc, char **argv)
19 int i,j,k;
21 if (argc > 1)
22 printf("%s\n",argv[1]);
23 k = 0;
24 j = 0;
25 while((i = getchar()) != EOF) {
26 if(k++) {
27 putchar(',');
28 j++;
30 if (j > 70) {
31 putchar('\n');
32 j = 0;
34 printf("%d",i);
35 if (i > 99)
36 j += 3;
37 else if (i > 9)
38 j += 2;
39 else
40 j++;
42 putchar('\n');
43 if (argc > 2)
44 printf("%s\n",argv[2]);
45 return 0;