Pelles C forum

Pelles C => Bug reports => Topic started by: Rainer on November 04, 2005, 10:25:04 PM

Title: missing _cputs in conio.h
Post by: Rainer on November 04, 2005, 10:25:04 PM
Hello Pelle,

I am missing the function _cputs() [ cputs ] in conio.h. Perhaps you can add the function.
Same for the function _cgets(), but I think it´s a lot of work to implement this (Editingfunction).

---
Description from an old MS-Helpsystem
The cputs function writes the null-terminated string pointed to by
<string> directly to the console. Note that a carriage-return/
line-feed (CR-LF) combination is not automatically appended to the
string.

Return Value

If successful, cputs returns a 0. If the function fails, it
returns a nonzero value.
---

Below my workaround in conio.h

// int __cdecl _cputs(const char * restrict);       // missing
#define _cputs(s) ( _cprint("%s",s) >= 0 ? 0 : -1 ) // Workaround

Oldnames
// int __cdecl cputs(const char * restrict);       // missing
#define cputs(s) ( cprint("%s",s) >= 0 ? 0 : -1 )  // Workaround
Title: missing _cputs in conio.h
Post by: Pelle on November 05, 2005, 03:56:39 PM
Hello,

I was hoping I could avoid adding _cputs, since _cprintf can do the same thing (and more), but maybe it should be added - at least as a macro (but a real function is probably better). Maybe possible to implement _cgets too - I will look at it...

Pelle
Title: missing _cputs in conio.h
Post by: Hudkap on August 03, 2006, 09:12:19 AM
It is really??