1 /*
2  * Copyright (C) 2002-2009, Parrot Foundation.
3  */
4 
5 #ifndef PARROT_IMCC_SETS_H_GUARD
6 #define PARROT_IMCC_SETS_H_GUARD
7 
8 typedef struct _Set {
9     unsigned int   length;
10     unsigned char *bmp;
11 } Set;
12 
13 /* HEADERIZER BEGIN: compilers/imcc/sets.c */
14 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
15 
16 void set_add(ARGMOD(Set *s), unsigned int element)
17         __attribute__nonnull__(1)
18         FUNC_MODIFIES(*s);
19 
20 void set_clear(ARGMOD(Set *s))
21         __attribute__nonnull__(1)
22         FUNC_MODIFIES(*s);
23 
24 PARROT_WARN_UNUSED_RESULT
25 PARROT_PURE_FUNCTION
26 int set_contains(ARGIN(const Set *s), unsigned int element)
27         __attribute__nonnull__(1);
28 
29 PARROT_MALLOC
30 PARROT_CANNOT_RETURN_NULL
31 Set* set_copy(ARGMOD(imc_info_t * imcc), ARGIN(const Set *s))
32         __attribute__nonnull__(1)
33         __attribute__nonnull__(2)
34         FUNC_MODIFIES(* imcc);
35 
36 PARROT_PURE_FUNCTION
37 int set_equal(ARGIN(const Set *s1), ARGIN(const Set *s2))
38         __attribute__nonnull__(1)
39         __attribute__nonnull__(2);
40 
41 PARROT_WARN_UNUSED_RESULT
42 PARROT_PURE_FUNCTION
43 unsigned int set_first_zero(ARGIN(const Set *s))
44         __attribute__nonnull__(1);
45 
46 void set_free(ARGMOD(Set *s))
47         __attribute__nonnull__(1)
48         FUNC_MODIFIES(*s);
49 
50 PARROT_MALLOC
51 PARROT_CANNOT_RETURN_NULL
52 Set * set_intersec(
53     ARGMOD(imc_info_t * imcc),
54     ARGIN(const Set *s1),
55     ARGIN(const Set *s2))
56         __attribute__nonnull__(1)
57         __attribute__nonnull__(2)
58         __attribute__nonnull__(3)
59         FUNC_MODIFIES(* imcc);
60 
61 void set_intersec_inplace(ARGMOD(Set *s1), ARGIN(const Set *s2))
62         __attribute__nonnull__(1)
63         __attribute__nonnull__(2)
64         FUNC_MODIFIES(*s1);
65 
66 PARROT_MALLOC
67 PARROT_CANNOT_RETURN_NULL
68 Set* set_make(ARGMOD(imc_info_t * imcc), unsigned int length)
69         __attribute__nonnull__(1)
70         FUNC_MODIFIES(* imcc);
71 
72 PARROT_MALLOC
73 PARROT_CANNOT_RETURN_NULL
74 Set* set_make_full(ARGMOD(imc_info_t * imcc), unsigned int length)
75         __attribute__nonnull__(1)
76         FUNC_MODIFIES(* imcc);
77 
78 PARROT_MALLOC
79 PARROT_CANNOT_RETURN_NULL
80 Set * set_union(
81     ARGMOD(imc_info_t * imcc),
82     ARGIN(const Set *s1),
83     ARGIN(const Set *s2))
84         __attribute__nonnull__(1)
85         __attribute__nonnull__(2)
86         __attribute__nonnull__(3)
87         FUNC_MODIFIES(* imcc);
88 
89 #define ASSERT_ARGS_set_add __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
90        PARROT_ASSERT_ARG(s))
91 #define ASSERT_ARGS_set_clear __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
92        PARROT_ASSERT_ARG(s))
93 #define ASSERT_ARGS_set_contains __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
94        PARROT_ASSERT_ARG(s))
95 #define ASSERT_ARGS_set_copy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
96        PARROT_ASSERT_ARG(imcc) \
97     , PARROT_ASSERT_ARG(s))
98 #define ASSERT_ARGS_set_equal __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
99        PARROT_ASSERT_ARG(s1) \
100     , PARROT_ASSERT_ARG(s2))
101 #define ASSERT_ARGS_set_first_zero __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
102        PARROT_ASSERT_ARG(s))
103 #define ASSERT_ARGS_set_free __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
104        PARROT_ASSERT_ARG(s))
105 #define ASSERT_ARGS_set_intersec __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
106        PARROT_ASSERT_ARG(imcc) \
107     , PARROT_ASSERT_ARG(s1) \
108     , PARROT_ASSERT_ARG(s2))
109 #define ASSERT_ARGS_set_intersec_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
110        PARROT_ASSERT_ARG(s1) \
111     , PARROT_ASSERT_ARG(s2))
112 #define ASSERT_ARGS_set_make __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
113        PARROT_ASSERT_ARG(imcc))
114 #define ASSERT_ARGS_set_make_full __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
115        PARROT_ASSERT_ARG(imcc))
116 #define ASSERT_ARGS_set_union __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
117        PARROT_ASSERT_ARG(imcc) \
118     , PARROT_ASSERT_ARG(s1) \
119     , PARROT_ASSERT_ARG(s2))
120 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
121 /* HEADERIZER END: compilers/imcc/sets.c */
122 
123 #endif /* PARROT_IMCC_SETS_H_GUARD */
124 
125 
126 /*
127  * Local variables:
128  *   c-file-style: "parrot"
129  * End:
130  * vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
131  */
132 
133