#ifndef ASCII_H
#define ASCII_H
/* ---------------------------------------------------------------------
   (c) ED 1995-2000
   Project      : CLIB
   Function     : Constantes ASCII, chaines des codes de controle 0 a 31
   Module       : ASCII
   File         : ASCII.H
   Created      : 15-07-2002
   Modified     : 24-02-2007
   --------------------------------------------------------------------- */

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

   1.9 du 24-02-2007 Mise au point de ASCII_noacc_ansi()
   1.8 du 17-09-2005 Mise au point de ASCII_noacc_ibm()
   1.7 du 13-04-2004 Ajout de ASCII_noacc_ansi()
   1.6 du 13-07-2002 LCLint
   1.5 du 14-12-2000 ASCII_noacc() devient ASCII_noacc_ibm()
   1.4 du 09-08-2000 Ajoute ASCII_noacc()
   1.3 du 09-08-1998 'sASC' devient 'aszAscii' Supprimme les blancs
   1.2 du 10-08-1998 define -> enum
   .                 tableau -> fonction
   1.1 du 02-05-1997 rajoute 'const'
   1.0 du 28-09-1995 Version operationelle

   --------------------------------------------------------------------- */
/* public data ========================================================= */
/* macros ============================================================== */
/* constants =========================================================== */

typedef enum
{
   NUL,                         /*  0 */
   SOH,                         /*  1 */
   STX,                         /*  2 */
   ETX,                         /*  3 */
   EOT,                         /*  4 */
   ENQ,                         /*  5 */
   ACK,                         /*  6 */
   BEL,                         /*  7 */
   BS,                          /*  8 */
   HT,                          /*  9 */
   LF,                          /* 10 */
   VT,                          /* 11 */
   FF,                          /* 12 */
   CR,                          /* 13 */
   SO,                          /* 14 */
   SI,                          /* 15 *//* SHIFT-TAB */
   DLE,                         /* 16 */
   XON,                         /* 17 */
   DC2,                         /* 18 */
   XOF,                         /* 19 */
   DC4,                         /* 20 */
   NAK,                         /* 21 */
   SYN,                         /* 22 */
   ETB,                         /* 23 */
   CAN,                         /* 24 */
   EM,                          /* 25 */
   SUB,                         /* 26 */
   ESC,                         /* 27 */
   FS,                          /* 28 */
   GS,                          /* 29 */
   RS,                          /* 30 */
   US,                          /* 31 */
   ASCII_NB
}
eASCII;

#define SPC 32

typedef enum
{
#define ITEM(a, b, c, d, e, f, g, h, i, j) \
   ANSI_ ## b = d,
#include "ed/inc/ansi.itm"
#undef ITEM

   ANSI_dummy
}
charset_ansi_e;

typedef enum
{
#define ITEM(a, b, c, d, e, f, g, h, i, j) \
   OEM_ ## c = d,
#include "ed/inc/ansi.itm"
#undef ITEM

   OEM_dummy
}
charset_oem_e;

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

typedef struct
{
   int val;
   char const *sid;
}
charset_s;

/* entry points ======================================================== */

/* ---------------------------------------------------------------------
   ASCII_sid ()
   ---------------------------------------------------------------------

   ---------------------------------------------------------------------
   I:
   O:
   --------------------------------------------------------------------- */
char const *ASCII_sid (void);

/* ---------------------------------------------------------------------
   ASCII_sver ()
   ---------------------------------------------------------------------

   ---------------------------------------------------------------------
   I:
   O:
   --------------------------------------------------------------------- */
char const *ASCII_sver (void);

/* ---------------------------------------------------------------------
   ASCII_str()
   ---------------------------------------------------------------------
   Retourne une chaine traduisant les caracteres ASCII non imprimables
   ---------------------------------------------------------------------
   E : caractere
   S : caractere filtre
   --------------------------------------------------------------------- */
const char *ASCII_str (eASCII const c);

/* ---------------------------------------------------------------------
   ASCII_oem_info()
   ---------------------------------------------------------------------
   Retourne les informations d'un caractere OEM
   ---------------------------------------------------------------------
   E : caractere OEM
   S : informations
   --------------------------------------------------------------------- */
charset_s const *ASCII_oem_info (charset_oem_e const c);

/* ---------------------------------------------------------------------
   ASCII_noacc_ibm()
   ---------------------------------------------------------------------
   Retourne un caractere non accentue a partir d'un caractere quelqonque
   du jeu etendu ASCII-IBM
   ---------------------------------------------------------------------
   E : caractere
   S : caractere filtre
   --------------------------------------------------------------------- */
int ASCII_noacc_ibm (int c, int *const pErr);

int ASCII_noacc_ansi (int const c);

#endif /*ASCII_H */
