fpc/utils/h2pas
2023-11-08 23:29:02 +01:00
..
fpmake.pp * Rework so scanner & lexer files do not contain actual code. Code is moved to scanbase and h2pbase units 2023-11-08 23:29:02 +01:00
h2pas.pas * Rework so scanner & lexer files do not contain actual code. Code is moved to scanbase and h2pbase units 2023-11-08 23:29:02 +01:00
h2pas.y * Rework so scanner & lexer files do not contain actual code. Code is moved to scanbase and h2pbase units 2023-11-08 23:29:02 +01:00
h2paschk.pas Use %X instead of %x for C hexadecimal constants as Free Pascal hexstr uses uppercase characters A to F for values 10 to 15 2019-05-06 10:17:10 +00:00
h2paspp.pas
h2pbase.pp * Rework so scanner & lexer files do not contain actual code. Code is moved to scanbase and h2pbase units 2023-11-08 23:29:02 +01:00
h2pconst.pas * Rework so scanner & lexer files do not contain actual code. Code is moved to scanbase and h2pbase units 2023-11-08 23:29:02 +01:00
h2plexlib.pas
h2poptions.pas * Rework so scanner & lexer files do not contain actual code. Code is moved to scanbase and h2pbase units 2023-11-08 23:29:02 +01:00
h2pout.pp * Rework so scanner & lexer files do not contain actual code. Code is moved to scanbase and h2pbase units 2023-11-08 23:29:02 +01:00
h2pparse.pp * Rework so scanner & lexer files do not contain actual code. Code is moved to scanbase and h2pbase units 2023-11-08 23:29:02 +01:00
h2ptypes.pas * Rework so scanner & lexer files do not contain actual code. Code is moved to scanbase and h2pbase units 2023-11-08 23:29:02 +01:00
h2pyacclib.pas
Makefile Add aarch64-iphonesim target 2023-11-08 23:28:52 +01:00
Makefile.fpc * trunk to 3.3.1 2018-08-18 15:47:44 +00:00
Makefile.fpc.fpcmake
README.txt
scan.l * Rework so scanner & lexer files do not contain actual code. Code is moved to scanbase and h2pbase units 2023-11-08 23:29:02 +01:00
scan.pas * Rework so scanner & lexer files do not contain actual code. Code is moved to scanbase and h2pbase units 2023-11-08 23:29:02 +01:00
scanbase.pp * Rework so scanner & lexer files do not contain actual code. Code is moved to scanbase and h2pbase units 2023-11-08 23:29:02 +01: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 !