+++ /dev/null
-/* -*-c-*-
- *
- * $Id: set.c,v 1.2 1997/08/04 10:24:25 mdw Exp $
- *
- * Management of sets (for the use of the class expression handler)
- *
- * (c) 1997 EBI
- */
-
-/*----- Licensing notice --------------------------------------------------*
- *
- * This file is part of `become'
- *
- * `Become' is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * `Become' is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with `become'; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: set.c,v $
- * Revision 1.2 1997/08/04 10:24:25 mdw
- * Sources placed under CVS control.
- *
- * Revision 1.1 1997/07/21 13:47:44 mdw
- * Initial revision
- *
- */
-
-/*----- Header files ------------------------------------------------------*/
-
-/* --- ANSI headers --- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* --- Local headers --- */
-
-#include "set.h"
-#include "sym.h"
-#include "utils.h"
-
-/*----- Main code ---------------------------------------------------------*/
-
-/* --- @set_subtract@ --- *
- *
- * Arguments: @sym_table *a@ = pointer to table @A@
- * @sym_table *b@ = pointer to table @B@
- *
- * Returns: A symbol table containing all the elements in @A@ which don't
- * appear in @B@.
- *
- * Use: Subtracts a symbol table from another symbol table. Assumes
- * that there's no data following the actual @sym_base@ block
- * for each item in the table.
- */
-
-sym_table *set_subtract(sym_table *a, sym_table *b)
-{
- sym_table *c = xmalloc(sizeof(*c));
- sym_iter i;
- sym_base *s;
- unsigned f;
-
- sym_createTable(c);
- for (sym_createIter(&i, a); (s = sym_next(&i)) != 0; ) {
- if (!sym_find(b, s->name, s->len, 0, &f))
- sym_find(c, s->name, s->len, sizeof(sym_base), 0);
- }
-
- return (c);
-}
-
-/* --- @set_intersect@ --- *
- *
- * Arguments: @sym_table *a@ = pointer to table @A@
- * @sym_table *b@ = pointer to table @B@
- *
- * Returns: A symbol table containing all the elements in @A@ which also
- * appear in @B@.
- *
- * Use: Constructs the intersection of two symbol tables. Assumes
- * that there's no data following the actual @sym_base@ block
- * for each item in the table.
- */
-
-sym_table *set_intersect(sym_table *a, sym_table *b)
-{
- sym_table *c = xmalloc(sizeof(*c));
- sym_iter i;
- sym_base *s;
- unsigned f;
-
- sym_createTable(c);
- for (sym_createIter(&i, a); (s = sym_next(&i)) != 0; ) {
- if (sym_find(b, s->name, s->len, 0, &f))
- sym_find(c, s->name, s->len, sizeof(sym_base), 0);
- }
-
- return (c);
-}
-
-/* --- @set_union@ --- *
- *
- * Arguments: @sym_table *a@ = pointer to table @A@
- * @sym_table *b@ = pointer to table @B@
- *
- * Returns: A symbol table containing all the elements in @A@ and those
- * in @B@.
- *
- * Use: Constructs the union of two symbol tables. Assumes that
- * there's no data following the actual @sym_base@ block for
- * each item in the table.
- */
-
-sym_table *set_union(sym_table *a, sym_table *b)
-{
- sym_table *c = xmalloc(sizeof(*c));
- sym_iter i;
- sym_base *s;
-
- sym_createTable(c);
- for (sym_createIter(&i, a); (s = sym_next(&i)) != 0; )
- sym_find(c, s->name, s->len, sizeof(sym_base), 0);
-
- for (sym_createIter(&i, b); (s = sym_next(&i)) != 0; )
- sym_find(c, s->name, s->len, sizeof(sym_base), 0);
-
- return (c);
-}
-
-/* --- @set_copy@ --- *
- *
- * Arguments: @sym_table *a@ = pointer to table
- *
- * Returns: A copy of the symbol table.
- *
- * Use: Copies a symbol table. Same assumptions again...
- */
-
-sym_table *set_copy(sym_table *a)
-{
- sym_table *c = xmalloc(sizeof(*c));
- sym_iter i;
- sym_base *s;
-
- for (sym_createIter(&i, a); (s = sym_next(&i)) != 0; )
- sym_find(c, s->name, s->len, sizeof(sym_base), 0);
-
- return (c);
-}
-
-/*----- That's all, folks -------------------------------------------------*/
+++ /dev/null
-/* -*-c-*-
- *
- * $Id: set.h,v 1.2 1997/08/04 10:24:25 mdw Exp $
- *
- * Management of sets (for the use of the class expression handler)
- *
- * (c) 1997 EBI
- */
-
-/*----- Licensing notice --------------------------------------------------*
- *
- * This file is part of `become'
- *
- * `Become' is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * `Become' is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with `become'; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: set.h,v $
- * Revision 1.2 1997/08/04 10:24:25 mdw
- * Sources placed under CVS control.
- *
- * Revision 1.1 1997/07/21 13:47:44 mdw
- * Initial revision
- *
- */
-
-#ifndef SET_H
-#define SET_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/*----- Required headers --------------------------------------------------*/
-
-#ifndef SYM_H
-# include "sym.h"
-#endif
-
-/*----- Functions provided ------------------------------------------------*/
-
-/* --- @set_subtract@ --- *
- *
- * Arguments: @sym_table *a@ = pointer to table @A@
- * @sym_table *b@ = pointer to table @B@
- *
- * Returns: A symbol table containing all the elements in @A@ which don't
- * appear in @B@.
- *
- * Use: Subtracts a symbol table from another symbol table. Assumes
- * that there's no data following the actual @sym_base@ block
- * for each item in the table.
- */
-
-extern sym_table *set_subtract(sym_table */*a*/, sym_table */*b*/);
-
-/* --- @set_intersect@ --- *
- *
- * Arguments: @sym_table *a@ = pointer to table @A@
- * @sym_table *b@ = pointer to table @B@
- *
- * Returns: A symbol table containing all the elements in @A@ which also
- * appear in @B@.
- *
- * Use: Constructs the intersection of two symbol tables. Assumes
- * that there's no data following the actual @sym_base@ block
- * for each item in the table.
- */
-
-sym_table *set_intersect(sym_table */*a*/, sym_table */*b*/);
-
-/* --- @set_union@ --- *
- *
- * Arguments: @sym_table *a@ = pointer to table @A@
- * @sym_table *b@ = pointer to table @B@
- *
- * Returns: A symbol table containing all the elements in @A@ and those
- * in @B@.
- *
- * Use: Constructs the union of two symbol tables. Assumes that
- * there's no data following the actual @sym_base@ block for
- * each item in the table.
- */
-
-sym_table *set_union(sym_table */*a*/, sym_table */*b*/);
-
-/* --- @set_copy@ --- *
- *
- * Arguments: @sym_table *a@ = pointer to table
- *
- * Returns: A copy of the symbol table.
- *
- * Use: Copies a symbol table. Same assumptions again...
- */
-
-sym_table *set_copy(sym_table */*a*/);
-
-/*----- That's all, folks -------------------------------------------------*/
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif