/******************************************************
 *      omlba.c: Lambda Beta to Ada compiler
 ******************************************************/
/***********************************
   (C) Copyright 1992-1993; dit/upm
   Distributed under the conditions stated in the
   TOPO General Public License (see file LICENSE)
 ***********************************
 $Log: counter.h,v $
 * Revision 2.2  1993/01/18  18:14:46  lotos
 * distribution issues
 *
 * Revision 2.1  1992/11/17  17:37:29  lotos
 * variables are compacted per sort
 * split generated code into several files
 * generates *.hh
 * admit option to change basename
 * adapted to use c_cui's
 * modify sort tables
 * code generation is more rational (needs further polishing ...)
 * adapted to new data type conventions
 * adopt new naming convention
 * include var declaration list in light BUTs
 *
 * Revision 1.1  1992/09/02  16:58:07  lotos
 * Initial revision
 *
 ***********************************/

/***********************************
   David Larrabeiti Lopez
   25-04-91

   Repeated Variations calculation for
   gd= ( a[1],...,a[m] in [b[1],..,b[n]] )

   This module generates a n-module counter of m digits.
   Each digit is an index in b[].

   TYPE DEFINITIONS:

   FUNCTION DEFINITIONS:
      Init_Counter : clears sets number of digits and module of counter
      Increment : increments counter
************************************/

/***********************************
   Gabriel Huecas Fernandez-Toribio
   21-07-92
   Adapted to unlimited size of the counter, by means of using the EPS.
************************************/

#include "cast.hh"

/* The Counter :
       digits  = number of digits,
       module  = module,
       counter = counter.

       Each digit is a position in the array */

extern IT *counter;

/* Init_Counter
*  Clears counter[] & Sets the number of digits for it, and its module.
*/
extern void Init_Counter( /* digits, module */);
/*	 int digits, module;*/


/* Increment
*  Increments counter ("module"-module).
*  if it succeeds :
      return true
*  If the counter overflows (over "digits" digits)
*     there is no increment & return false.
*/
extern int Increment();


