How to play this Delphi code in Python or C

0

I'm developing a software for a ratchet, in the archives of it comes an example of the use of the DLL functions of it, however it is in Delphi. The following function gets a pointer to a structure called CONVFILEFORMAT FAR pF *, this structure is done in Delphi and I need to turn this into Python or C , I know that Python has no equivalent structure to C but I'm using Ctypes .

The prototype of the function that needs struct

int FAR PASCAL FXPBasicConvFromText(const char FAR* szFileOrig, const char FAR* szFileDest,
CONVFILEFORMAT FAR* pF);
const char FAR* szFileOrig, - Nome do arquivo origem a ser convertido
const char FAR* szFileDest, - Nome do arquivo destino a ser gerado
CONVFILEFORMAT FAR* pF - Ponteiro p/ estrutura com formato arquivo origem

Looking at the example code made in Delphi , I have the following structure.

{-------------------------------------------------------------------------------
 Estrutura Descritora de Formato de Arquivo a ser Gerado pelas Conversoes
-------------------------------------------------------------------------------}
type
   CONVFILEFIELD = record
      cName:   array[0..10] of Char;            { nome do campo }
      cType:   Byte;                            { tipo do campo }
      cLength: Byte;                            { tamanho do campo }
      cDec:    Byte;                            { numero de casas decimais }
end;

type
   PCONVFILEFORMAT = ^CONVFILEFORMAT;
   CONVFILEFORMAT = record
      cFields: Byte;                            { numero de campos }
      Field:  array[0..9] of CONVFILEFIELD;     { campos }
end;

I need to convert it to C or Python , I do not have a minimum knowledge of in> Delphi .

    
asked by anonymous 19.10.2018 / 13:26

0 answers