#ifndef H_ED_OBJ_20031122102740
#define H_ED_OBJ_20031122102740

#ifdef __cplusplus
extern "C"
{
#endif

/* ---------------------------------------------------------------------
   (c) ED 2003
   Project      : PROJECT
   Function     : generic objet manager
   Module       : OBJ
   File         : obj.h
   Created      : 22-11-2003
   Modified     : 26-11-2003
   --------------------------------------------------------------------- */

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

   0.0 22-11-2003 Created
   1.0 24-11-2003 Initial version
   1.1 26-11-2003 Full abstration (try)

   --------------------------------------------------------------------- */
#include <stddef.h>

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

#define OBJ_ABSTRACTION 1

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

   typedef enum
   {
      OBJ_OK,

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

#include "ed/inc/obj_err.itm"

#undef ITEM

      OBJ_ERR_NB
   }
   obj_err_e;

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

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

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

#if OBJ_ABSTRACTION
/* read-write */
   typedef struct obj *OBJ_RW;
/* read-only */
   typedef struct obj const *OBJ_RO;
#else
   typedef struct obj obj_s;
#endif

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

/* Identification */
   char const *obj_sid (void);
   char const *obj_sver (void);

/* Dynamic constructor / destructor */
#if OBJ_ABSTRACTION
   OBJ_RW obj_create (size_t size, size_t number);
   void obj_delete (OBJ_RW this);

/* Initialisation */
   obj_err_e obj_init (OBJ_RW this);
   obj_err_e obj_install_out (OBJ_RW this, obj_out_f * pf, void *p_data);

/* Input functions */
   obj_err_e obj_in (OBJ_RW this, int data);

   obj_err_e obj_write (OBJ_RW const this
                        ,void const *const pdata
                        ,size_t const ndx);

   obj_err_e obj_read (OBJ_RO const this
                       ,void *const pdata
                       ,size_t const ndx);
#else
   obj_s *obj_create (size_t size, size_t number);
   void obj_delete (obj_s * this);

/* Initialisation */
   obj_err_e obj_init (obj_s * this);
   obj_err_e obj_install_out (obj_s * this, obj_out_f * pf, void *p_data);

/* Input functions */
   obj_err_e obj_in (obj_s * this, int data);

   obj_err_e obj_write (obj_s * const this
                        ,void const *const pdata
                        ,size_t const ndx);

   obj_err_e obj_read (obj_s const *const this
                       ,void *const pdata
                       ,size_t const ndx);
#endif

#ifdef __cplusplus
}
#endif

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

#endif                          /* guard */
