[fpc-pascal] h2pas and implicit types

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Sep 8 19:46:03 CEST 2006


I'm currently working on a h2pas gui for lazarus.
(lazarus/components/h2pas/h2paswizard.lpk).

h2pas does not translate every c 'sugar'. 


1. Example

#define MPI_ARGV_NULL (char **)0

One translation could be:
const MPI_ARGV_NULL: PPChar = nil;

What is the best way to handle this? In h2pas, or with a simple 'search
and replace'?


2. Example

#define MPI_ARGVS_NULL (char ***)0

This needs a new type PPPChar. One translation could be:
type PPPChar = ^PPChar;
const MPI_ARGVS_NULL: PPPChar = nil;

Will it be difficult to add this feature to h2pas? Or is there a
better/easier way?


3. Example

int MPI_Group_range_incl(MPI_Group, int, int [][3], MPI_Group *);

This function defines an implicit type 'int [][3]'.
One translation is
type
  TIntArray3 = array[0..2] of integer;
  TIntPtrArray3 = ^TIntArray3;
  PMPI_Group = ^MPI_Group;
function MPI_Group_range_incl(p1: MPI_Group; p2: int; p3:
TIntPtrArray3; p4: PMPI_Group); external;

Will it be difficult to add this to h2pas?


Mattias



More information about the fpc-pascal mailing list