MCPcopy Create free account
hub / github.com/NetHack/NetHack / xputc

Function xputc

win/tty/termcap.c:616–635  ·  view source on GitHub ↗

See note above. xputc() is a special function for overlays. */

Source from the content-addressed store, hash-verified

614
615/* See note above. xputc() is a special function for overlays. */
616int
617xputc(int c) /* actually char, but explicitly specify its widened type */
618{
619 /*
620 * Note: xputc() as a direct all to putchar() doesn't make any
621 * sense _if_ putchar() is a function. But if it is a macro, an
622 * overlay configuration would want to avoid hidden code bloat
623 * from multiple putchar() expansions. And it gets passed as an
624 * argument to tputs() so we have to guarantee an actual function
625 * (while possibly lacking ANSI's (func) syntax to override macro).
626 *
627 * xputc() used to be declared as 'void xputc(c) char c; {}' but
628 * avoiding the proper type 'int' just to avoid (void) casts when
629 * ignoring the result can't have been sufficient reason to add it.
630 * It also had '#if apollo' conditional to have the arg be int.
631 * Matching putchar()'s declaration and using explicit casts where
632 * warranted is more robust, so we're just a jacket around that.
633 */
634 return putchar(c);
635}
636
637void
638xputs(const char *s)

Callers 3

nocmovFunction · 0.70
cl_endFunction · 0.70
cl_eosFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected