fpc/utils/h2pas
2006-10-18 18:38:19 +00:00
..
converu.pas * patch from J. Peter Mugaas to fix #7616 2006-10-16 21:34:34 +00:00
h2pas.pas * recreated 2006-10-16 21:34:52 +00:00
h2pas.y * another patch from J. Peter Mugaas, fixes #7618 and #7615 2006-10-18 18:38:19 +00:00
h2paspp.pas * log and id tags removed 2005-05-21 09:42:41 +00:00
lexlib.pas
Makefile + regenerated makefiles to support powerpc-amiga target 2006-08-06 12:28:28 +00:00
Makefile.fpc
options.pas use the ctypes unit in h2pas (from jpetermugaas) 2006-09-22 21:12:07 +00:00
README
scan.l * another patch from J. Peter Mugaas, fixes #7618 and #7615 2006-10-18 18:38:19 +00:00
scan.pas * recreated 2006-10-16 21:34:52 +00:00
testit.h
yacclib.pas initial import 2005-05-16 18:37:41 +00:00
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 !