/* Bitset statistics.
- Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
This program is free software; you can redistribute it and/or modify
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* This file is a wrapper bitset implementation for the other bitset
implementations. It provides bitset compatibility checking and
statistics gathering without having to instrument the bitset
implementations. When statistics gathering is enabled, the bitset
operations get vectored through here and we then call the appropriate
- routines.
-*/
+ routines. */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include <config.h>
+
+#include "bitset_stats.h"
#include "bbitset.h"
#include "abitset.h"
#include "ebitset.h"
#include "lbitset.h"
#include "vbitset.h"
-#include "bitset_stats.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
/* Read bitset statistics file. */
void
-bitset_stats_read (const char *filename)
+bitset_stats_read (const char *file_name)
{
FILE *file;
if (!bitset_stats_info)
return;
- if (!filename)
- filename = BITSET_STATS_FILE;
+ if (!file_name)
+ file_name = BITSET_STATS_FILE;
- file = fopen (filename, "r");
+ file = fopen (file_name, "r");
if (file)
{
if (fread (&bitset_stats_info_data, sizeof (bitset_stats_info_data),
/* Write bitset statistics file. */
void
-bitset_stats_write (const char *filename)
+bitset_stats_write (const char *file_name)
{
FILE *file;
if (!bitset_stats_info)
return;
- if (!filename)
- filename = BITSET_STATS_FILE;
+ if (!file_name)
+ file_name = BITSET_STATS_FILE;
- file = fopen (filename, "w");
+ file = fopen (file_name, "w");
if (file)
{
if (fwrite (&bitset_stats_info_data, sizeof (bitset_stats_info_data),
we are a wrapper over. */
switch (type)
{
+ default:
+ abort ();
+
case BITSET_ARRAY:
bytes = abitset_bytes (n_bits);
sbset = xcalloc (1, bytes);
sbset = xcalloc (1, bytes);
vbitset_init (sbset, n_bits);
break;
-
- default:
- abort ();
}
bset->s.bset = sbset;