Jonas Maebe cb14d8a9d4 Merged revisions 11233 via svnmerge from 17 years ago
..
Makefile cb14d8a9d4 Merged revisions 11233 via svnmerge from 17 years ago
Makefile.fpc 60d19ea1e6 * forgot to commit 18 years ago
README 3a56cae749 * moved 26 years ago
converu.pas e0200f8fcb * patch from J. Peter Mugaas to fix #7616 19 years ago
h2pas.pas 5de9b9446b Merged revisions 9224,9236-9238,9260,9262,9266,9269-9272,9276-9278,9283,9295,9307-9308,9310,9322,9326,9337,9340,9343-9344,9359,9373-9375,9387,9396,9399,9401-9402,9434,9450-9456,9459-9463,9466,9468-9469,9472-9473,9476-9477,9480,9491-9492,9529,9536,9550,9566-9568,9571,9573,9576-9577,9579,9583,9587,9613-9614,9630 via svnmerge from 17 years ago
h2pas.y 5de9b9446b Merged revisions 9224,9236-9238,9260,9262,9266,9269-9272,9276-9278,9283,9295,9307-9308,9310,9322,9326,9337,9340,9343-9344,9359,9373-9375,9387,9396,9399,9401-9402,9434,9450-9456,9459-9463,9466,9468-9469,9472-9473,9476-9477,9480,9491-9492,9529,9536,9550,9566-9568,9571,9573,9576-9577,9579,9583,9587,9613-9614,9630 via svnmerge from 17 years ago
h2paspp.pas 790a4fe2d3 * log and id tags removed 20 years ago
lexlib.pas 164e1c25e6 + -S, -T, -c modes added 25 years ago
options.pas 398776e707 Merged revisions 8733,8743-8744,8747-8751,8766-8769,8774,8797,8800,8822,8831-8832,8848-8849,8851,8870,8875 via svnmerge from 18 years ago
scan.l 398776e707 Merged revisions 8733,8743-8744,8747-8751,8766-8769,8774,8797,8800,8822,8831-8832,8848-8849,8851,8870,8875 via svnmerge from 18 years ago
scan.pas 398776e707 Merged revisions 8733,8743-8744,8747-8751,8766-8769,8774,8797,8800,8822,8831-8832,8848-8849,8851,8870,8875 via svnmerge from 18 years ago
testit.h f86c568373 * support for enum enumtype enumvar; fixed 24 years ago
yacclib.pas 50778076c3 initial import 20 years ago
yylex.cod 3a56cae749 * moved 26 years ago
yyparse.cod 3a56cae749 * moved 26 years ago

README

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 !