platform specific API or C standard API

G

George2

Hello everyone,


Are there any official site to check whether an API (like tolower or
toLower) is platform specific API (e.g. Microsoft platform specific,
Linux specific) or C common standard API?


thanks in advance,
George
 
I

Ian Collins

George2 said:
Hello everyone,

Are there any official site to check whether an API (like tolower or
toLower) is platform specific API (e.g. Microsoft platform specific,
Linux specific) or C common standard API?
Look it up in the standard!
 
T

Tor Rustad

George2 said:
Hello everyone,


Are there any official site to check whether an API (like tolower or
toLower) is platform specific API (e.g. Microsoft platform specific,
Linux specific) or C common standard API?

The official document is the ISO C standard, which is not free.

However, platform specific API's are usually documented locally by the
implementation, just try to check the MSDN doc or man page.

In the case of Microsoft, their lower-case API's, all have an underscore
prefix, so 'tolower' would be named '_tolower' by M$. Turn on the
compiler switch /Za, to get compiler in conforming mode.

In C90, no standard library API's has any upper-case letters, so
'toLower' can't be a standard API. C99 break this rule with the new
_Exit() function.
 
D

dj3vande

The official document is the ISO C standard, which is not free.

However, platform specific API's are usually documented locally by the
implementation, just try to check the MSDN doc or man page.

Good platform-specific documentation will say which standards if any
define a particular function.
If you're reading man pages on a unix-ish system, look for a section
titled 'STANDARDS' or 'CONFORMING TO'. The (somewhat out of date)
version of the Microsoft documentation I use at work has a table in the
description of many non-Win32-specific functions that includes a
"compatibility" column that lists any standards that define the
function.

In the case of Microsoft, their lower-case API's, all have an underscore
prefix, so 'tolower' would be named '_tolower' by M$. Turn on the
compiler switch /Za, to get compiler in conforming mode.

Incorrect.
This compiles and runs perfectly fine with the default invocation of
MSVC6:
--------
#include <ctype.h>
#include <stdio.h>

int main(void)
{
printf("tolower('a'): %c\n",tolower('a'));
printf("tolower('A'): %c\n",tolower('A'));

return 0;
}
 
J

John Bode

Hello everyone,

Are there any official site to check whether an API (like tolower or
toLower) is platform specific API (e.g. Microsoft platform specific,
Linux specific) or C common standard API?

thanks in advance,
George

Any good, authoritative C reference (such as Kernighan & Ritchie's
"The C Programming Language" or Harbison & Steele's "C: A Reference
Manual" or P.J. Plauger's "The C Standard Library") will contain a
listing of all the C standard library functions; so, if you come
across a library call that isn't described in any of those references,
it's platform-specific.
 
T

Tor Rustad

[...]
In the case of Microsoft, their lower-case API's, all have an underscore
prefix, so 'tolower' would be named '_tolower' by M$. Turn on the
compiler switch /Za, to get compiler in conforming mode.

Incorrect.

Then please name a lower-case Microsoft specific API, which doesn't have
underscore prefix. Since 'tolower' hasn't, this shows OP by a glance,
that it's a C standard function.

FYI, the default VC++ 6.0 mode, isn't the C conforming mode:

cl /?
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

C/C++ COMPILER OPTIONS
....

/Za disable extensions (implies /Op)

This compiles and runs perfectly fine with the default invocation of
MSVC6:
--------
#include <ctype.h>
#include <stdio.h>

int main(void)
{
printf("tolower('a'): %c\n",tolower('a'));
printf("tolower('A'): %c\n",tolower('A'));

return 0;
}

So? tolower() isn't a M$ specific function.
 
D

dj3vande

[...]
In the case of Microsoft, their lower-case API's, all have an underscore
prefix, so 'tolower' would be named '_tolower' by M$. Turn on the
compiler switch /Za, to get compiler in conforming mode.

Incorrect.

Then please name a lower-case Microsoft specific API, which doesn't have
underscore prefix. Since 'tolower' hasn't, this shows OP by a glance,
that it's a C standard function.

Uhh... what? You claimed that Microsoft prefixes lower-case symbols
with a '_', and presented tolower as an example. Which is incorrect.

Perhaps your comment would have been clearer if you had used an example
of a lower-case symbol that does fit the pattern you're describing.


dave
 
K

Kenny McCormack

In the case of Microsoft, their lower-case API's, all have an underscore
prefix, so 'tolower' would be named '_tolower' by M$. Turn on the
compiler switch /Za, to get compiler in conforming mode.

Incorrect.
This compiles and runs perfectly fine with the default invocation of
MSVC6:[/QUOTE]

I think you misunderstand. In the patois of this NG, the phrase:
"to get compiler in conforming mode" means "cripple your compiler so
that only stricting conforming programs can be compiled". It doesn't
mean anything remotely resembling "enhance your compiler's performance
so that ...".
 
S

santosh

Hello everyone,


Are there any official site to check whether an API (like tolower or
toLower) is platform specific API (e.g. Microsoft platform specific,
Linux specific) or C common standard API?

If it's a Standard function it'll be described in the C Standard,
working draft of which you can get here:

<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf>

After you have determined that a particular function is not in Standard
C, you will have to consult further references like Open Group's Single
Unix Specification (formerly POSIX), Microsoft's MSDN documentation,
Linux's man pages etc. to place a function.
 
T

Tor Rustad

Uhh... what? You claimed that Microsoft prefixes lower-case symbols
with a '_',

No, I said *their* lower-case API's. So context here was M$ specific API's.
and presented tolower as an example. Which is incorrect.

Well, it was OP's example. I just tried to tell OP about the M$ naming
conventions relevant for his case.
Perhaps your comment would have been clearer if you had used an example
of a lower-case symbol that does fit the pattern you're describing.

Perhaps, if some non-native speaker of English is unclear, it's better
to ask for a clarification, before jumping to some silly conclusion.
 
C

CBFalconer

Flash said:
Ian Collins wrote, On 12/11/07 08:04:
.... snip ...

If you have tried but cannot find the answer then you can ask
here and people will tell you whether a function is a standard
C function or not.

Or just go and get the latest versions at the following:

<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf>
<http://cbfalconer.home.att.net/download/n869_txt.bz2>

N1256 is the latest draft, and up to date. N869 is the last draft
before release of C99, but is a text version and much easier to
use. It is compressed with bzip2.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top