feat: Première implémentation de bindings pour FSV SESAM-Vitale

- Création de la crates/fsv-sys
- Ajout des headers de la FSV 1.40.14.13 dans crates/fsv-sys/vendor
- Génération des bindings depuis ces headers avec bindgen
- Implémentation d'une structure de loading de la librairie au runtime
- Implémentation d'une macro permettant de générer facilement la couche d'accès aux fonctions de la librairie
This commit is contained in:
2024-09-29 12:44:57 +02:00
parent 345190dfeb
commit c549f7def5
21 changed files with 2384 additions and 48 deletions

View File

@ -0,0 +1,189 @@
/*---------------------------------------------------------------------------
PROJET : Couche de portabilite multi-systeme
PLATE-FORME: LINUX
MODULE : Definition des macros et des types utilises par la couche
d'abstraction systeme pour la plate-forme LINUX.
Le fichier de definition des types portable (ce fichier) doit
etre inclus avant tout autre .h de definitions d'APIS gip-cps.
Ce fichier definit tous les types et macros dependants du
systeme.
FICHIER : common\linux\src\linuxdef.h
VERSION : 1.00
DATE : 10/01/2001
AUTEUR : ALVARO ROCHA
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Modifications: (nouvelle version, date, auteur, explication)
...
- V4.31 - AROC le 12/02/2001 :
Ajout des #define TRUE et FALSE ainsi que le typedef int BOOLEEN
-----------------------------------------------------------------------------
---------------------------------------------------------------------------*/
#ifndef __CPSCASDF_H
#define __CPSCASDF_H
/*----------------- definition des macros portables ------------------------*/
#ifndef far
#define far
#endif
#ifndef FAR
#define FAR
#endif
#ifndef PTR
#define PTR *
#endif
#ifndef PVOID
#define PVOID void PTR
#endif
#ifndef FARPTR
#define FARPTR PTR
#endif
#ifndef FPVOID
#define FPVOID void FARPTR
#endif
/* AROC 12/02/2001 debut : */
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
/* AROC 12/02/2001 fin */
/*----------------- definition des types portables ------------------------*/
#ifndef CHAR
#define CHAR char
#endif
#ifndef PCHAR
#define PCHAR CHAR PTR
#endif
#ifndef PSTRG
#define PSTRG CHAR PTR
#endif
#ifndef UCHAR
#define UCHAR unsigned char
#endif
#ifndef PUCHAR
#define PUCHAR UCHAR PTR
#endif
#ifndef INT8
#define INT8 char
#endif
#ifndef INT16
#define INT16 short
#endif
#ifndef INT32
#define INT32 long
#endif
#ifndef PINT8
#define PINT8 INT8 PTR
#endif
#ifndef PINT16
#define PINT16 INT16 PTR
#endif
#ifndef PINT32
#define PINT32 INT32 PTR
#endif
#ifndef UINT8
#define UINT8 unsigned char
#endif
#ifndef UINT16
#define UINT16 unsigned short
#endif
#ifndef UINT32
#define UINT32 unsigned long
#endif
#ifndef PUINT8
#define PUINT8 UINT8 PTR
#endif
#ifndef PUINT16
#define PUINT16 UINT16 PTR
#endif
#ifndef PUINT32
#define PUINT32 UINT32 PTR
#endif
/* 11/02/1997 : Ajout DRE pour CPSCAS */
#ifndef VOID
#define VOID void
#endif
#ifndef PSTR
#define PSTR char PTR
#endif
/* 11/02/1997 : Fin */
#ifndef WORD
#define WORD unsigned short
#endif
#ifndef DWORD
#define DWORD unsigned long
#endif
//typedef unsigned char BYTE;
#ifndef BYTE
#define BYTE unsigned char
#endif
//typedef BYTE far * LPBYTE;
#ifndef LPBYTE
#define LPBYTE BYTE far *
#endif
//typedef int BOOL;
#ifndef BOOL
#define BOOL int
#endif
#ifndef Unref
#define Unref( a) a=a
#endif
#ifndef min
#define min(a,b) ((a)>(b)?(b):(a))
#endif
#ifndef max
#define max(a,b) ((a)<(b)?(b):(a))
#endif
/* Taille maximale allou<6F>e par la fonction "malloc" */
#ifndef MAXBLOC
#define MAXBLOC 4294967295
#endif
#endif

View File

@ -0,0 +1,85 @@
/*
* -------------------------------------------------------------------
* (c) 2002 GIE SESAM-VITALE
*
* FICHIER : sys_def.h (v2)
*
* PLATE-FORME : Windows 32 bits
*
* D<>finitions d<>pendantes du syst<73>me.
* -------------------------------------------------------------------
*/
#include "linuxdef.h"
#include "stdlib.h"
#ifndef __SYS_DEF_H__
#define __SYS_DEF_H__
#ifdef __cplusplus
extern "C" {
#endif
#ifndef API_ENTRY
#define API_ENTRY
#endif
#ifndef _MAX_PATH
#define _MAX_PATH 256
#endif
#ifndef _MAX_FNAME
#define _MAX_FNAME 160
#endif
#ifndef _MAX_DIR
#define _MAX_DIR 800
#endif
#ifndef FARPTR
#define FARPTR *
#endif
#ifndef SYS_MAX_PATH
#define SYS_MAX_PATH _MAX_PATH
#endif
#ifndef SYS_MAX_FNAME
#define SYS_MAX_FNAME _MAX_FNAME
#endif
#ifndef SYS_MAX_DIR
#define SYS_MAX_DIR _MAX_DIR
#endif
#ifndef SYS_HANDLE
#define SYS_HANDLE void *
#endif
#ifndef PTR
#define PTR *
#endif
#ifndef SYSFARPROC_
#define SYSFARPROC_
typedef unsigned short (API_ENTRY FARPTR SYSFARPROC)();
#endif
/* S<>parateur utilis<69> dans le nommage des arborescences de fichiers */
#ifndef SEPARATEUR_REPERTOIRE
#define SEPARATEUR_REPERTOIRE '/'
#endif
/* Activation des fonctions simplifi<66>es. */
#ifndef SGD
#define SGD
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,92 @@
/*
* -------------------------------------------------------------------
* (c) 2002 GIE SESAM-VITALE
*
* FICHIER : sys_def.h (v2)
*
* PLATE-FORME : MAC OSX
*
* D<>finitions d<>pendantes du syst<73>me.
* -------------------------------------------------------------------
*/
//3/11/2004 Modification pour compilation MAC OS X
#include "osxdef.h"
#include <stdarg.h>
#include <errno.h>
#include "stdlib.h"
#ifndef __SYS_DEF_H__
#define __SYS_DEF_H__
#ifdef __cplusplus
extern "C" {
#endif
//3-11-2004 Ajout pour MAc OS X
#define FALSE 0
#define TRUE 1
//3/11/2004 Modification pour compilation MAC OS X
#ifndef API_ENTRY
#define API_ENTRY
#endif
#ifndef FARPTR
#define FARPTR *
#endif
#ifndef SYS_MAX_PATH
#define SYS_MAX_PATH _MAX_PATH
#endif
#ifndef SYS_MAX_FNAME
#define SYS_MAX_FNAME _MAX_FNAME
#endif
#ifndef SYS_MAX_DIR
#define SYS_MAX_DIR _MAX_DIR
#endif
#ifndef PTR
#define PTR *
#endif
#ifndef SYS_HANDLE
//typedef void * SYS_HANDLE;
#define SYS_HANDLE void *
#endif
#ifndef SYSFARPROC_
#define SYSFARPROC_
typedef unsigned short (API_ENTRY FARPTR SYSFARPROC)();
#endif
/* S<>parateur utilis<69> dans le nommage des arborescences de fichiers */
#ifndef SEPARATEUR_REPERTOIRE
#ifdef WIN32
#define SEPARATEUR_REPERTOIRE '\\'
#else
#define SEPARATEUR_REPERTOIRE '/'
#endif
#endif
/* Activation des fonctions simplifi<66>es. */
#ifndef SGD
#define SGD
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,150 @@
/*---------------------------------------------------------------------------
PROJET : Couche de portabilite multi-systeme
PLATE-FORME: MAC OS X
MODULE : Definition des macros et des types utilises par la couche
d'abstraction systeme pour la plate-forme LINUX.
Le fichier de definition des types portable (ce fichier) doit
etre inclus avant tout autre .h de definitions d'APIS gip-cps.
Ce fichier definit tous les types et macros dependants du
systeme.
FICHIER : common\linux\src\linuxdef.h
VERSION : 1.00
DATE : 10/01/2001
AUTEUR : ALVARO ROCHA
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Modifications: (nouvelle version, date, auteur, explication)
...
- V4.31 - AROC le 12/02/2001 :
Ajout des #define TRUE et FALSE ainsi que le typedef int BOOLEEN
-----------------------------------------------------------------------------
---------------------------------------------------------------------------*/
#ifndef __CPSCASDF_H
#define __CPSCASDF_H
//#ifndef __MACTYPES__
/*#include <CarbonCore/MacTypes.h>*/
//#include"/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/MacTypes.h"*/
//#endif
/*----------------- definition des macros portables ------------------------*/
/* point d'entree exporte en DLL ????????????????????????????????????????? */
#define API_ENTRY /* pour l'instant */
#define far
#define FAR
#define PTR *
#define PVOID void PTR
#ifndef FARPTR
#define FARPTR PTR
#endif
#define FPVOID void FARPTR
/* AROC 18/O4/2001 ajout pour io_comm*/
#define HCOMM unsigned int
#define PHCOMM HCOMM FARPTR
/* AROC 12/02/2001 debut : */
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
/* AROC 12/02/2001 fin */
/*----------------- definition des types portables ------------------------*/
/* AROC 12/02/2001 debut : */
/* mise en commentaire de ce define car pb avec module sts où BOOLEEN est defini en char*/
//#ifndef BOOLEEN
//typedef int BOOLEEN;
//#define BOOLEEN int
//#endif
/* AROC 12/02/2001 fin */
/* Boolean */
#define BOOL Boolean
//#define _MAX_PATH 1024
typedef char CHAR;
typedef CHAR PTR PCHAR;
typedef CHAR PTR PSTRG;
typedef unsigned char UCHAR;
typedef UCHAR PTR PUCHAR;
typedef char INT8;
typedef short INT16;
typedef long INT32;
typedef INT8 PTR PINT8;
typedef INT16 PTR PINT16;
typedef INT32 PTR PINT32;
typedef unsigned char UINT8;
typedef unsigned short UINT16;
typedef unsigned long UINT32;
typedef UINT8 PTR PUINT8;
typedef UINT16 PTR PUINT16;
typedef UINT32 PTR PUINT32;
/* 11/02/1997 : Ajout DRE pour CPSCAS */
typedef void VOID;
typedef char PTR PSTR;
/* 11/02/1997 : Fin */
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef unsigned char BYTE;
typedef BYTE far * LPBYTE;
#define Unref( a) a=a
#ifndef min
#define min(a,b) ((a)>(b)?(b):(a))
#endif
#ifndef max
#define max(a,b) ((a)<(b)?(b):(a))
#endif
#ifdef LITTLE_ENDIAN
#undef LITTLE_ENDIAN
#endif
#ifndef PATH_MAX
#define PATH_MAX 1024
#endif
#ifndef _MAX_PATH
#define _MAX_PATH PATH_MAX /* PATH_MAX defini dans <usr/include/sys/syslimits.h> */
#endif
/* Taille maximale allouÈe par la fonction "malloc" */
#ifndef MAXBLOC
#define MAXBLOC 0x7FFFFFFF
#endif
#endif

View File

@ -0,0 +1,69 @@
/*
* -------------------------------------------------------------------
* (c) 2002 GIE SESAM-VITALE
*
* FICHIER : sys_def.h (v2)
*
* PLATE-FORME : Windows 32 bits
*
* D<>finitions d<>pendantes du syst<73>me.
* -------------------------------------------------------------------
*/
#include <stdlib.h>
#ifndef __SYS_DEF_H__
#define __SYS_DEF_H__
#ifdef __cplusplus
extern "C" {
#endif
#ifndef API_ENTRY
#define API_ENTRY __stdcall
#endif
#ifndef FARPTR
#define FARPTR *
#endif
#ifndef SYS_MAX_PATH
#define SYS_MAX_PATH _MAX_PATH
#endif
#ifndef SYS_MAX_FNAME
#define SYS_MAX_FNAME _MAX_FNAME
#endif
#ifndef SYS_MAX_DIR
#define SYS_MAX_DIR _MAX_DIR
#endif
typedef void * SYS_HANDLE;
#ifndef PTR
#define PTR *
#endif
typedef unsigned short (API_ENTRY FARPTR SYSFARPROC)();
/* S<>parateur utilis<69> dans le nommage des arborescences de fichiers */
#ifndef SEPARATEUR_REPERTOIRE
#define SEPARATEUR_REPERTOIRE '\\'
#endif
/* Activation des fonctions simplifi<66>es. */
#ifndef SGD
#define SGD
#endif
#ifdef __cplusplus
}
#endif
#endif