I am afraid not. The reason why they extend C is mainly that standard C
Can you give me an example of an extension which
cannot be translated into (efficient) standard C ?
There are a lot of things standard C can't do in terms of external
interfaces, so unless you can do these with a non-standard external
command called from system(), or it can be done by something starting
the program (e.g. connecting stdin to a network connection), they
can't be done.
- Reading the list of files in a directory. (POSIX opendir() and readdir()
are not standard C, and system("ls > list.tmp"), then opening up list.tmp
and reading it is not guaranteed to do what might be expected).
- Displaying graphics. (It is probably possible to transform graphics
files portably, given the application-specific format of, say, a .jpeg
file, and something else to handle the display of the file after the
program has run).
- Coin Return. Some systems don't even have a coin slot, and there are
a variety of ways to return deposited coins.
- Networking. You might be able to do limited networking by passing a
user-supplied string to fopen() to access remote files, or connect a
pipe to stdin, stdout, or stderr, before the program starts but things
like BSD bind(), connect(), creating sockets, listen(), etc. are
not standard C.
- Launching missiles, although fflush(stdin) may do this, but it's not
standard C, and there's the problem of targetting.
- Anything to do with reading or changing the ownership, permissions,
color, colour, timestamps, or postage on a file. POSIX stat() is
not standard C, and files may not have some or all of these attributes.
- Creation of a directory, folder, foulder, named pipe, socket, wormhole,
special device file, stargate, or warp field. system("mkdir foo")
is not guaranteed to create a directory, folder, or foulder, nor is it
guaranteed which will be created if one is at all.