1# $Header: /home/yav/xpx/RCS/xbmbits.awk,v 1.1 1996/03/26 12:25:58 yav Exp $
2# pick up bitmap image section from X11 bitmap files
3# written by yav (UHD98984@pcvan.or.jp)
4#
5# input:
6# |#define temp_width 48
7# |#define temp_height 48
8# |#define temp_x_hot 20
9# |#define temp_y_hot 27
10# |static char temp_bits[] = {
11# |   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70,
12# |	:
13# |   0x00, 0xff, 0xff, 0xff, 0xff, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30};
14# output:
15# |BITS temp_bits[] = {
16# |   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70,
17# |	:
18# |   0x00, 0xff, 0xff, 0xff, 0xff, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30};
19#
20
21/^static.* char / {
22  if ($2 == "unsigned")
23    name = $4;
24  else
25    name = $3;
26  printf("BITS %s = {\n", name);
27}
28
29/^[ 	\-0-9]/ {
30  printf("%s\n", $0);
31}
32