]>
git.saurik.com Git - bison.git/blob - lib/bitsetv-print.c
2 Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software Foundation,
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
23 #include "bitsetv-print.h"
25 /*--------------------------------------------------------.
26 | Display the MATRIX array of SIZE bitsets of size SIZE. |
27 `--------------------------------------------------------*/
30 bitsetv_matrix_dump (FILE * out
, const char *title
, bitsetv bset
)
33 bitset_bindex hsize
= bitset_size (bset
[0]);
36 fprintf (out
, "%s BEGIN\n", title
);
40 for (i
= 0; i
< hsize
; ++i
)
41 putc (i
/ 10 ? '0' + i
/ 10 : ' ', out
);
44 for (i
= 0; i
< hsize
; ++i
)
45 fprintf (out
, "%d", (int) (i
% 10));
50 for (i
= 0; i
< hsize
; ++i
)
55 for (i
= 0; bset
[i
]; ++i
)
57 fprintf (out
, "%2lu|", (unsigned long int) i
);
58 for (j
= 0; j
< hsize
; ++j
)
59 fputs (bitset_test (bset
[i
], j
) ? "1" : " ", out
);
65 for (i
= 0; i
< hsize
; ++i
)
70 fprintf (out
, "%s END\n\n", title
);