Sign in Join
Wiki copytemporary

iPhone headers translator

https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Apple_iOS_new.svg/60px-Apple_iOS_new.svg.png

This article applies to iOS only.

See also: Multiplatform Programming Guide

Pascal iPhone header translator

Author

Anton e-mail: ast DOT a_s AT mail DOT ru

Introduction

Because no one can redistribute Pascal units for iOS SDK we need a tool that can produce such units from official C headers. Of course everyone can take original headers and manually translate them but it is not the simplest work. Indeed this process can be (at least partially) automated. I'd like to present iPhone headers translator that is written in FPC.

File structure

There are several files zip available fro download page:

Features (main goals of project)

Version review

Translation process was tested for the following SDKs:

iPhoneSimulator 3.0, 3.2, 4.0, 4.1, 4.2, 4.3, 5.0;

iPhoneOS 5.0.

Compilation of produced units was tested only for iPhoneSimulator 5.0.

Test project can be found on download page (ipt.zip contains Lazarus project, notes about its compilation can be found in next section).

Some frameworks (applicationservices, coreservices, accelerate, carbon) for now are translated to empty units because translation of "nested frameworks" is not implemented yet. Parsing process was tested for iPhoneSimulator 5.0 and iPhoneOS 5.0, compilation was tested only for simulator.

How to parse

To build parser "fpc parser" is enough. Of course you need to install iPhone SDK. Cause I have only simulator, I will use its SDK. Typically it is installed to /Developer/Platforms/iPhoneSimulator/Developer/SDKs/iPhoneSimulator5.0.sdk (for 5.0 version). The path to SDK will be used as a parameter of parser. Indeed, it's time to start it. Parser contains a little help, so it can be used (--help or without parameters).

Parser parameters:

  1. one of parameter must be sdk="path_to_sdk" (mandatory);
  2. there can be parameter dest="output_path" (to place Pascal units, if not specified "src" is used);
  3. all other parameters are regarded as names of frameworks to parse.

Example:

pascal
$ ./parser sdk=/Developer/Platforms/iPhoneSimulator/Developer/SDKs/iPhoneSimulator5.0.sdk UIKit

will translate UIKit and all dependant frameworks (cfnetwork, corefoundation, coregraphics, coreimage, corevideo, foundation, opengles, security). I've tested it for SDKs 3.0, 3.2, 4.0, 4.1, 4.2, 4.3, 5.0. Although now it works good there are some "todo's" and unimplemented parts.

ip_pars20120410.zip contains two scripts that can be used to start translation process:

  1. start_ios.sh for iPhoneOS 5.0 SDK;
  2. start_sim.sh for iPhoneSimulator 5.0 SDK.

Notes:

Testing

My test program is also attached (ipt.zip contains Lazarus project). Project output directory must be changed. In order to run it in Simulator I have created empty XCode project "iphone_test" and run it. After that I've closed XCode and run only simulator - it has contained my new program "iphone_test". After that I've simply replaced binary /Users/macuser/Library/Application Support/iPhone Simulator/5.0/Applications/C93F7A57-E612-4A40-B155-DB106CA860D6/iphone_test.app/iphone_test

Download

From here: http://sourceforge.net/projects/p-tools/files/iPhone%20headers%20translator/

https://github.com/odisey1245/ip_parse

See Also


From the Free Pascal wiki, page "iPhone headers translator", as the Internet Archive kept it on 2025-06-16, last changed on 2015-03-08. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 3, last changed by WikiArchive .

Edited on wiki.freepascal.org by 4 people, 2012–2015

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
SekelsenmatNew page: ==Pascal iPhone header translator== ===Author=== Anton e-mail: ast DOT a_s AT mail DOT ru ===Introduction=== There are 7 files in attached zip: parser.pas - main program; htranslator.p...
SekelsenmatIntroduction
Penilopa PIntroduction
Penilopa PPascal iPhone header translator
Penilopa PIntroduction
Penilopa PFeatures (main goals of project): + version review
Penilopa PHow to parse
SkalogryzSee Also
JwdietrichPlatform template added.
JwdietrichPlatform template added.
Jwdietrich
JwdietrichPlatform template updated.
Penilopa PDownload

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.