/* NAME = defa.h */
/************************************************************/
/*    defa.h: Fichier include des definitions               */
/*        Version du 01-07-2001 (6.1) (Michel BRET)         */
/************************************************************/

#define VERSION "\nVersion: 6.1 mars 2000\nGraphique: OpenGL\nMachines: SGI PC\n"

#include <stdio.h>
#include <errno.h>
#include <math.h>
/*???#include <strings.h> inconnu par PC_NT ???*/
#include <malloc.h>
#include <signal.h>
#include <setjmp.h>

#ifdef UNIX
#include <sys/time.h>
#endif

#include <time.h>

/* BUG PC */
/* ------ */
#ifdef WIN32
extern double atof(char *);
extern double cos(double);
extern double sin(double);
extern double tan(double);
#endif

#define MAXFLOAT        ((float)3.40282346638528860e+38)

/* Type machine */
/* ------------ */
#define A_SGI 0
#define A_PC 1

/**************/
/* CONSTANTES */
/**************/

/* Buffers de lecture */
#define DIM0 80
#define DIM1 256

/* pi */
#define PI 3.14159265358979323846
#define PIS2 1.57079632679489661923
#define DEUXPI 6.28318530717958647692
/* Conversion radians <-> degres */
#define Rad_Deg 57.295776
#define Deg_Rad 0.017453

/* flags speciaux */
#define FLAG_F 111111.0
#define FLAG_I -12345

/* Bornes */
#define EPSF0 0.0000001
#define EPSF 0.0001
#define EPSF3 0.001
#define EPSF2 0.1
#define MAX_DIST 1000000.0
#define MAX_INT 1000000000

/* Exponentielles calculables */
#define MAX_EXP 43.0
#define MIN_EXP -11350.0

/*************/
/* COMMANDES */
/*************/

/* Commandes de l'interpreteur */
/* --------------------------- */

#define DIRECTORY 0
#define BYE 1
#define HELP 2
#define DEBUG 3
#define OUI 4
#define NON 5
#define FONC 6
#define ENT 7
#define EXTERN 8
#define LOG 9
#define FOR 10
#define RETURN 11
#define GOTO 12
/*???#define LIBRE 13 LIBRE	*/
#define LIRE 14
#define GARE 15
#define IF 16
#define ELSE 17
#define WHILE 18
#define INPUT 19
#define SQRT 20
#define VAR 21
#define NIL 22
#define LINKER 23
#define INI 24
#define PIC 25
#define COS 26
#define SIN 27
#define TAN 28
#define A_BREAK 29
#define SWITCH 30
#define CASE 31
#define DEFAULT 32
#define AJOU 33
#define SUP 34
#define SYSTEM 35
#define EDITER 36
#define ARC 37
#define RAND 38
#define RANDF 39
#define RAND2 40
#define LIMITE 41
#define CG 42
#define NP 43
/*???#define LIBRE 44	???*/
#define A_STATIC 45
#define ABS 46
#define EXP 47
#define SOMME 48
#define PRODUIT 49
#define PRECISION 50
#define WAIT 51
#define SONNE 52
#define CHAINE 53
#define MAX 54
#define MIN 55
#define ASCII 56
#define NUMERO 57
#define DIM 58
#define DIST 59
#define ABA 60
#define FIN 61
#define PRINT 62
#define COMPILER 63
#define OBJET 64
#define DEMO 65
#define RC 66
#define INV 67
#define GENERER 68
#define EXEC 69
#define DUP 70
#define UNITAIRE 71
#define ACOS 72
#define ASIN 73
#define ATAN 74
#define ATOI 75
#define ATOF 76
#define RAND2F 77
#define CHAINEF 78
#define CLEAN 79
#define MESSAGE 80
#define MOYENNE 81
#define NOM 82
#define COSH 83
#define SINH 84
#define TANH 85
#define ACOSH 86
#define ASINH 87
#define ATANH 88
#define ERREUR 89
#define FORMAT 90
#define MODULE 91
#define STOP 92
#define GO 93
#define INCLU 94
#define PULS 95
#define LIST 96
#define AUTO 97
#define A_TIME 98
#define SCALAIRE 99
#define VECTORIEL 100
#define LOCALE 101
#define TRIER 102
#define A_INT 103
#define EXIT 104
#define HISTORY 105
#define TYPE 106
#define A_ALIAS 107
#define A_STATUS 108
#define A_MALLOC 109
#define A_CALLOC 110
#define A_GREP 111
#define MATRICE 112
#define A_PIPE 113

/* Commandes de anyflo */
/* ------------------- */
#define A_LUM 24    /* LUM */
#define A_IMAGE 28    /* IMAGE */
#define A_MEMOIRE 148    /* MEMOIRE */

/* Codes d'erreur */
/* -------------- */
/* Erreur ordinaire (message au niveau le plus bas) */
#define ERR0 -1

/* fic.h */
#define TYPE_H 1

/* Debordements(message dans evaluer_mult) */
#define DEB_LOC -11
#define DEB_EV -12
#define DEB_FONC -13
#define DEB_FIC -14
#define DEB_OBJ -15
#define DEB_EMP -16
#define DEB_TAB -17

/* Operateurs logiques */
/* ------------------- */

#define EG_EG 1001      /* == */
#define NOT_EG 1002     /* != */
#define INF_EG 1003     /* <= */
#define SUP_EG 1004     /* >= */
#define ET_ET 1005      /* && */
#define OU_OU 1006      /* || */
#define PEU_DIFF 1007   /* ~= */
#define POW_EG 1008     /* ^= */

/* Decallages */
/* ---------- */

#define DEC_G 1009       /* << */
#define DEC_D 1010       /* >> */

/* Operateurs arithmetiques */
/* ------------------------ */

#define PLUS_EG 10011     /* += */
#define MOINS_EG 1012    /* -= */
#define MUL_EG 1013      /* *= */
#define DIV_EG 1014      /* /= */
#define PC_EG 1015       /* %= */
#define DEC_G_EG 1016    /* <<= */
#define DEC_D_EG 1017    /* >>= */
#define ET_EG 1018       /* &= */
#define OU_EG 1019       /* |= */
#define VIRG_EG 1021    /* ,= */
/* (dim,TYPE_MULT,nb,0,dimt,type,nt,1,t1,t2,...,tnt)
(dim,p1,p2,...,pdim-1)(1) ... */
#define TYPE_MULT 1020

/***************/
/* COMPILATEUR */
/***************/

/* Structure des instructions: (code,type) */
/* -------------------------------------- */

#define DIM_INSTRUCTION 2

/* Separateurs speciaux */
/* -------------------- */

/* A la ligne: genere par passe1 pour un \n */
#define A_L_L '\n'

/* Fin d'instruction */
#define F_I ';'

/* "...\"..." -> "...GUILLEMET..." */
#define GUILLEMET 1

/* (NOM_FONC=2,"...") = nom de la fonction compilee */
#define DIM_NOM_FONC 80
#define NOM_FONC 2

/* (A_LIGNE,l1,l2,l3,l4) = numero de ligne */
#define DIM_LIGNE 5
#define A_LIGNE 3

/* Commandes speciales: */
/* -------------------- */

/* (-com,p,nl): com = numero de la commande
                        (-(1000+n),p,nl): n = special */

/* Codes des instructions */
/* ---------------------- */

/* Chaine: (dim,A_CHAR,.,.,"texte") */
#define A_CHAR -1000
/* Unsigned char: (dim,UNSIGNED_CHAR,nu,1,u,...) */
#define UNSIGNED_CHAR -1053
/* short */
#define A_SHORT -1055

/* Separateur: (SEPARATEUR,sep) */
#define SEPARATEUR -1001 

/* Vecteur flottant: (dim,A_FLOAT,n,,1,x1,...,xn,dim) */
#define A_FLOAT -1002

/* Commande: (dim,COMMANDE,nb,0)(6,-3,1,1,p_com,6)(liste),dim */
#define COMMANDE -1003

/* Variable locale (VAR_LOC,num,nl)  */
#define VAR_LOC -1004

/* static (STA_STA,num) */
#define STA_STA -1005

/* Variable globale (VAR_GLB,p_obj,nl) */
#define VAR_GLB -1006

/* Type hybride */
# define HYBRIDE -1007

/* Variable generee */
#define EV -1008

/* Fin de fonction */
#define END -1009

/* BREAK dans un BLOC: GOTO }} + 1 */
#define BREAK2 -1010

/* switch (expr) {case(expr) ... */
#define CASE_VAR -1011

/* Variable evaluee dans Pile_ev (copiee et deletable) */
#define EV2 -1012

/* (dim,AD,n,1,p1,p2,...,pn): pi -> bloc */
#define AD -1013
/* (dim,OBJ,n,1,p1,p2,...,pn): pi -> objet */
#define OBJ -1043

/* Num_LIGNE: NUmero de ligne */
#define NUM_LIGNE -1014

/* INTERP: Ligne de commandes */
#define INTERP -1015

/* Pointeur de valeur ] */
#define PT1 -1016
/* Pointeur de mot ACOL2 */
#define PT2 -1017

/* ETIQ: Etiquette (ETIQ,num) */
#define ETIQ -1019

/* Instruction vide: NOP */
#define A_NOP -1020

/* COMP: (dim,COMP,nb_local,(compile)0) */
#define COMP -1021

/* Delimiteurs de point: Accolades {} */
#define ACOL1 '{'
#define ACOL2 '}'
/* Delimiteurs de bloc: Accolades {} */
#define ACOL3 -1022
#define ACOL4 -1023

/* FOR compile */
/* for(ini;cond;inc): (dim,FOR1,ini,cond,V,F,.,.,.,.,.,.,.) */
/* for(i=bi,bs,pas): (SEP,FOR0)(dim,FOR2,ad(bi),i,ad(bs),bs,ad(p),p,v,f) */
#define NB_FOR 20
#define FOR1 -1024
#define FOR2 -1025
#define FOR0 -1026
/* FOR linke */
/* (ini)(dim,FOR_L1,c,v,f)(cond)(inc)... */
/* (ini)(dim,FOR_L2,...)... */
#define FOR_L1 -1027
#define FOR_L2 -1028

/* Types lacunaires
    int: (dim,LAC_I,n,dimp)(flag,v1,v2,...,vn-1)
    float: (dim,LAC_F,n,dimp)(flag,v1,v2,...,vdimp-1) */
#define LAC_I -1029
#define LAC_F -1030

/* IF compile */
/* if(cond): (dim,IF,c,v,f,.,.,.,.,.,.,.,.) */
#define NB_IF 13
/* IF linke */
#define IF_L -IF

/* while(cond): (dim,WHILE,c,v,f,.,.,.,.) */
#define NB_WHILE 9
/* (3,SWITCH,cpt=0) */
#define NB_SWITCH 3

/* EV1: Constantes compilees (non deletables) */
#define EV1 -1027

/* Adresse indefinie avant le link */
#define INDEFINI -1032

/* GOTO apres le link */
#define GOTO_L -1031

/* LIBRE */
/*??#define BREAK1 -1033??*/

/* switch */
#define SWITCH_SWITCH -1034

/* case constante apres link: (dim,CASE_L,val,ad,...) */
#define CASE_L -1035

/* Objet des #define */
/*??? LIBRE: #define ??? -1036 ???*/

/* Fonction: (CODE_FONC,p_mac,na) */
#define CODE_FONC -1037
/* Fonction sur le disque: (FONC_DISK,->nom,na) */
#define FONC_DISK -1038

/* Commande multiple (type=MULT,bloc->(dim,n,3,act1,...,actn) */
#define MULT -1039

/* Indices de [ et de { */
#define INDICE_1 -1040
#define INDICE_2 -1041

/* Variable formelle */
#define FORMEL -1042

/* Variables statiques */
#define STATIC_STATIC -1044

/* Fonctions constantes */
/*??? LIBRE #define PI_PI -1045???*/

/* Indicateur de buffer */
#define BUFF -1046

/* #define c1 c2 */
#define DEFINE -1047

/* Type long */
#define A_LONG -1048

/* ++ et -- */
#define PLUS_PLUS -1049
#define MOINS_MOINS -1050

/* @var: Passage d'adresses */
#define AD_GLB -1051
#define AD_LOC -1052
#define AD_STATIC -1054
#define AD_AD -1056

/**************************/
/* STRUCTURES DES DONNEES */
/**************************/

/* Numeros des noms */
#define NUM_INI 0
#define NUM_ENV 1
#define NUM_UTI 2

/* Adresses des noms dans (Penv[1]).buf_nom */
#define AD_INI 0
#define AD_ENV DIM0
#define AD_UTI (NUM_UTI * DIM0)

/* (dim, type, nb, pt ou dimb) */
#define DIM_TETE 4

/* Commande multiple: (num_env,num_com,p_val,p_num) */
#define DIM_MULT 4

/* Memoire partagee */
/* ---------------- */
#define SHM_OFF 0
#define SHM_DIM_OUT 1    /* dim: anyflo -> applic */
#define SHM_DIM_IN 2    /* dim: applic -> anyflo */
#define SHM_OUT 3    /* datas: anyflo -> applic */
#define SHM_IN 4    /* datas: applic -> anyflo */
#define SHM_ERREUR 5    /* Erreur */
#define SHM_TRAITER 6    /* Traitement par l'applic */
#define SHM_FIN 7    /* Fin */
#define SHM_DATAS 8

/* Structures de piles [deb, p, fin[ */
/* --------------------------------- */

struct Pile_char
    {
    char *deb;
    char *p;
    char *fin;
    };

struct Pile_long
    {
    long *deb;
    long *p;
    long *fin;
    };

struct Pile_FILE
    {
    FILE *deb;
    FILE *p;
    FILE *fin;
    };

struct Pile_float
    {
    float *deb;
    float *p;
    float *fin;
    };

/* Structure de commande */
/* --------------------- */

struct Commande
    {
/* Nom de la commande */
    char *nom;
/* Numero de l'environnement */
    long num_env;
/* Numero de la commande */
    long num_com;
/* si emp > 0: Commande empilable */
    long emp;
/* sem = 0 (non), 1 (oui), -1 (ni oui ni non) */
    long sem;
/* Nombre de valeurs */
    long dim;
/* Type */
    long type;
    long nb_par;
    long *p_def;
    long *p_val;
    long *param;
    long *legales;
    };

/* Structure des commandes */
/* ----------------------- */
/*    nb_com commandes
    stockees dans la structute p_com
    p_sem0 = tableau de [oui non] (valeurs par defaut)
    p_sem = tableau de [oui non]
    p_alpha = tableau des numeros alphabetiques */

struct Commandes
    {
    long nb_com;
    struct Commande *p_com;
    long *p_sem0;
    long *p_sem;
    long *p_alpha;
    };

/* Structure de message */
/* -------------------- */

struct Messages
    {
    long nb_mes;
    char **ad_mes;
    };

/* Structure des environnements */
/* ---------------------------- */

#define NB_ENV 8
#define NB_NOM 18
struct Environnement
    {
    char *env;    /* -> env[abc].h */
    long nb_nom;    /* Nombre de noms */
/* buf_nom + num * DIM0 -> nom numero num */
    char buf_nom[NB_NOM * DIM0];    /* noms */
    struct Commandes *ad_com;
    struct Messages *ad_mes;
    };

/* Structure des objets */
/* -------------------- */

struct Objet
    {
    long num;
    char *nom;
    long *bloc;
    long *param;
    short env;
    short type;
    short type2;
    short nx;
    short ny;
    short nz;
    short fermer;
    short garb1;    /* Garbage */
    struct Objet *fils;
    };

/* Debug [cm]alloc */
/* --------------- */
#define Dim_alloc 100000

/* FONCTIONS GLOBALES */
/* ================== */

/* aja.c */
/* ----- */
extern void ajdim(long);

/* chainea.c */
/* --------- */
extern long chaine(char *, long);
extern long chaineflo(char *, float);
extern long chaine_format(char *, char *, long);
extern char *lire_ligne(char *, char *);
extern char *saute_comment(char *, long *);
extern char *saute_comment_direct(char *, long *);
extern char *lire_d(long *, char *);
extern char *lire_f(long *, float **, char *);
extern char *saute_espace(char *);
extern char *saute_mot(char *);
extern long sormot_signifiant(char *, char **, long);
extern long sormot(char *, char **, long);
extern long sormot_0(char *, char **, long);
extern long sornom(char *, char **);
extern long cmp_nom(char *, char *);
extern char *avance(char *);
extern long clean_fic(char *, long);
extern char *sup_comment(char *, long *);
extern long nb_mot(char *);
long is_separateur(char);

/* codera.c */
/* -------- */
extern long coder(long, char *, char *, char *);
extern long coder_1(char *, char *, char *);
extern long coder_2(char *, char *, char *);
extern void coder_lt(char *);
extern void decoder_lt(char *);

/* coma.c */
/* ------ */
extern struct Commandes *init_com(char *, long, char *, char *);
extern long cmp_chaine(char *, char *);
extern long *gen_appel(long *, long ,
          long, long, long, float, float, float, float,
          long, long, long, float, float, float, float,
          long, long, long, float, float, float, float,
          long, long, long, float, float, float, float);
extern void gen_appel_1(long *, long, long, long, float, float, float, float);

/* compa.c */
/* ------- */
extern long compile0();
extern long compile_nom(long *);
extern long compile(struct Objet *);
extern long decompile(long *);
extern void decompile_expression(long *, long);
extern void editer_ligne_fonc(struct Objet *, long);
long set_locale(char *, long **, long **, long, long *);

/* debuga.c */
/* -------- */
long set_debug(long *);
long debugger(char *, long, long, long, long, float, float, float);
long sup_debug(long *);
long stop_a(long *);
long list_a(long *);
long go_a(long);
void editer_debug(long *);

/* demoa.c */
/* ------- */
long demoa(long *);
long lire_demo(long *);

/* diska.c */
/* ------- */
long lire_a(long *, long *);
long gare_a(long *);
long lire_texte(char *, char *, char *, long, long);
char *lire_texte_0(char *, long, long, long *);
long gare_texte(char *, char *, char *, long, long);
long ouvre(char *, char *, char *, FILE **, long);
long lire_fonc(char *, long, long, long, long);
long lire_system(long *, long *);

/* edia.c */
/* ------ */
long editer_fonction(char *);
long edi(long **, long *);

/* editera.c */
/* --------- */
long editer_datas(long *, long *, long *, long);
struct Commande *det_com(char *);
char *det_nom_2(long, long);
struct Commande *det_com_2(char *);
struct Commande *det_commande(long, long);
long *det_bloc_com(long, long);
float *det_val_com(long, long, long *);
long *det_def_com(long, long, long *);
float *get_def_com(long, long, long *);
long get_nb_com(long, long);
char *det_nom(long, long);
long editer_com_a(long *);
long generer_a(long *);
void print_nom_com(long, long);
void print_nom_com_ad(long *, long);
void editer_bug_com(long *, long);
long editer_nom_num_obj(struct Objet *);
void editer_nom_num(char *, long *, long, long);
void editer_nom_fonc_1(struct Objet *);
long ref_obj(long *, struct Objet *);
void editer_type_bloc(long *, long);
void print_num_nom(long *, long, long);
void print_temps(long);

/* enva.c */
/* ------ */
float *det_dim_env(long, long *);

/* erreura.c */
/* --------- */
void erreur_mac(long, struct Objet *, long);
long erreur_comp_link(long);
void erreur_exec(void);
long editer_ligne_macro(struct Objet *, long);
void non_trouve(struct Objet *, long, char *, long *, long, long, long);
void editer_num_nom_ind(long *, long);
void erreur_objet(struct Objet *, long, long, char *);
void objet_vide(struct Objet *);
void objet_incoherent(struct Objet *);
void objet_non_trouve(long *, long);
long debordement();
void erreur_allocation(long, long);
void erreur_lecture(char *);
void erreur_ecriture(char *);
void disque_plein();
void non_implemente();

/* esa.c */
/* ----- */
long interp(long *buf, long *p_ev);
long evaluer_mult(long *pd0);
long get_evaluation(long *p, long *type, long *n, long **pd);
long set_nil(long *p_ev, long *fin);

/* exea.c */
/* ------ */
long sortir(long *, long, long *);
long oui_non(long, long);
long deposer_valeurs(long *, long *);
long deposer_valeurs_1(long *, float);
long deposer_valeurs_2(long *, float, float);
long deposer_valeurs_3(long *, float, float, float);
long deposer_valeurs_4(long *, float, float, float, float);
long deposer_valeurs_5(long *, float, float, float, float, float);
long deposer_valeurs_6(long *, float, float, float, float, float, float);
long set_oui_non(long *, long, long *);
long set_com_0(long, long *);
long dim_dim(long *);
long var_fonc(long *);
long clean_a(long *);
long nom_a(long *, long *);
long a_type(long, long *, long *);
long set_alias(long *);
long init_fonc_type(void);
long det_alias(long *, char *, char *, char *);
long charger_float(long *, long *, long, float *);
long charger_char(long *, long *, char *);
long a_status(long *, long *);
void warning_oui_non(long, long, long);

/* fcta.c */
/* ------ */
long fct_0(long *, long *);
void limites_xyz(float *, long, long, float *);
void cg_xyz(float *, long, long, float *);
void cg_xyz_dim(long *, float *);
long arc_a(long *, long *, float *);
long alea(long);
float randf(float);
float rand2f(float, float);
long rand2(float, float);
long limite_a(long *, long *);
long sonne_a(long *);
long bye_a(long *);

/* helpa.c */
/* ------- */
long helpa(long *, char *);
void set_help(long, long);

/* inita.c */
/* ------- */
long inita(long, char **, char *);
void init_val_com(long, long);
long init_com_a(long *);
void editer_dim_a();
char *det_nom_ini();
char *det_nom_0(long, long);
char *det_nom_env();
char *det_nom_uti();
void cre_nom(char *, char *);

/* interpa.c */
/* --------- */
void func();

/* irisa.c */
/* ------- */
void lire_sysinfo(char *, long);
long time_a(long *);
void wait_a(float *);
long tempo_a(long, long);
long tempo_b(long, long);

/* linka.c */
/* ------- */
long linker0();
long linker(struct Objet *, long);

/* lirea.c */
/* ------- */
long lire_executer(long, long, long *, long);
long compiler_executer(char *);
long lire_char(char);
long history(long, long *);

/* maca.c */
/* ------ */
long evaluer_fonction(long *p0, long sem_ret);
long evaluer_formel(long *p0);

long exec_fonc_datas(long *p_fonc);
long exec_fonc_obj(struct Objet *p_obj);

/* mata.c */
/* ------ */
void matrice_identite(float m[4][4]);
void matrice_produit(float m1[4][4], float m2[4][4], float m3[4][4]);
void matrice_dila(float m[4][4], float *pf);
void matrice_rotx(float m[4][4], float a);
void matrice_roty(float m[4][4], float a);
void matrice_rotz(float m[4][4], float a);
void matrice_vec3(float m[4][4], float *v1, float *v2);
void matrice_vec4(float m[4][4], float *v1, float *v2);

/* matha.c */
/* ------- */
long troncation(float);
/*???void trans(float, float, float, float *);???*/
void rotx_a(float *, float);
void rotx_cs(float *, float, float);
void roty_a(float *, float);
void roty_cs(float *, float, float);
void rotz_a(float *, float);
void rotz_cs(float *, float, float);
void dilx_a(float *, float);
void dily_a(float *, float);
void dilz_a(float *, float);
void dila_a(float *, float *);
void dila_poi(float *, float, float, float, float *);
void hom_a(float *, float);
void mat_mat(float *, float *, float *);
long mat_mat_n(float *, float *, float *, long, long, long, long);
void mat_vec(float *, float *, float *);
void mat_vec3(float *, float *, float *);
float pro_scal(float *, float *);
float pro_scal_unit(float *, float *);
void pro_vec(float *, float *, float *);
void pro_vec_som(float *, float *, float *, float *, float *);
void unitaire(float *, float *);
void unitaire_vec(float *, float *, float *);
float pseudo_distance(float *, float *);
double distance2(float *, float *);
float distance_point_segment(float *, float *, float *);
double distance(float *, float *);
float module(float *);
void unit_mat(float *);
void inv_mat(float *, float *);
void cos_sin_som(float *, float *, float *, float *, float *, float *, float *);
double angle(float *, float *);
float distance2_point_droite(float *, float *, float, float, float);
double proj_point_droite(float *, float *, float, float, float, float *);
void rotx_poi(float *, float, float *);
void roty_poi(float *, float, float *);
void rotz_poi(float *, float, float *);
long trier(long *);
float puissance(float, long);
float a_powf(float, float);
float max_val(float *, long, long);
void normer(float *, float);

/* mesa.c */
/* ------ */
struct Messages *init_mes(char *, long, char *, char *);
long message(long, long);
char *det_message(long, long);
long message_a(long *);
void sonner();

/* obja.c */
/* ------ */
long *cre_bloc(long);
struct Objet *cre_obj(long, long, long, long *, char *, long);
struct Objet *cre_obj_num_nom(long, long, long *, long);
struct Objet *dup_obj(struct Objet *);
long *cre_ad_bloc(struct Objet *, long);
void set_bloc_type_1(long *, long, long);
void set_bloc_type_2(long *, long, long, long, long);
void set_bloc_type_3(long *, long, long, long, long, long, long);
void set_bloc_type_4(long *, long, long, long, long, long, long, long, long);
void set_bloc_type_5(long *, long, long, long, long, long, long, long, long, long, long);
void set_bloc_type_6(long *, long, long, long, long, long, long, long, long, long, long, long, long);
void set_bloc_type_n(long *, long, long, long, long, long, long, long, long, long);
void set_bloc_type_ad(long *, long, long *);
long *etendre_bloc(long *, long);
long *etendre_bloc_0(long *, long, long);
long ajou_ad(struct Objet *, long *);
long det_num(long *, long);
struct Objet *get_obj(long, long, long *, long);
struct Objet *get_obj2(long, long, long *, long);
struct Objet *det_mac(char *);
struct Objet *resout_obj(struct Objet *);
long *det_bloc_1(long *, long, long);
long *det_bloc_2(long *, long, long, long, long);
long *det_bloc_3(long *, long, long, long, long, long, long);
long *det_bloc_4(long *, long, long, long, long, long, long, long, long);
long *det_bloc_5(long *, long, long, long, long, long, long, long, long, long, long);
long *det_bloc_6(long *, long, long, long, long, long, long, long, long, long, long, long, long);
long *det_bloc_n(long *, long, long, long, long, long, long, long, long, long);
long *det_bloc_type(long *, long, long *);
long *det_bloc_type(long *, long, long *);
long *det_bloc_ad_1(long *, long *, long, long);
long *det_bloc_ad_2(long *, long *, long, long, long, long);
long *det_bloc_ad_3(long *, long *, long, long, long, long, long, long);
long *det_bloc_ad_4(long *, long *, long, long, long, long, long, long, long, long);
long *det_bloc_ad_5(long *, long *, long, long, long, long, long, long, long, long, long, long);
long *det_bloc_ad_6(long *, long *, long, long, long, long, long, long, long, long, long, long, long, long);
long *det_bloc_ad_n(long *, long *, long, long, long, long, long, long, long, long, long);
long *det_bloc_ad_type(long *bloc, long *ad, long n, long *pd);
long *gen_bloc_1(struct Objet *, long, long, long *, long);
long *gen_bloc_2(struct Objet *, long, long, long, long, long *, long);
long *gen_bloc_3(struct Objet *, long, long, long, long, long, long, long *, long);
long *det_datas_1(long *, long, long);
long *det_datas_2(long *, long, long, long, long);
long *det_datas_3(long *, long, long, long, long, long, long);
long *det_datas_4(long *, long, long, long, long, long, long, long, long);
long *det_datas_5(long *, long, long, long, long, long, long, long, long, long, long);
long *det_datas_6(long *, long, long, long, long, long, long, long, long, long, long, long, long);
long *det_datas_n(long *, long, long, long, long, long, long, long, long, long);
char *det_nom_mac(struct Objet *);
char *det_nom_mac_bloc(long *);
long cmp_num_nom(long *, long *);
long det_num_nom(long *, long, long *, char **);
long min_num(long, long);
long max_num(long, long);
void sup_objet(long, long, long, char *);
void sup_obj(struct Objet *);
void sup_obj_num(long, long);
void sup_obj_types_num(long, long, long);
void sup_tout_obj(long, long);
long sup_bloc(long *);
long sup_bloc_obj_1(struct Objet *, long, long, long);
long sup_bloc_obj_2(struct Objet *, long, long, long, long, long);
long sup_bloc_obj_3(struct Objet *, long, long, long, long, long, long, long);
long sup_bloc_obj_4(struct Objet *, long, long, long, long, long, long, long, long, long);
long sup_bloc_obj_5(struct Objet *, long, long, long, long, long, long, long, long, long, long, long);
long sup_bloc_obj_6(struct Objet *, long, long, long, long, long, long, long, long, long, long, long, long, long);
long sup_bloc_obj_n(struct Objet *, long, long, long, long, long, long, long, long, long, long);
long sup_bloc_ad(struct Objet *, long, long, long *);
void free_a(long *);
void free_1(char *);
long *dup_bloc(long *);
void copier_bloc(long *, long *);
long ajouter_bloc(long *, long *, long *, long);
long copier_bloc_type(long *, long *);
long meme_num(struct Objet *, long *);
long set_nom_num(struct Objet *, long *);
long set_nom_num_obj(struct Objet *, struct Objet *);
long set_bloc_0(long *, long *, long);
long set_bloc_num(long *, long, long *, long, long);
void zer(long *);
void zer_1(long *);
long *hybrider(long *, long **);
long hybride_bloc(long *, long *);
long ajou_datas(long *, long *, long *);
long *reformater_bloc(long *, long, long **);
long renommer_obj(struct Objet *, long *);
long *restituer_bloc(struct Objet *, long, long);
long *ajou_bloc(struct Objet *, long);
struct Objet *det_var_loc(char *);
char *det_nom_obj(struct Objet *);
long *det_datas_type(long *, long, long *);
long *det_datas_num(long *, long, long *, long *);
float *det_float(long *, long, long *);
float *det_datas_float(long *, long *);
long meme_type(long *, long *);
long identique_type(long *, long *);
struct Objet *det_obj(long, long, long, char *);
long *propr_2(struct Objet *, long, long, long, long, long);

/* passea1.c */
/* --------- */
long compile_passe_1(struct Objet *, long *, long *, long *);
char *set_define(long **, long **, char *, long);
char *code_num_ligne(char *, char *, long);
long decode_num_ligne(char *);

/* passea2.c */
/* --------- */
long complete_priorite(long *, long *, long *, long *, long *);
long formater_bloc(long **, long **, long *);
long *get_separateur(long *, long);
long *set_separateur(long *, long *, long);
long is_operateur(long *);
long *sauter_ligne(long *);
long *fin_expression(long *);
long *fin_expression_2(long *);
long *fin_parenthese(long *);
void insert_sep(long *, long *, long);
void insert_zer(long *, long *);
long *encadrer_parenthese(long *, long *, long *, long **, long *, long *);

/* passea3.c */
/* --------- */
long set_parenthese(long *, long *, long *);

/* supa.c */
/* ------ */
long sup_com_a(long *);
long dup_a(long *);

/* uta.c */
/* ----- */
long evaluer_indice(long *p1, long *p2, long *p3, long *fin);
long sep_fermer(long sep_deb);
long generer_indice(long *p_ind, long *p0);

/* Prototypes */
/* ========== */

/*
n = pd0[2];
pd = pd0 + DIM_TETE;
while (n-- > 0)
    {
    switch (pd[1])
        {
        case 0:
            switch (pd[2])
                {
                }
            break;
        case 1:
            switch (pd[2])
                {
                }
            break;
        default:
            return(pd[1]);
        }
    pd += *pd;
    }
*/

/* END */
