EnglishFrenchSpanish

Ad


OnWorks favicon

h2pas-3.0.0 - Online in the Cloud

Run h2pas-3.0.0 in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command h2pas-3.0.0 that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


h2pas - The C header to pascal unit conversion program.

SYNOPSIS


h2pas [options] filename

DESCRIPTION


h2pas attempts to convert a C header file to a pascal unit. it can handle most C
constructs that one finds in a C header file, and attempts to translate them to their
pascal counterparts. see the CONSTRUCTS section for a full description of what the
translator can handle.

USAGE


H2pas is a command-line tool that translates a C header file to a spascal unit. It reads
the C header file and translates the C declarations to equivalent pascal declarations that
can be used to access code written in C.

The output of the h2pas program is written to a file with the same name as the C header
file that was used as input, but with the extension .pp. The output file that h2pas
creates can be customized in a number of ways by means of many options.

OPTIONS


The output of h2pas can be controlled with the following options:

-d use external; for all procedure and function declarations.

-D use external libname name 'func_name' for function and procedure declarations.

-e Emit a series of constants instead of an enumeration type for the C enum construct.

-i create an include file instead of a unit (omits the unit header).

-l libname
specify the library name for external function declarations.

-o outfile
Specify the output file name. Default is the input file name with the extension
replaced by .pp "."

-p use the letter P in front of pointer type parameters instead of "^".

-s Strip comments from the input file. By default comments are converted to comments,
but they may be displaced, since a comment is handled by the scanner.

-t prepend typedef type names with the letter T (used to follow Borland's convention
that all types should be defined with T).

-v replace pointer parameters by call by reference parameters. Use with care because
some calls can expect a NIL pointer.

-w Header file is a win32 header file (adds support for some special macros).

-x handle SYS_TRAP of the PalmOS header files.

CONSTRUCTS


The following C declarations and statements are recognized:

defines
defines are changed into pascal constants if they are simple defines. macros are
changed - wherever possible to functions; however the arguments are all integers,
so these must be changed manually. Simple expressions in define staments are
recognized, as are most arithmetic operators: addition, substraction,
multiplication, division, logical operators, comparision operators, shift
operators. The C construct ( A ? B : C) is also recognized and translated to a
pascal construct with an IF statement (this is buggy, however).

preprocessor statements
the conditional preprocessing commands are recognized and translated into
equivalent pascal compiler directives. The special #ifdef __cplusplus is also
recognized and removed.

typedef
A typedef statement is changed into a pascal type statement. The following basic
types are recognized:

char changed to char.

float changed to real (=double in free pascal).

int changed to longint.

long changed to longint.

long int
changed to longint.

short changed to integer.

unsigned
changed to cardinal.

unsigned char
changed to byte.

unsigned int
changed to cardinal.

unsigned long int
changed to cardinal.

unsigned short
changed to word.

void ignored.
These types are also changed if they appear in the arguments of a function or procedure.

functions and procedures
functions and procedures are translated as well; pointer types may be changed to
call by reference arguments (using the var argument) by using the -p command line
argument. functions that have a variable number of arguments are changed to a
function with an array of const argument.

specifiers
the extern specifier is recognized; however it is ignored. the packed specifier is
also recognised and changed with the PACKRECORDS directive. The const specifier is
also recognized, but is ignored.

modifiers
If the -w option is specified, then the following modifiers are recognized: STDCALL
, CDECL , CALLBACK , PASCAL , WINAPI , APIENTRY , WINGDIAPI as defined in the win32
headers. If additionally the -x option is specified then the SYS_TRAP specifier is
also recognized.

enums enum constructs are changed into enumeration types; bear in mind that in C
enumeration types can have values assigned to them; Free Pascal also allows this to
a certain degree. If you know that values are assigned to enums, it is best to use
the -e option to change the enus to a series of integer constants.

unions unions are changed to variant records.

structs
are changed to pascal records, with C packing.

Use h2pas-3.0.0 online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Phaser
    Phaser
    Phaser is a fast, free, and fun open
    source HTML5 game framework that offers
    WebGL and Canvas rendering across
    desktop and mobile web browsers. Games
    can be co...
    Download Phaser
  • 2
    VASSAL Engine
    VASSAL Engine
    VASSAL is a game engine for creating
    electronic versions of traditional board
    and card games. It provides support for
    game piece rendering and interaction,
    and...
    Download VASSAL Engine
  • 3
    OpenPDF - Fork of iText
    OpenPDF - Fork of iText
    OpenPDF is a Java library for creating
    and editing PDF files with a LGPL and
    MPL open source license. OpenPDF is the
    LGPL/MPL open source successor of iText,
    a...
    Download OpenPDF - Fork of iText
  • 4
    SAGA GIS
    SAGA GIS
    SAGA - System for Automated
    Geoscientific Analyses - is a Geographic
    Information System (GIS) software with
    immense capabilities for geodata
    processing and ana...
    Download SAGA GIS
  • 5
    Toolbox for Java/JTOpen
    Toolbox for Java/JTOpen
    The IBM Toolbox for Java / JTOpen is a
    library of Java classes supporting the
    client/server and internet programming
    models to a system running OS/400,
    i5/OS, o...
    Download Toolbox for Java/JTOpen
  • 6
    D3.js
    D3.js
    D3.js (or D3 for Data-Driven Documents)
    is a JavaScript library that allows you
    to produce dynamic, interactive data
    visualizations in web browsers. With D3
    you...
    Download D3.js
  • More »

Linux commands

  • 1
    abidiff
    abidiff
    abidiff - compare ABIs of ELF files
    abidiff compares the Application Binary
    Interfaces (ABI) of two shared libraries
    in ELF format. It emits a meaningful
    repor...
    Run abidiff
  • 2
    abidw
    abidw
    abidw - serialize the ABI of an ELF
    file abidw reads a shared library in ELF
    format and emits an XML representation
    of its ABI to standard output. The
    emitted ...
    Run abidw
  • 3
    copac2xml
    copac2xml
    bibutils - bibliography conversion
    utilities ...
    Run copac2xml
  • 4
    copt
    copt
    copt - peephole optimizer SYSNOPIS:
    copt file.. DESCRIPTION: copt is a
    general-purpose peephole optimizer. It
    reads code from its standard input and
    writes an ...
    Run copt
  • 5
    gather_stx_titles
    gather_stx_titles
    gather_stx_titles - gather title
    declarations from Stx documents ...
    Run gather_stx_titles
  • 6
    gatling-bench
    gatling-bench
    bench - http benchmark ...
    Run gatling-bench
  • More »

Ad