peter 50684700d1 * log truncated 25 years ago
..
Makefile a2318ce5ec * regenerated 25 years ago
Makefile.fpc e3c8963279 * Makefile updates again 25 years ago
README 3a56cae749 * moved 26 years ago
converu.pas 3a56cae749 * moved 26 years ago
h2pas.pas 50684700d1 * log truncated 25 years ago
h2pas.y 50684700d1 * log truncated 25 years ago
lexlib.pas 3a56cae749 * moved 26 years ago
options.pas 50684700d1 * log truncated 25 years ago
scan.l ec29a31834 * copyright 2000 25 years ago
scan.pas ec29a31834 * copyright 2000 25 years ago
testit.h 3a56cae749 * moved 26 years ago
yacclib.pas 3a56cae749 * moved 26 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 !