X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=man%2Fcurs_inwstr.3x;h=b3899c4b94f2eafbf53f35c91bf6828709e3bb1d;hp=d53908b33329188906b7e3b5a87512d3b9244b9f;hb=HEAD;hpb=55ccd2b959766810cf7db8d1c4462f338ce0afc8 diff --git a/man/curs_inwstr.3x b/man/curs_inwstr.3x index d53908b3..9bafe85d 100644 --- a/man/curs_inwstr.3x +++ b/man/curs_inwstr.3x @@ -1,5 +1,6 @@ .\"*************************************************************************** -.\" Copyright (c) 2002-2004,2005 Free Software Foundation, Inc. * +.\" Copyright 2018-2023,2024 Thomas E. Dickey * +.\" Copyright 2002-2012,2017 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,69 +27,116 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_inwstr.3x,v 1.4 2005/06/25 18:31:26 Daniel.Jacobowitz Exp $ -.TH curs_inwstr 3X "" +.\" $Id: curs_inwstr.3x,v 1.43 2024/05/25 20:10:58 tom Exp $ +.TH curs_inwstr 3X 2024-05-25 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls" +.ie \n(.g \{\ +.ds `` \(lq +.ds '' \(rq +.\} +.el \{\ +.ie t .ds `` `` +.el .ds `` "" +.ie t .ds '' '' +.el .ds '' "" +.\} +.de bP +.ie n .IP \(bu 4 +.el .IP \(bu 2 +.. .SH NAME -\fBinwstr\fR, -\fBinnwstr\fR, -\fBwinwstr\fR, -\fBwinnwstr\fR, -\fBmvinwstr\fR, -\fBmvinnwstr\fR, -\fBmvwinwstr\fR, -\fBmvwinnwstr\fR \- get a string of \fBwchar_t\fR characters from a curses window +\fB\%inwstr\fP, +\fB\%innwstr\fP, +\fB\%winwstr\fP, +\fB\%winnwstr\fP, +\fB\%mvinwstr\fP, +\fB\%mvinnwstr\fP, +\fB\%mvwinwstr\fP, +\fB\%mvwinnwstr\fP \- +get a wide-character string from a \fIcurses\fR window .SH SYNOPSIS .nf -\fB#include \fR - -\fBint inwstr(\fR\fBwchar_t *\fR\fIstr\fR\fB);\fR -.br -\fBint innwstr(\fR\fBwchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR -.br -\fBint winwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, wchar_t *\fR\fIstr\fR\fB);\fR -.br -\fBint winnwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, wchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR -.br -\fBint mvinwstr(\fR\fBint \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB);\fR -.br -\fBint mvinnwstr(\fR\fBint \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR -.br -\fBint mvwinwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB);\fR -.br -\fBint mvwinnwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR +\fB#include +.PP +\fBint inwstr(wchar_t *\fIwstr\fP); +\fBint innwstr(wchar_t *\fIwstr\fP, int \fIn\fP); +\fBint winwstr(WINDOW *\fIwin\fP, wchar_t *\fIwstr\fP); +\fBint winnwstr(WINDOW *\fIwin\fP, wchar_t *\fIwstr\fP, int \fIn\fP); +.PP +\fBint mvinwstr(int \fIy\fP, int \fIx\fP, wchar_t *\fIwstr\fP); +\fBint mvinnwstr(int \fIy\fP, int \fIx\fP, wchar_t *\fIwstr\fP, int \fIn\fP); +\fBint mvwinwstr(WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, wchar_t *\fIwstr\fP); +\fBint mvwinnwstr(WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, wchar_t *\fIwstr\fP, int \fIn\fP); .fi .SH DESCRIPTION -These routines return a string of \fBwchar_t\fR characters in \fIwstr\fR, -extracted starting at the current cursor position in the named window. -Attributes are stripped from the characters. -The four functions with \fIn\fR as the last argument return a leading substring at most -\fIn\fR bytes long (exclusive of the trailing NUL). -Transfer stops at the end of the current line, or when \fIn\fR bytes have -been stored at the location referenced by \fIwstr\fR. +These routines return a string of \fBwchar_t\fP wide characters in \fIwstr\fP, +starting at the current cursor position in the named window. +.PP +The four functions with \fIn\fP as the last argument return +a leading substring at most \fIn\fP characters long +(exclusive of the trailing NUL). +Transfer stops at the end of the current line, or when \fIn\fP characters have +been stored at the location referenced by \fIwstr\fP. .PP -If the size \fIn\fR is not large enough to store a complete character, +If the size \fIn\fP is not large enough to store a complete complex character, an error is generated. -.SH NOTES -Note that all routines except -\fBwinnwstr\fR -may be macros. -.SH RETURN VALUES +.SH RETURN VALUE All routines return -\fBERR\fR -upon failure. Upon -successful completion, the *\fBinwstr\fR +\fBERR\fP +upon failure. +Upon +successful completion, the *\fBinwstr\fP routines return -\fBOK\fR, and the *\fBinnwstr\fR +\fBOK\fP, and the *\fBinnwstr\fP routines return the number of characters read into the string. +.PP +X/Open defines no error conditions. +This implementation returns +.B ERR +.bP +if the \fIwin\fP parameter is null or +.bP +if the \fIwstr\fP parameter is null, or +.bP +if no characters could be read. +.PP +Functions prefixed with \*(``mv\*('' first perform cursor movement and +fail if the position +.RI ( y , +.IR x ) +is outside the window boundaries. +.SH NOTES +All routines except +\fBwinnwstr\fP +may be macros. +.PP +Each cell in the window holds a complex character +(a spacing character and zero or more non-spacing characters) +together with attributes and color. +These functions store only the wide characters, +ignoring attributes and color. +Use \fBin_wchstr\fP to return the complex characters from a window. +.PP +Reading a line that overflows the array pointed to by +\fIwstr\fP +with +\fBinwstr\fP, +\fBmvinwstr\fP, +\fBmvwinwstr\fP +or +\fBwinwstr\fP +causes undefined results. +Therefore, the use of +\fBinnwstr\fP, +\fBmvinnwstr\fP, +\fBmvwinnwstr\fP, or +\fBwinnwstr\fP +is recommended. +.SH PORTABILITY +These functions are described in X/Open Curses, Issue 4. .SH SEE ALSO -Functions: -\fBcurses\fR(3X), -\fBcurs_instr\fR(3X), -\fBcurs_in_wchstr\fR(3X) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: +\fB\%curses\fP(3X), +\fB\%curs_inch\fP(3X), +\fB\%curs_inchstr\fP(3X), +\fB\%curs_instr\fP(3X), +\fB\%curs_in_wchstr\fP(3X)