home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnurx.zip / rx / rx.c < prev    next >
C/C++ Source or Header  |  1995-12-31  |  2KB  |  69 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. #include "rxall.h"
  28. #include "rxhash.h"
  29. #include "rxnfa.h"
  30.  
  31.  
  32.  
  33. const char rx_version_string[] = "GNU Rx version 1.0";
  34.  
  35.  
  36. #ifdef __STDC__
  37. struct rx *
  38. rx_make_rx (int cset_size)
  39. #else
  40. struct rx *
  41. rx_make_rx (cset_size)
  42.      int cset_size;
  43. #endif
  44. {
  45.   static int rx_id = 0;
  46.   struct rx * new_rx;
  47.   new_rx = (struct rx *)malloc (sizeof (*new_rx));
  48.   bzero (new_rx, sizeof (*new_rx));
  49.   new_rx->rx_id = rx_id++;
  50.   new_rx->cache = rx_default_cache;
  51.   new_rx->local_cset_size = cset_size;
  52.   new_rx->instruction_table = rx_id_instruction_table;
  53.   new_rx->next_nfa_id = 0;
  54.   return new_rx;
  55. }
  56.  
  57. #ifdef __STDC__
  58. void
  59. rx_free_rx (struct rx * rx)
  60. #else
  61. void
  62. rx_free_rx (rx)
  63.      struct rx * rx;
  64. #endif
  65. {
  66.   rx_free_nfa (rx);
  67.   free (rx);
  68. }
  69.