#ifndef H_ED_HIS_20030925100855
#define H_ED_HIS_20030925100855

#ifdef __cplusplus
extern "C"
{
#endif

/* ---------------------------------------------------------------------
   (c) ED 2003
   Project      : PROJECT
   Function     : Histogram manager
   Module       : HIS
   File         : his.h
   Created      : 25-09-2003
   Modified     : 25-09-2003
   --------------------------------------------------------------------- */

/* ---------------------------------------------------------------------
   Log

   0.0 25-09-2003 Created
   1.0 25-09-2003 Initial version

   --------------------------------------------------------------------- */
#include <stddef.h>
#include "ed/inc/types.h"

/* macros ============================================================== */

#define HIS_OUT 0

/* constants =========================================================== */

   typedef enum
   {
      HIS_OK,

#define ITEM(n_, s_)\
   HIS_ERR_##n_,

#include "ed/inc/his_err.itm"

#undef ITEM

      HIS_ERR_NB
   }
   his_err_e;

/* types =============================================================== */

   typedef int his_out_f (void *p_usr, int data);

/* structures ========================================================== */

   typedef struct
   {
      ulong count;
      uint full:1;
   }
   his_usr_s;

   typedef struct
   {
      his_usr_s *a;
      size_t n;

      ulong max;
      char const *id;

      uint width;               /* Paper width (>= 60) */
#if HIS_OUT
      his_out_f *pf;
      void *p_usr;
#endif

   }
   his_s;

/* functions =========================================================== */

/* Identification */
   char const *his_sid (void);
   char const *his_sver (void);

/* Dynamic constructor / destructor */
   his_s *his_create (size_t n);
   void his_delete (his_s * this);

/* Initialisation */
   his_err_e his_clr (his_s * this);
   his_err_e his_init (his_s * this
                       ,his_usr_s * a
                       ,size_t n
                       ,char const *id
                       ,uint width
   );

#if HIS_OUT
   his_err_e his_install_out (his_s * this, his_out_f * pf, void *p_data);
#endif

/* Input functions */
   his_err_e his_probe (his_s * this, size_t data);
   his_err_e his_print_hor (his_s * this);
   his_err_e his_print_ver (his_s * this);

/* Accessors */
   char const *his_id (his_s * this);

#ifdef __cplusplus
}
#endif

/* ---------------------------------------------------------------------
   Generated by NEW (c) ED 2.3
   Powered by C-code generator (c) ED 2003 1.0
   --------------------------------------------------------------------- */

#endif                          /* guard */
