|
|
1.1 ! root 1: /********************************************************************* ! 2: * COPYRIGHT NOTICE * ! 3: ********************************************************************** ! 4: * This software is copyright (C) 1982 by Pavel Curtis * ! 5: * * ! 6: * Permission is granted to reproduce and distribute * ! 7: * this file by any means so long as no fee is charged * ! 8: * above a nominal handling fee and so long as this * ! 9: * notice is always included in the copies. * ! 10: * * ! 11: * Other rights are reserved except as explicitly granted * ! 12: * by written permission of the author. * ! 13: * Pavel Curtis * ! 14: * Computer Science Dept. * ! 15: * 405 Upson Hall * ! 16: * Cornell University * ! 17: * Ithaca, NY 14853 * ! 18: * * ! 19: * Ph- (607) 256-4934 * ! 20: * * ! 21: * Pavel.Cornell@Udel-Relay (ARPAnet) * ! 22: * decvax!cornell!pavel (UUCPnet) * ! 23: *********************************************************************/ ! 24: ! 25: /* ! 26: ** lib_printw.c ! 27: ** ! 28: ** The routines printw(), wprintw() and friend. ! 29: ** ! 30: ** $Log: lib_printw.c,v $ ! 31: * Revision 1.8 93/04/12 14:13:58 bin ! 32: * Udo: third color update ! 33: * ! 34: * Revision 1.2 92/04/13 14:38:17 bin ! 35: * update by vlad ! 36: * ! 37: * Revision 2.2 91/01/27 15:17:12 munk ! 38: * Rewritten for COHERENT and portable usage of variable arguments ! 39: * ! 40: * Revision 2.1 82/10/25 14:48:38 pavel ! 41: * Added Copyright Notice ! 42: * ! 43: * Revision 2.0 82/10/25 13:48:22 pavel ! 44: * Beta-one Test Release ! 45: * ! 46: ** ! 47: */ ! 48: ! 49: #ifdef RCSHDR ! 50: static char RCSid[] = ! 51: "$Header: /src386/usr/lib/ncurses/RCS/lib_printw.c,v 1.8 93/04/12 14:13:58 bin Exp Locker: bin $"; ! 52: #endif ! 53: ! 54: #include "curses.h" ! 55: #include "curses.priv.h" ! 56: ! 57: static char buf[512]; ! 58: ! 59: ! 60: printw(string) ! 61: char *string; ! 62: { ! 63: #ifdef TRACE ! 64: if (_tracing) ! 65: _tracef("printw(%s,...) called", string); ! 66: #endif ! 67: ! 68: sprintf(buf, "%r", (char **) &string); ! 69: return(waddstr(stdscr, buf)); ! 70: } ! 71: ! 72: ! 73: wprintw(win, string) ! 74: WINDOW *win; ! 75: char *string; ! 76: { ! 77: #ifdef TRACE ! 78: if (_tracing) ! 79: _tracef("wprintw(%o,%s,...) called", win, string); ! 80: #endif ! 81: ! 82: sprintf(buf, "%r", (char **) &string); ! 83: return(waddstr(win, buf)); ! 84: } ! 85: ! 86: ! 87: mvprintw(y, x, string) ! 88: int y, x; ! 89: char *string; ! 90: { ! 91: if (move(y, x) != OK) ! 92: return(ERR); ! 93: sprintf(buf, "%r", (char **) &string); ! 94: return(waddstr(stdscr, buf)); ! 95: } ! 96: ! 97: ! 98: mvwprintw(win, y, x, string) ! 99: WINDOW *win; ! 100: int y, x; ! 101: char *string; ! 102: { ! 103: if (wmove(win, y, x) != OK) ! 104: return(ERR); ! 105: sprintf(buf, "%r", (char **) &string); ! 106: return(waddstr(win, buf)); ! 107: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.