~bkerensa/ubuntu/raring/valgrind/merge-from-deb

« back to all changes in this revision

Viewing changes to helgrind/hg_wordset.h

  • Committer: Bazaar Package Importer
  • Author(s): Andrés Roldán
  • Date: 2008-06-13 02:31:40 UTC
  • mto: (1.4.1 upstream) (2.2.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: james.westby@ubuntu.com-20080613023140-iwk33rz9rhvfkr96
Import upstream version 3.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*--------------------------------------------------------------------*/
 
3
/*--- Sets of words, with unique set identifiers.                  ---*/
 
4
/*---                                                 hg_wordset.h ---*/
 
5
/*--------------------------------------------------------------------*/
 
6
 
 
7
/*
 
8
   This file is part of Helgrind, a Valgrind tool for detecting errors
 
9
   in threaded programs.
 
10
 
 
11
   Copyright (C) 2007-2007 OpenWorks LLP
 
12
       info@open-works.co.uk
 
13
 
 
14
   This program is free software; you can redistribute it and/or
 
15
   modify it under the terms of the GNU General Public License as
 
16
   published by the Free Software Foundation; either version 2 of the
 
17
   License, or (at your option) any later version.
 
18
 
 
19
   This program is distributed in the hope that it will be useful, but
 
20
   WITHOUT ANY WARRANTY; without even the implied warranty of
 
21
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
22
   General Public License for more details.
 
23
 
 
24
   You should have received a copy of the GNU General Public License
 
25
   along with this program; if not, write to the Free Software
 
26
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
27
   02111-1307, USA.
 
28
 
 
29
   The GNU General Public License is contained in the file COPYING.
 
30
 
 
31
   Neither the names of the U.S. Department of Energy nor the
 
32
   University of California nor the names of its contributors may be
 
33
   used to endorse or promote products derived from this software
 
34
   without prior written permission.
 
35
*/
 
36
 
 
37
#ifndef __HG_WORDSET_H
 
38
#define __HG_WORDSET_H
 
39
 
 
40
//------------------------------------------------------------------//
 
41
//---                          WordSet                           ---//
 
42
//---                      Public Interface                      ---//
 
43
//------------------------------------------------------------------//
 
44
 
 
45
typedef  struct _WordSetU  WordSetU;  /* opaque */
 
46
 
 
47
typedef  UInt              WordSet;   /* opaque, small int index */
 
48
 
 
49
/* Allocate and initialise a WordSetU */
 
50
WordSetU* HG_(newWordSetU) ( void* (*alloc_nofail)( SizeT ),
 
51
                             void  (*dealloc)(void*),
 
52
                             Word  cacheSize );
 
53
 
 
54
/* Free up the WordSetU. */
 
55
void HG_(deleteWordSetU) ( WordSetU* );
 
56
 
 
57
/* Get the number of elements in this WordSetU. */
 
58
Int HG_(cardinalityWSU) ( WordSetU* );
 
59
 
 
60
/* Show performance stats for this WordSetU. */
 
61
void HG_(ppWSUstats) ( WordSetU* wsu, HChar* name );
 
62
 
 
63
 
 
64
/* Element-level operations on WordSets.  Note that the WordSet
 
65
   numbers given out are 0, 1, 2, 3, etc, and as it happens 0 always
 
66
   represents the empty set. */
 
67
 
 
68
WordSet HG_(emptyWS)        ( WordSetU* );
 
69
WordSet HG_(addToWS)        ( WordSetU*, WordSet, Word );
 
70
WordSet HG_(delFromWS)      ( WordSetU*, WordSet, Word );
 
71
WordSet HG_(unionWS)        ( WordSetU*, WordSet, WordSet );
 
72
WordSet HG_(intersectWS)    ( WordSetU*, WordSet, WordSet );
 
73
WordSet HG_(minusWS)        ( WordSetU*, WordSet, WordSet );
 
74
Bool    HG_(isEmptyWS)      ( WordSetU*, WordSet );
 
75
Bool    HG_(isSingletonWS)  ( WordSetU*, WordSet, Word );
 
76
Word    HG_(anyElementOfWS) ( WordSetU*, WordSet );
 
77
Int     HG_(cardinalityWS)  ( WordSetU*, WordSet );
 
78
Bool    HG_(elemWS)         ( WordSetU*, WordSet, Word );
 
79
WordSet HG_(doubletonWS)    ( WordSetU*, Word, Word );
 
80
WordSet HG_(singletonWS)    ( WordSetU*, Word );
 
81
WordSet HG_(isSubsetOf)     ( WordSetU*, WordSet, WordSet );
 
82
 
 
83
Bool    HG_(plausibleWS)    ( WordSetU*, WordSet );
 
84
Bool    HG_(saneWS_SLOW)    ( WordSetU*, WordSet );
 
85
 
 
86
void    HG_(ppWS)           ( WordSetU*, WordSet );
 
87
void    HG_(getPayloadWS)   ( /*OUT*/Word** words, /*OUT*/Word* nWords, 
 
88
                             WordSetU*, WordSet );
 
89
 
 
90
 
 
91
//------------------------------------------------------------------//
 
92
//---                        end WordSet                         ---//
 
93
//---                      Public Interface                      ---//
 
94
//------------------------------------------------------------------//
 
95
 
 
96
#endif /* ! __HG_WORDSET_H */
 
97
 
 
98
/*--------------------------------------------------------------------*/
 
99
/*--- end                                             hg_wordset.h ---*/
 
100
/*--------------------------------------------------------------------*/