From within a virtual kernel, make /sbin/shutdown and /sbin/halt actually
[dragonfly/vkernel-mp.git] / usr.bin / file2c / file2c.c
blob4802df6665ddb9934496cc568bd611f0316de23e
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 06: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;