Recent

Author Topic: C Headers  (Read 2146 times)

BranL

  • Newbie
  • Posts: 2
C Headers
« on: June 25, 2013, 08:38:06 pm »
I was wondering if anyone knew of a repository that had the common C header files translated into .pas files. I am referring to the ones like stdio.h, stdlib.h, etc.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8114
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: C Headers
« Reply #1 on: June 26, 2013, 01:26:10 am »
None exist I guess, what for? Standard C libraries are designed WITHOUT safety in mind and very error prone to use.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7588
Re: C Headers
« Reply #2 on: June 26, 2013, 02:09:01 pm »
I was wondering if anyone knew of a repository that had the common C header files translated into .pas files. I am referring to the ones like stdio.h, stdlib.h, etc.

Such translations are OS, compiler and version specific afaik, which is why there are none. While the standard says what should be in there, not all details are described by the standard.   

Some pchar like string routines are in unit strings and sysutils.

BranL

  • Newbie
  • Posts: 2
Re: C Headers
« Reply #3 on: June 26, 2013, 03:56:39 pm »
The problem is that I have a custom C header from a co-worker for a project and it includes some of the Standard C libraries and I can't seem to be able to get the translation to work without translating the Standard libraries, afaik. I guess if you have other suggestions on a different way to go about it, I would love to hear them.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8114
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: C Headers
« Reply #4 on: June 26, 2013, 05:14:44 pm »
Quote
The problem is that I have a custom C header from a co-worker for a project and it includes some of the Standard C libraries and I can't seem to be able to get the translation to work without translating the Standard libraries, afaik. I guess if you have other suggestions on a different way to go about it, I would love to hear them.
Compile the C things as (dynamic) libraries and create a Pascal wrapper for the functions. Most C libraries will of course use the standard libraries.