home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnurx.zip / rx / rxcset.c < prev    next >
C/C++ Source or Header  |  1995-12-31  |  2KB  |  86 lines

  1. /***********************************************************
  2.  
  3. Copyright 1995 by Tom Lord
  4.  
  5.                         All Rights Reserved
  6.  
  7. Permission to use, copy, modify, and distribute this software and its 
  8. documentation for any purpose and without fee is hereby granted, 
  9. provided that the above copyright notice appear in all copies and that
  10. both that copyright notice and this permission notice appear in 
  11. supporting documentation, and that the name of the copyright holder not be
  12. used in advertising or publicity pertaining to distribution of the
  13. software without specific, written prior permission.  
  14.  
  15. Tom Lord DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  16. INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  17. EVENT SHALL TOM LORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  18. CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  19. USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  20. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  21. PERFORMANCE OF THIS SOFTWARE.
  22.  
  23. ******************************************************************/
  24.  
  25.  
  26. /*
  27.  * Tom Lord (lord@cygnus.com, lord@gnu.ai.mit.edu)
  28.  */
  29.  
  30.  
  31.  
  32. #include "rxall.h"
  33. #include "rxcset.h"
  34. /* Utilities for manipulating bitset represntations of characters sets. */
  35.  
  36. #ifdef __STDC__
  37. rx_Bitset
  38. rx_cset (int size)
  39. #else
  40. rx_Bitset
  41. rx_cset (size)
  42.      int size;
  43. #endif
  44. {
  45.   rx_Bitset b;
  46.   b = (rx_Bitset) malloc (rx_sizeof_bitset (size));
  47.   if (b)
  48.     rx_bitset_null (size, b);
  49.   return b;
  50. }
  51.  
  52.  
  53. #ifdef __STDC__
  54. rx_Bitset
  55. rx_copy_cset (int size, rx_Bitset a)
  56. #else
  57. rx_Bitset
  58. rx_copy_cset (size, a)
  59.      int size;
  60.      rx_Bitset a;
  61. #endif
  62. {
  63.   rx_Bitset cs;
  64.   cs = rx_cset (size);
  65.  
  66.   if (cs)
  67.     rx_bitset_union (size, cs, a);
  68.  
  69.   return cs;
  70. }
  71.  
  72.  
  73. #ifdef __STDC__
  74. void
  75. rx_free_cset (rx_Bitset c)
  76. #else
  77. void
  78. rx_free_cset (c)
  79.      rx_Bitset c;
  80. #endif
  81. {
  82.   if (c)
  83.     free ((char *)c);
  84. }
  85.  
  86.