fpc/utils/h2pas
pierre e1b53067a6 Merge commit 48814:
------------------------------------------------------------------------
r48814 | pierre | 2021-02-26 17:15:30 +0000 (Fri, 26 Feb 2021) | 1 line

 Do not add libgcc directory to library directories with -Fl option if -Xd option is used
------------------------------------------------------------------------

------------------------------------------------------------------------
r42843 | pierre | 2019-08-26 21:41:41 +0000 (Mon, 26 Aug 2019) | 1 line

 Partial update for go32v2 and sources
------------------------------------------------------------------------
--- Merging r44112 into '.':
G    installer/install.dat
--- Recording mergeinfo for merge of r44112 into '.':
 G   .
------------------------------------------------------------------------
r48836 | hajny | 2021-02-28 02:08:17 +0000 (Sun, 28 Feb 2021) | 1 line

  * package tplylib added, corrections for more than 31 items on a tab
------------------------------------------------------------------------
--- Merging r48836 into '.':
G    installer/install.dat
--- Recording mergeinfo for merge of r48836 into '.':
 G   .
------------------------------------------------------------------------
r49035 | pierre | 2021-03-22 23:26:26 +0000 (Mon, 22 Mar 2021) | 1 line

 Try to fix short package name issues in install.dat and add missing go32v2 packages
------------------------------------------------------------------------
--- Merging r49035 into '.':
G    installer/install.dat
--- Recording mergeinfo for merge of r49035 into '.':
 G   .

git-svn-id: branches/fixes_3_2@49041 -
2021-03-23 23:59:37 +00:00
..
converu.pas
fpmake.pp Merge commit 48814: 2021-03-23 23:59:37 +00:00
h2pas.pas
h2pas.y
h2paspp.pas
h2plexlib.pas
h2poptions.pas
h2pyacclib.pas
Makefile Regenerate all Makefile's after ios introduction and macos->macosclassic changes inside utils/fpcm/fpcmake.ini 2020-09-23 09:47:20 +00:00
Makefile.fpc * fixes to 3.2.1 2020-06-20 16:47:24 +00:00
Makefile.fpc.fpcmake
README.txt
scan.l
scan.pas
testit.h
yylex.cod
yyparse.cod

This is the h2pas program, a utility to convert C header files to pascal
units. It is part of the Free Pascal distribution.

COMPILING

To compile the program, a simple
 'make' 
should be sufficient; you need GNU make for this. When using TP, a simple
  tpc h2pas.pas
should also be possible. 

USAGE

h2pas [-p] [-t] [-o outputfilename] [-l libname] [-u unitname] filename

-t : Prepend 'T' to all type names in typedef definitions. This may help
     when the C header use uppercase types and lowercase variables of the
     same name.

-p : Use 'P' instead of ^ as a pointer symbol;
     This will convert 
        ^char to pchar
        ^longint to plongint 
     etc. It will also define a PSOMETYPE pointer for each SOMETYPE struct type 
     definition in the header file.
     Thus 
     typedef struct somestruct {
       ...
     }
     Will be converted to
     somestruct = record
       ...
     end;
     PSomestruct = ^Somestruct;
     If the -t options is used, the -p option takes care of that too.

-l : In the implementation part, the external functions will be
     written with 'external libname;' behind it.
     If you omit this option, all functions will be declared as 
     cdecl; external; 

-o : specify the outputname. By default, the inputname is used, with
     extension '.pp'.

-u : Specify the unit name. By default, the outputname is used, without
     extension.

-v : Replaces pointer types in parameter list by call by reference
     parameters:
        void p(int *i)  =>   procedure p(var i : longint);

Enjoy !