fpc/utils/h2pas
florian cbfda37a26 + added -P:
allows to generate headers which load proc. dyn. from libs
2005-02-20 11:09:41 +00:00
..
converu.pas * big update, it now converts much more files without serious errors 2000-12-27 21:59:58 +00:00
h2pas.pas + added -P: 2005-02-20 11:09:41 +00:00
h2pas.y + added -P: 2005-02-20 11:09:41 +00:00
h2paspp.pas * big update, it now converts much more files without serious errors 2000-12-27 21:59:58 +00:00
lexlib.pas + -S, -T, -c modes added 2000-03-27 21:39:19 +00:00
Makefile * 1.9.8 2005-02-15 22:28:29 +00:00
Makefile.fpc * Makefile fixes 2001-05-03 21:35:04 +00:00
options.pas + added -P: 2005-02-20 11:09:41 +00:00
README * moved 1999-05-12 16:11:39 +00:00
scan.l + support for creating packed records 2004-09-08 22:21:41 +00:00
scan.pas * truncate log 2005-02-14 17:13:06 +00:00
testit.h * support for enum enumtype enumvar; fixed 2001-12-17 23:34:58 +00:00
yacclib.pas * old logs removed and tabs fixed 2002-09-07 15:40:30 +00:00
yylex.cod * moved 1999-05-12 16:11:39 +00:00
yyparse.cod * moved 1999-05-12 16:11:39 +00:00

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 !