| 1 | /* -*-c-*- |
| 2 | * |
| 3 | * $Id: set.h,v 1.1 1997/07/21 13:47:44 mdw Exp $ |
| 4 | * |
| 5 | * Management of sets (for the use of the class expression handler) |
| 6 | * |
| 7 | * (c) 1997 EBI |
| 8 | */ |
| 9 | |
| 10 | /*----- Licencing notice --------------------------------------------------* |
| 11 | * |
| 12 | * This file is part of `become' |
| 13 | * |
| 14 | * `Become' is free software; you can redistribute it and/or modify |
| 15 | * it under the terms of the GNU General Public License as published by |
| 16 | * the Free Software Foundation; either version 2 of the License, or |
| 17 | * (at your option) any later version. |
| 18 | * |
| 19 | * `Become' is distributed in the hope that it will be useful, |
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | * GNU General Public License for more details. |
| 23 | * |
| 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with `become'; if not, write to the Free Software |
| 26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 27 | */ |
| 28 | |
| 29 | /*----- Revision history --------------------------------------------------* |
| 30 | * |
| 31 | * $Log: set.h,v $ |
| 32 | * Revision 1.1 1997/07/21 13:47:44 mdw |
| 33 | * Initial revision |
| 34 | * |
| 35 | */ |
| 36 | |
| 37 | #ifndef SET_H |
| 38 | #define SET_H |
| 39 | |
| 40 | #ifdef __cplusplus |
| 41 | extern "C" { |
| 42 | #endif |
| 43 | |
| 44 | /*----- Required headers --------------------------------------------------*/ |
| 45 | |
| 46 | #ifndef SYM_H |
| 47 | # include "sym.h" |
| 48 | #endif |
| 49 | |
| 50 | /*----- Functions provided ------------------------------------------------*/ |
| 51 | |
| 52 | /* --- @set_subtract@ --- * |
| 53 | * |
| 54 | * Arguments: @sym_table *a@ = pointer to table @A@ |
| 55 | * @sym_table *b@ = pointer to table @B@ |
| 56 | * |
| 57 | * Returns: A symbol table containing all the elements in @A@ which don't |
| 58 | * appear in @B@. |
| 59 | * |
| 60 | * Use: Subtracts a symbol table from another symbol table. Assumes |
| 61 | * that there's no data following the actual @sym_base@ block |
| 62 | * for each item in the table. |
| 63 | */ |
| 64 | |
| 65 | extern sym_table *set_subtract(sym_table */*a*/, sym_table */*b*/); |
| 66 | |
| 67 | /* --- @set_intersect@ --- * |
| 68 | * |
| 69 | * Arguments: @sym_table *a@ = pointer to table @A@ |
| 70 | * @sym_table *b@ = pointer to table @B@ |
| 71 | * |
| 72 | * Returns: A symbol table containing all the elements in @A@ which also |
| 73 | * appear in @B@. |
| 74 | * |
| 75 | * Use: Constructs the intersection of two symbol tables. Assumes |
| 76 | * that there's no data following the actual @sym_base@ block |
| 77 | * for each item in the table. |
| 78 | */ |
| 79 | |
| 80 | sym_table *set_intersect(sym_table */*a*/, sym_table */*b*/); |
| 81 | |
| 82 | /* --- @set_union@ --- * |
| 83 | * |
| 84 | * Arguments: @sym_table *a@ = pointer to table @A@ |
| 85 | * @sym_table *b@ = pointer to table @B@ |
| 86 | * |
| 87 | * Returns: A symbol table containing all the elements in @A@ and those |
| 88 | * in @B@. |
| 89 | * |
| 90 | * Use: Constructs the union of two symbol tables. Assumes that |
| 91 | * there's no data following the actual @sym_base@ block for |
| 92 | * each item in the table. |
| 93 | */ |
| 94 | |
| 95 | sym_table *set_union(sym_table */*a*/, sym_table */*b*/); |
| 96 | |
| 97 | /* --- @set_copy@ --- * |
| 98 | * |
| 99 | * Arguments: @sym_table *a@ = pointer to table |
| 100 | * |
| 101 | * Returns: A copy of the symbol table. |
| 102 | * |
| 103 | * Use: Copies a symbol table. Same assumptions again... |
| 104 | */ |
| 105 | |
| 106 | sym_table *set_copy(sym_table */*a*/); |
| 107 | |
| 108 | /*----- That's all, folks -------------------------------------------------*/ |
| 109 | |
| 110 | #ifdef __cplusplus |
| 111 | } |
| 112 | #endif |
| 113 | |
| 114 | #endif |