'\" t .\" TxtGetSG.sgm /main/8 1996/09/08 21:18:00 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetSubstring" 3 .SH "NAME" \fBXmTextGetSubstring\fP \(em A Text function that retrieves a copy of a portion of the internal text buffer "XmTextGetSubstring" "Text functions" "XmTextGetSubstring" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmTextGetSubstring\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBstart\fR\fR, \fBint \fBnum_chars\fR\fR, \fBint \fBbuffer_size\fR\fR, \fBchar *\fBbuffer\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetSubstring\fP retrieves a copy of a portion of the internal text buffer of a Text widget\&. The function copies a specified number of characters from a given start position in the internal text buffer into a buffer provided by the application\&. A NULL terminator is placed at the end of the copied data\&. .PP The size of the required buffer depends on the maximum number of bytes per character (\fBMB_CUR_MAX\fP) for the current locale\&. \fBMB_CUR_MAX\fP is a macro defined in \fBstdlib\&.h\fP\&. The buffer should be large enough to contain the substring to be copied and a NULL terminator\&. Use the following equation to calculate the size of buffer the application should provide: .PP .nf \fIbuffer_size\fP = (\fInum_chars\fP* MB_CUR_MAX) + 1 \fB\fR(\fBvoid\fR) .fi .IP "\fIwidget\fP" 10 Specifies the Text widget ID\&. .IP "\fIstart\fP" 10 Specifies the beginning character position from which the data will be retrieved\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .IP "\fInum_chars\fP" 10 Specifies the number of characters to be copied into the provided buffer\&. .IP "\fIbuffer_size\fP" 10 Specifies the size of the supplied buffer in bytes\&. This size should account for a NULL terminator\&. .IP "\fIbuffer\fP" 10 Specifies the character buffer into which the internal text buffer will be copied\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .IP "\fBXmCOPY_SUCCEEDED\fP" 10 The function was successful\&. .IP "\fBXmCOPY_FAILED\fP" 10 The function failed because it was unable to copy the specified number of characters into the buffer provided\&. The buffer size may be insufficient\&. The contents of \fIbuffer\fP are undefined\&. .IP "\fBXmCOPY_TRUNCATED\fP" 10 The requested number of characters extended beyond the internal buffer\&. The function copied characters between \fIstart\fP and the end of the widget\&'s buffer and terminated the string with a NULL terminator; fewer than \fInum_chars\fP characters were copied\&. .SH "RELATED" .PP \fBXmText\fP(3) and \fBXmTextGetSubstringWcs\fP(3)\&. .\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35