Re: [cc65] stdio.h for GEOS?

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2002-12-19 14:40:26


Hi!

On Thu, Dec 19, 2002 at 04:21:06PM +1030, Todd Elliott wrote:
> Can I use the preprocessor directive #include <stdio.h> when the target
> platform is GEOS? I don't remember seeing it in the samples for the GEOS
> target.

Just including stdio.h should never do any harm regardless of the target.
However, you may not be able to use the functions declared in the header file
- and this is true in case of GEOS. Maciej has more information on that. What
I can tell you is: GEOS does not support file i/o, so you cannot use any of
the functions taking a FILE* parameter, plus you cannot use any function that
uses a FILE* parameter implicitly. So neither printf() nor gets() may be
called (you will get a linker warning if you do so).

This leaves you with just the following two usable functions: sprintf() and
vsprintf().

> I'm going through the C book I'm learning from and trying to use C for
> GEOS.

You can use conio functions instead of the stdio ones if all you want is to
print text to the screen. For example, the famous "hello world" program using
conio would look like this:

        #include <stdlib.h>
        #include <conio.h>

        int main (void)
        {
            cprintf ("Hello world!\r\n");
            return EXIT_SUCCESS;
        }

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-12-19 14:42:22 CET