Thread View: comp.std.c
3 messages
3 total messages
Started by William E. Davidsen Jr
Thu, 07 Jul 1988 19:37
Help me translate into C
Author: William E. Davidsen Jr
Date: Thu, 07 Jul 1988 19:37
Date: Thu, 07 Jul 1988 19:37
27 lines
1698 bytes
1698 bytes
I recently got a really nice bunch of software written in a C-like
language. It's some proprietary version like Turbo-C, or something. I
need someone to explain what some of the proprietary constructs do.
First "pascal." On old versions of VMS this meant it was expected to
call a Pascal procedure, however all procedures are written in almost-C.
Second "cdecl." I know it was in dpANS briefly, but I don't see it in my
old copy and the new one hasn't arrived yet.
A macro "SEEK_SET" as the third argument of lseek. From context it
appears to be a macro with a conditional evaluation, since the values 0,
1, or 2 don't make sense in all places. Anyone have a clue?
It also uses a few things like O_BINARY which means untranslated on
systems having funny filetypes like DOS and VMS.
If anyone has a clue I'd really appreciate it. I have enough trouble
with real C, and haven't bothered to learn all the versions which only
run on machines from a single vendor or one a single OS.
Mail or post, if I get any info or find out the answers here I'll post
the results.
--
bill davidsen (wedu@ge-crd.arpa)
{uunet | philabs | seismo}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me
Re: Help me translate into C
Author: Doug Gwyn
Date: Fri, 08 Jul 1988 03:02
Date: Fri, 08 Jul 1988 03:02
32 lines
1759 bytes
1759 bytes
In article <11475@steinmetz.ge.com> davidsen@crdos1.UUCP (bill davidsen) writes: >First "pascal." That indicates that a Pascal-compatible calling sequence is to be used for the function so labeled. This is normally needed only when using externally-provided library routines compiled under Pascal. If your version of such routines have C-compatible interfaces, remove the "pascal" keywords or #define them as nothing. >Second "cdecl." That indicates that a C-compatible calling sequence is to be used for the function so labeled. Just drop the "cdecl" keywords or #define them as nothing. >I know it [cdecl] was in dpANS briefly, ... I don't think so; certainly not while I've been on the committee. It would make no sense to include it in the C Standard, since it would have to be a no-op. > A macro "SEEK_SET" as the third argument of lseek. On any UNIX-compatible system this has to be defined as 0. > It also uses a few things like O_BINARY which means untranslated on >systems having funny filetypes like DOS and VMS. The ANSI C equivalent would be the "b" mode suffix for the various standard I/O routines fopen(), freopen(). On any UNIX-compatible system there is no distinction between text and binary file modes, so O_BINARY can be removed (or #defined as 0).
Re: Help me translate into C
Author: Tom Neff
Date: Fri, 15 Jul 1988 16:09
Date: Fri, 15 Jul 1988 16:09
14 lines
1180 bytes
1180 bytes
In article <11475@steinmetz.ge.com> davidsen@crdos1.UUCP (bill davidsen) writes: > [Turbo C?] also uses a few things like O_BINARY which means untranslated on >systems having funny filetypes like DOS and VMS. Doug Gwyn answered Bill's questions in detail. I just want to point out that MS-DOS has no "funny filetypes." All typing is by convention only, everything is really just a string of bytes. The O_BINARY flag controls the way the DOS "C" runtime behaves on things like end-of-file (soft via ^Z or hard via filesize) and newline (swallow ^M's or not). -- Tom Neff UUCP: ...!cmcl2!phri!dasys1!tneff "None of your toys CIS: 76556,2536 MCI: TNEFF will function..." GEnie: TOMNEFF BIX: t.neff (no kidding)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads