1 /* $NetBSD: mkhelp.c,v 1.3 2013/09/04 19:44:21 tron Exp $ */
4 * Copyright (C) 1984-2012 Mark Nudelman
6 * You may distribute under the terms of either the GNU General Public
7 * License or the Less License, as specified in the README file.
9 * For more information, see the README file.
14 * Silly little program to generate the help.c source file
15 * from the less.hlp text file.
16 * help.c just contains a char array whose contents are
17 * the contents of less.hlp.
30 printf("/* This file was generated by mkhelp from less.hlp */\n");
31 printf("#include \"less.h\"\n");
32 printf("constant char helpdata[] = {\n");
34 while (prevch
= ch
, (ch
= getchar()) != EOF
)
59 if (ch
>= ' ' && ch
< 0x7f)
62 printf("0x%02x,", ch
);
66 /* Add an extra null char to avoid having a trailing comma. */
68 printf("constant int size_helpdata = sizeof(helpdata) - 1;\n");