2000-07-28 17:39:02 +02:00
|
|
|
|
#ifndef _LIBVER
|
|
|
|
|
#define _LIBVER
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
typedef int VERT_Info;
|
|
|
|
|
|
|
|
|
|
#define VERD_VERSION 1
|
|
|
|
|
#define VERD_TAG 2
|
|
|
|
|
#define VERD_SRCFILE 3
|
|
|
|
|
#define VERD_AUTHOR 4
|
|
|
|
|
|
|
|
|
|
typedef int VERT_Print_Mode;
|
|
|
|
|
|
|
|
|
|
#define VERD_VERBOSE 1
|
|
|
|
|
#define VERD_MINIMAL 2
|
|
|
|
|
|
|
|
|
|
typedef int VERT_Status;
|
|
|
|
|
|
|
|
|
|
#define VER_ERROR(s) (s < 0) /* Tous les codes retour n<>gatifs correspondent <20> des erreurs */
|
|
|
|
|
|
|
|
|
|
#define VERS_OK 1
|
|
|
|
|
#define VERS_KO 0
|
|
|
|
|
#define VERS_ERRMEM -1 /* Probl<62>me d'allocation m<>moire */
|
|
|
|
|
#define VERS_ERRAPI -2 /* Utilisation incorrecte des API */
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
char * name;
|
|
|
|
|
char * version;
|
|
|
|
|
char * tag;
|
|
|
|
|
char * srcfile;
|
|
|
|
|
char * author;
|
|
|
|
|
} VERT_Info_Container;
|
|
|
|
|
|
|
|
|
|
typedef VERT_Info_Container * VERT_Fcn (void);
|
|
|
|
|
|
2003-01-17 08:52:42 +01:00
|
|
|
|
typedef struct _link_map VERT_Object;
|
2000-07-28 17:39:02 +02:00
|
|
|
|
|
|
|
|
|
typedef unsigned int VERT_Index;
|
|
|
|
|
|
|
|
|
|
#define VER_FCN_NAME "VER_Info_Export"
|
|
|
|
|
|
|
|
|
|
#define INIT(x) VERT_Info_Container * Container; VER_Info_Init (&Container, x);
|
|
|
|
|
#define VERSION(x) if (Container) VER_Info_Set(Container,VERD_VERSION, x);
|
|
|
|
|
#define TAG(x) if (Container) VER_Info_Set(Container,VERD_TAG, x);
|
|
|
|
|
#define SRCFILE(x) if (Container) VER_Info_Set(Container,VERD_SRCFILE, x);
|
|
|
|
|
#define AUTHOR(x) if (Container) VER_Info_Set(Container,VERD_AUTHOR, x);
|
|
|
|
|
#define VER_INFO_EXPORT(obj,ver,tag,file,author) \
|
|
|
|
|
VERT_Info_Container * VER_Info_Export_##obj (void); \
|
|
|
|
|
VERT_Info_Container * VER_Info_Export_##obj (void) \
|
|
|
|
|
{ \
|
|
|
|
|
INIT(#obj) \
|
|
|
|
|
VERSION(ver) \
|
|
|
|
|
TAG(tag) \
|
|
|
|
|
SRCFILE(file) \
|
|
|
|
|
AUTHOR(author) \
|
|
|
|
|
return (Container); \
|
|
|
|
|
}
|
|
|
|
|
|
2003-01-17 18:00:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-07-28 17:39:02 +02:00
|
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Affichage des informations export<72>es par l'objet courant */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Stream : pointeur sur le flux de sortie */
|
|
|
|
|
/* (I) Mode : mode d'affichage */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
VERT_Status VER_Object_Print (FILE * Stream, VERT_Print_Mode Mode);
|
|
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* R<>cup<75>ration d'un conteneur d'informations */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* (O) Container : adresse d'un pointeur sur le conteneur d'informations */
|
|
|
|
|
/* (I) Object : objet dans lequel on effectue la recherche */
|
|
|
|
|
/* (I) Index : pointeur d'index <20> partir duquel on effectue la recherche */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
VERT_Status VER_Info_Next_Get (VERT_Info_Container ** Container, VERT_Object * Object, VERT_Index * Index);
|
|
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Affichage des informations d'un conteneur */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Stream : pointeur sur le flux de sortie */
|
|
|
|
|
/* (I) Container : pointeur sur le conteneur d'informations */
|
|
|
|
|
/* (I) Mode : mode d'affichage */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
VERT_Status VER_Info_Print (FILE * Stream, VERT_Info_Container * Container, VERT_Print_Mode Mode);
|
|
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Cr<43>ation d'un conteneur d'informations */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* (O) Contanier : adresse d'un pointeur sur le container <20> cr<63>er */
|
|
|
|
|
/* (I) Object_Name : nom de l'objet */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
VERT_Status VER_Info_Init (VERT_Info_Container ** Container, const char * Object_Name);
|
|
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Mise <20> jour d'une information */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Container : pointeur sur le conteneur d'informations */
|
|
|
|
|
/* (I) Info_Type : type d'information <20> mettre <20> jour */
|
|
|
|
|
/* (I) Value : valeur de l'information */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
VERT_Status VER_Info_Set (VERT_Info_Container * Container, VERT_Info Info_Type, const char * Value);
|
|
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Effacement d'une information */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Container : pointeur sur le conteneur d'informations */
|
|
|
|
|
/* (I) Info_Type : type d'information <20> effacer */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
VERT_Status VER_Info_Clean (VERT_Info_Container * Container, VERT_Info Info_Type);
|
|
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* Destruction d'un container d'informations */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
/* (I) Container : pointeur sur le conteneur d'informations */
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
VERT_Status VER_Info_End (VERT_Info_Container * Container);
|
|
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
|
2003-01-17 18:00:58 +01:00
|
|
|
|
# ifdef __cplusplus
|
2000-07-28 17:39:02 +02:00
|
|
|
|
}
|
2003-01-17 18:00:58 +01:00
|
|
|
|
# endif
|
2000-07-28 17:39:02 +02:00
|
|
|
|
|
|
|
|
|
#endif
|