#include <curses.h>
#include <stdio.h>
#include <stddef.h>
#include <gpxe/vsprintf.h>
#include "mucurses.h"
Go to the source code of this file.
Data Structures | |
| struct | printw_context |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER) | |
| int | waddch (WINDOW *win, const chtype ch) |
| Add a single-byte character and rendition to a window and advance the cursor. | |
| int | waddnstr (WINDOW *win, const char *str, int n) |
| Add string of single-byte characters to a window. | |
| static void | _printw_handler (struct printf_context *ctx, unsigned int c) |
| int | vw_printw (WINDOW *win, const char *fmt, va_list varglist) |
| Print formatted output in a window. | |
| int | wprintw (WINDOW *win, const char *fmt,...) |
| Print formatted output to a window. | |
Definition in file print.c.
| FILE_LICENCE | ( | GPL2_OR_LATER | ) |
Add a single-byte character and rendition to a window and advance the cursor.
| *win | window to be rendered in | |
| ch | character to be added at cursor |
| rc | return status code |
Definition at line 23 of file print.c.
References _wputch(), OK, and WRAP.
Referenced by addch(), mvaddch(), and mvwaddch().
| int waddnstr | ( | WINDOW * | win, | |
| const char * | str, | |||
| int | n | |||
| ) |
Add string of single-byte characters to a window.
| *win | window to be rendered in | |
| *str | standard c-style string | |
| n | max number of chars from string to render |
| rc | return status code |
Definition at line 36 of file print.c.
References _wputstr(), OK, and WRAP.
Referenced by addnstr(), addstr(), mvaddnstr(), mvaddstr(), mvwaddnstr(), mvwaddstr(), and waddstr().
| static void _printw_handler | ( | struct printf_context * | ctx, | |
| unsigned int | c | |||
| ) | [static] |
Definition at line 46 of file print.c.
References _wputch(), _curses_window::attrs, container_of, printw_context::win, and WRAP.
Referenced by vw_printw().
00046 { 00047 struct printw_context *wctx = 00048 container_of ( ctx, struct printw_context, ctx ); 00049 00050 _wputch( wctx->win, c | wctx->win->attrs, WRAP ); 00051 }
Print formatted output in a window.
| *win | subject window | |
| *fmt | formatted string | |
| varglist | argument list |
| rc | return status code |
Definition at line 61 of file print.c.
References _printw_handler(), printw_context::ctx, printf_context::handler, OK, vcprintf(), and printw_context::win.
Referenced by vwprintw(), and wprintw().
00061 { 00062 struct printw_context wctx; 00063 00064 wctx.win = win; 00065 wctx.ctx.handler = _printw_handler; 00066 vcprintf ( &(wctx.ctx), fmt, varglist ); 00067 return OK; 00068 }
| int wprintw | ( | WINDOW * | win, | |
| const char * | fmt, | |||
| ... | ||||
| ) |
Print formatted output to a window.
| *win | subject window | |
| *fmt | formatted string | |
| ... | string arguments |
| rc | return status code |
Definition at line 78 of file print.c.
References va_end, va_start, and vw_printw().
00078 { 00079 va_list args; 00080 int i; 00081 00082 va_start ( args, fmt ); 00083 i = vw_printw ( win, fmt, args ); 00084 va_end ( args ); 00085 return i; 00086 }
1.5.7.1