fpc/utils/h2pas
pierre 93c1c74e02 * Update Makefiles
git-svn-id: trunk@14382 -
2009-12-10 08:26:29 +00:00
..
converu.pas
h2pas.pas * output style more like the coding style fpc sources commonly are using 2009-10-09 12:57:50 +00:00
h2pas.y * output style more like the coding style fpc sources commonly are using 2009-10-09 12:57:50 +00:00
h2paspp.pas
h2plexlib.pas * renamed lexlib and yacclib units to avoid name clashes with that ones from tply 2008-06-12 21:40:10 +00:00
h2poptions.pas * more naming duplicate unit names solved, reason is that COMPILER_UNITTARGETDIR used with make all requires this (all units end in one directory) 2008-06-12 21:51:35 +00:00
h2pyacclib.pas * renamed lexlib and yacclib units to avoid name clashes with that ones from tply 2008-06-12 21:40:10 +00:00
Makefile * Update Makefiles 2009-12-10 08:26:29 +00:00
Makefile.fpc * more naming duplicate unit names solved, reason is that COMPILER_UNITTARGETDIR used with make all requires this (all units end in one directory) 2008-06-12 21:51:35 +00:00
README.txt * added .txt extensions to all README, TODO and COPYING files 2009-02-28 17:34:08 +00:00
scan.l * support LL as int number postfix 2009-10-09 12:07:36 +00:00
scan.pas * support LL as int number postfix 2009-10-09 12:07:36 +00:00
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 !