Changeset e71b09a


Ignore:
Timestamp:
Jan 31, 2024, 12:14:17 PM (3 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
32490deb
Parents:
3da5885
Message:

more word-smithing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/user/user.tex

    r3da5885 re71b09a  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Sun Jan 28 13:28:23 2024
    14 %% Update Count     : 5979
     13%% Last Modified On : Tue Jan 30 09:02:41 2024
     14%% Update Count     : 6046
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    41484148The goal of \CFA stream input/output (I/O) is to simplify the common cases\index{I/O!common case}, while fully supporting polymorphism and user defined types in a consistent way.
    41494149Stream I/O can be implicitly or explicitly formatted.
    4150 Implicit formatting means \CFA selects the output or input format for values that matches the variable's type.
    4151 Explicit formatting means additional information is specified to augment how an output or input of value is interpreted.
     4150Implicit formatting means \CFA selects an I/O format for values that matches a variable's type.
     4151Explicit formatting means additional I/O information is specified to control how a value is interpreted.
     4152
    41524153\CFA formatting incorporates ideas from C ©printf©, \CC ©stream© manipulators, and Python implicit spacing and newline.
    41534154Specifically:
     
    41574158\CFA/\CC format manipulators are named, making them easier to read and remember.
    41584159\item
    4159 ©printf©/Python separates format codes from associated variables, making it difficult to match codes with variables.
     4160©printf©/Python separate format codes from associated variables, making it difficult to match codes with variables.
    41604161\CFA/\CC co-locate codes with associated variables, where \CFA has the tighter binding.
    41614162\item
    4162 Format manipulators in \CFA have local effect, whereas \CC have global effect, except ©setw©.
    4163 Hence, it is common programming practice to toggle manipulators on and then back to the default to prevent downstream side-effects.
     4163Format manipulators in ©printf©/Python/\CFA have local effect, whereas \CC have global effect, except ©setw©.
     4164Hence, it is common \CC programming practice to toggle manipulators on and then back to the default to prevent downstream side-effects.
    41644165Without this programming style, errors occur when moving prints, as manipulator effects incorrectly flow into the new location.
    41654166Furthermore, to guarantee no side-effects, manipulator values must be saved and restored across function calls.
     4167\CC programers never do any of this.
    41664168\item
    41674169\CFA has more sophisticated implicit value spacing than Python, plus implicit newline at the end of a print.
    41684170\end{itemize}
    41694171
    4170 The standard polymorphic I/Os stream are ©stdin©/©sin© (input), ©stdout©/©sout© and ©stderr©/©serr© (output) (like C++ ©cin©/©cout©/©cerr©).
    4171 Polymorphic streams ©exit© and ©abort© provide implicit program termination without and with generating a stack trace and core file.
    4172 Stream ©exit© implicitly returns ©EXIT_FAILURE© to the shell.
    4173 \begin{cfa}
    4174 ®exit®   | "x (" | x | ") negative value.";   // terminate and return EXIT_FAILURE to shell
    4175 ®abort® | "x (" | x | ") negative value.";   // terminate and generate stack trace and core file
    4176 \end{cfa}
    4177 Note, \CFA stream variables ©stdin©, ©stdout©, ©stderr©, ©exit©, and ©abort© overload C variables ©stdin©, ©stdout©, ©stderr©, and functions ©exit© and ©abort©, respectively.
     4172
     4173\subsection{Basic I/O}
     4174
     4175The standard polymorphic I/O streams are ©stdin©/©sin© (input), ©stdout©/©sout©, and ©stderr©/©serr© (output) (like C++ ©cin©/©cout©/©cerr©).
     4176The standard I/O operator is the bit-wise (or) operator, ©'|'©, which is used to cascade multiple I/O operations.
    41784177The \CFA header file for the I/O library is \Indexc{fstream.hfa}.
    4179 
    4180 
    4181 \subsection{Basic I/O}
    41824178
    41834179For implicit formatted output, the common case is printing a series of variables separated by whitespace.
     
    422242181®, ®2®, ®3 4®, ®5®, ®6
    42234219\end{cfa}
    4224 Finally, \CFA uses the logical-or operator for I/O as it is the lowest-priority \emph{overloadable} operator, other than assignment.
     4220The bit-wise ©|© operator is used for I/O, rather \CC shift-operators, ©<<© and ©>>©, as it is the lowest-priority \emph{overloadable} operator, other than assignment.
     4221(Operators ©||© and ©&&© are not overloadable in \CFA.)
    42254222Therefore, fewer output expressions require parenthesis.
    42264223\begin{cquote}
     
    42454242\end{cquote}
    42464243There is a weak similarity between the \CFA logical-or operator and the \Index{Shell pipe-operator} for moving data, where data flows in the correct direction for input but the opposite direction for output.
    4247 Input and output use a uniform operator, ©|©, rather than \CC's ©<<© and ©>>© input/output operators, which prevents this common error in \CC:
     4244Input and output use a uniform operator, ©|©, rather than \CC's ©<<© and ©>>© input/output operators to prevent this common error in \CC:
    42484245\begin{C++}
    42494246cin << i; // why is this generating a lot of error messages?
    42504247\end{C++}
     4248
     4249Streams ©exit© and ©abort© provide output with immediate program termination without and with generating a stack trace and core file.
     4250Stream ©exit© implicitly returns ©EXIT_FAILURE© to the shell.
     4251\begin{cfa}
     4252®exit®   | "x (" | x | ") negative value.";     §\C{// print, terminate, and return EXIT\_FAILURE to shell}§
     4253®abort® | "x (" | x | ") negative value.";      §\C{// print, terminate, and generate stack trace and core file}§
     4254\end{cfa}
     4255Note, \CFA stream variables ©stdin©, ©stdout©, ©stderr©, ©exit©, and ©abort© overload C variables ©stdin©, ©stdout©, ©stderr©, and functions ©exit© and ©abort©, respectively.
    42514256
    42524257For implicit formatted input, the common case is reading a sequence of values separated by whitespace, where the type of an input constant must match with the type of the input variable.
     
    42914296\end{tabular}
    42924297\end{cquote}
    4293 
    4294 \VRef[Figure]{f:CFACommand-LineProcessing} shows idiomatic \CFA command-line processing and copying an input file to an output file.
     4298The format of numeric input values in the same as C constants without a trailing type suffix, as the input value-type is denoted by the input variable.
     4299For ©bool© type, the constants are ©true© and ©false©.
     4300For integral types, any number of digits, optionally preceded by a sign (©+© or ©-©), where a
     4301\begin{itemize}
     4302\item
     4303©1©-©9© prefix introduces a decimal value (©0©-©9©),
     4304\item
     4305©0© prefix introduces an octal value (©0©-©7©), and
     4306\item
     4307©0x© or ©0X© prefix introduces a hexadecimal value (©0©-©f©) with lower or upper case letters.
     4308\end{itemize}
     4309For floating-point types, any number of decimal digits, optionally preceded by a sign (©+© or ©-©), optionally containing a decimal point, and optionally followed by an exponent, ©e© or ©E©, with signed (optional) decimal digits.
     4310Floating-point values can also be written in hexadecimal format preceded by ©0x© or ©0X© with hexadecimal digits and exponent denoted by ©p© or ©P©.
     4311In all cases, all whitespace characters are skipped until an appropriate value is found.
     4312\Textbf{If an appropriate value is not found, the exception ©missing_data© is raised.}
     4313
     4314For the C-string type, there are two input forms: any number of \Textbf{non-whitespace} characters or a quoted sequence containing any characters except the closing quote, \ie there is no escape character supported in the string..
     4315In both cases, the string is null terminated ©'\0'©.
     4316For the quoted string, the start and end quote characters can be any character and do not have to match \see{\ref{XXX}}.
     4317
     4318\VRef[Figure]{f:IOStreamFunctions} shows the I/O stream operations for interacting with files other than ©cin©, ©cout©, and ©cerr©.
     4319\begin{itemize}[topsep=4pt,itemsep=2pt,parsep=0pt]
     4320\item
     4321\Indexc{fail} tests the stream error-indicator, returning nonzero if it is set.
     4322\item
     4323\Indexc{clear} resets the stream error-indicator.
     4324\item
     4325\Indexc{flush} (©ofstream© only) causes any unwritten data for a stream to be written to the file.
     4326\item
     4327\Indexc{eof} (©ifstream© only) tests the end-of-file indicator for the stream pointed to by stream.
     4328Returns true if the end-of-file indicator is set, otherwise false.
     4329\item
     4330\Indexc{open} binds the file with ©name© to a stream accessed with ©mode© (see ©fopen©).
     4331\item
     4332\Indexc{close} flushes the stream and closes the file.
     4333\item
     4334\Indexc{write} (©ofstream© only) writes ©size© bytes to the stream.
     4335The bytes are written lazily when an internal buffer fills.
     4336Eager buffer writes are done with ©flush©
     4337\item
     4338\Indexc{read} (©ifstream© only) reads ©size© bytes from the stream.
     4339\item
     4340\Indexc{ungetc} (©ifstream© only) pushes the character back to the input stream.
     4341Pushed-back characters returned by subsequent reads in the reverse order of pushing.
     4342\end{itemize}
     4343The constructor functions:
     4344\begin{itemize}[topsep=4pt,itemsep=2pt,parsep=0pt]
     4345\item
     4346create an unbound stream, which is subsequently bound to a file with ©open©.
     4347\item
     4348create a bound stream to the associated file with given ©mode©.
     4349\end{itemize}
     4350The destructor closes the stream.
     4351
     4352\begin{figure}
     4353\begin{cfa}
     4354// *********************************** ofstream ***********************************
     4355bool fail( ofstream & );§\indexc{fail}\index{ofstream@©ofstream©!©fail©}§
     4356void clear( ofstream & );§\indexc{clear}\index{ofstream@©ofstream©!©clear©}§
     4357int flush( ofstream & );§\indexc{flush}\index{ofstream@©ofstream©!©flush©}§
     4358void open( ofstream &, const char name[], const char mode[] = "w" );§\indexc{open}\index{ofstream@©ofstream©!©open©}§
     4359void close( ofstream & );§\indexc{close}\index{ofstream@©ofstream©!©close©}§
     4360ofstream & write( ofstream &, const char data[], size_t size );§\indexc{write}\index{ofstream@©ofstream©!©write©}§
     4361void ?{}( ofstream & );§\index{ofstream@©ofstream©!©?{}©}§
     4362void ?{}( ofstream &, const char name[], const char mode[] = "w" );
     4363void ^?{}( ofstream & );§\index{ofstream@©ofstream©!©^?{}©}§
     4364
     4365// *********************************** ifstream ***********************************
     4366bool fail( ifstream & is );§\indexc{fail}\index{ifstream@©ifstream©!©fail©}§
     4367void clear( ifstream & );§\indexc{clear}\index{ifstream@©ifstream©!©clear©}§
     4368bool eof( ifstream & is );§\indexc{eof}\index{ifstream@©ifstream©!©eof©}§
     4369void open( ifstream & is, const char name[], const char mode[] = "r" );§\indexc{open}\index{ifstream@©ifstream©!©open©}§
     4370void close( ifstream & is );§\indexc{close}\index{ifstream@©ifstream©!©close©}§
     4371ifstream & read( ifstream & is, char data[], size_t size );§\indexc{read}\index{ifstream@©ifstream©!©read©}§
     4372ifstream & ungetc( ifstream & is, char c );§\indexc{unget}\index{ifstream@©ifstream©!©unget©}§
     4373void ?{}( ifstream & is );§\index{ifstream@©ifstream©!©?{}©}§
     4374void ?{}( ifstream & is, const char name[], const char mode[] = "r" );
     4375void ^?{}( ifstream & is );§\index{ifstream@©ifstream©!©^?{}©}§
     4376\end{cfa}
     4377\caption{I/O Stream Functions}
     4378\label{f:IOStreamFunctions}
     4379\end{figure}
     4380
     4381\VRef[Figure]{f:CFACommand-LineProcessing} demonstrates the file operations by showing the idiomatic \CFA command-line processing and copying an input file to an output file.
    42954382Note, a stream variable may be copied because it is a reference to an underlying stream data-structures.
    4296 All I/O errors are handles as exceptions, but end-of-file is not an exception as C programmers are use to explicitly checking for it.
     4383\Textbf{All I/O errors are handled as exceptions}, but end-of-file is not an exception as C programmers are use to explicitly checking for it.
    42974384
    42984385\begin{figure}
     
    43354422\end{figure}
    43364423
    4337 \VRef[Figure]{f:StreamFunctions} shows the stream operations.
    4338 \begin{itemize}[topsep=4pt,itemsep=2pt,parsep=0pt]
    4339 \item
    4340 \Indexc{fail} tests the stream error-indicator, returning nonzero if it is set.
    4341 \item
    4342 \Indexc{clear} resets the stream error-indicator.
    4343 \item
    4344 \Indexc{flush} (©ofstream© only) causes any unwritten data for a stream to be written to the file.
    4345 \item
    4346 \Indexc{eof} (©ifstream© only) tests the end-of-file indicator for the stream pointed to by stream.
    4347 Returns true if the end-of-file indicator is set, otherwise false.
    4348 \item
    4349 \Indexc{open} binds the file with ©name© to a stream accessed with ©mode© (see ©fopen©).
    4350 \item
    4351 \Indexc{close} flushes the stream and closes the file.
    4352 \item
    4353 \Indexc{write} (©ofstream© only) writes ©size© bytes to the stream.
    4354 The bytes are written lazily when an internal buffer fills.
    4355 Eager buffer writes are done with ©flush©
    4356 \item
    4357 \Indexc{read} (©ifstream© only) reads ©size© bytes from the stream.
    4358 \item
    4359 \Indexc{ungetc} (©ifstream© only) pushes the character back to the input stream.
    4360 Pushed-back characters returned by subsequent reads in the reverse order of pushing.
    4361 \end{itemize}
    4362 The constructor functions:
    4363 \begin{itemize}[topsep=4pt,itemsep=2pt,parsep=0pt]
    4364 \item
    4365 create an unbound stream, which is subsequently bound to a file with ©open©.
    4366 \item
    4367 create a bound stream to the associated file with given ©mode©.
    4368 \end{itemize}
    4369 The destructor closes the stream.
    4370 
    4371 \begin{figure}
    4372 \begin{cfa}
    4373 // *********************************** ofstream ***********************************
    4374 
    4375 bool fail( ofstream & );§\indexc{fail}\index{ofstream@©ofstream©!©fail©}§
    4376 void clear( ofstream & );§\indexc{clear}\index{ofstream@©ofstream©!©clear©}§
    4377 int flush( ofstream & );§\indexc{flush}\index{ofstream@©ofstream©!©flush©}§
    4378 void open( ofstream &, const char name[], const char mode[] = "w" );§\indexc{open}\index{ofstream@©ofstream©!©open©}§
    4379 void close( ofstream & );§\indexc{close}\index{ofstream@©ofstream©!©close©}§
    4380 ofstream & write( ofstream &, const char data[], size_t size );§\indexc{write}\index{ofstream@©ofstream©!©write©}§
    4381 
    4382 void ?{}( ofstream & );§\index{ofstream@©ofstream©!©?{}©}§
    4383 void ?{}( ofstream &, const char name[], const char mode[] = "w" );
    4384 void ^?{}( ofstream & );§\index{ofstream@©ofstream©!©^?{}©}§
    4385 
    4386 // *********************************** ifstream ***********************************
    4387 
    4388 bool fail( ifstream & is );§\indexc{fail}\index{ifstream@©ifstream©!©fail©}§
    4389 void clear( ifstream & );§\indexc{clear}\index{ifstream@©ifstream©!©clear©}§
    4390 bool eof( ifstream & is );§\indexc{eof}\index{ifstream@©ifstream©!©eof©}§
    4391 void open( ifstream & is, const char name[], const char mode[] = "r" );§\indexc{open}\index{ifstream@©ifstream©!©open©}§
    4392 void close( ifstream & is );§\indexc{close}\index{ifstream@©ifstream©!©close©}§
    4393 ifstream & read( ifstream & is, char data[], size_t size );§\indexc{read}\index{ifstream@©ifstream©!©read©}§
    4394 ifstream & ungetc( ifstream & is, char c );§\indexc{unget}\index{ifstream@©ifstream©!©unget©}§
    4395 
    4396 void ?{}( ifstream & is );§\index{ifstream@©ifstream©!©?{}©}§
    4397 void ?{}( ifstream & is, const char name[], const char mode[] = "r" );
    4398 void ^?{}( ifstream & is );§\index{ifstream@©ifstream©!©^?{}©}§
    4399 \end{cfa}
    4400 \caption{Stream Functions}
    4401 \label{f:StreamFunctions}
    4402 \end{figure}
    4403 
    44044424
    44054425\subsection{Implicit Separator}
    44064426
    44074427The \Index{implicit separator}\index{I/O!separator} character (space/blank) is a separator not a terminator for output.
    4408 The rules for implicitly adding the separator are:
     4428The rules for implicitly adding a separator are:
    44094429\begin{enumerate}
    44104430\item
     
    44384458\end{cfa}
    44394459\begin{cfa}[showspaces=true]
    4440 1®,® x 2®.® x 3®;® x 4®!® x 5®?® x 6®%® x 7§\R{\LstStringStyle{\textcent}}§ x 8§\R{\LstStringStyle{\guillemotright}}§ x 9®)® x 10®]® x 11®}® x
     4460Input1®,® x 2®.® x 3®;® x 4®!® x 5®?® x 6®%® x 7§\R{\LstStringStyle{\textcent}}§ x 8§\R{\LstStringStyle{\guillemotright}}§ x 9®)® x 10®]® x 11®}® x
    44414461\end{cfa}
    44424462
     
    46534673
    46544674
    4655 \subsection{Output Value Manipulators}
     4675\subsection{Output Manipulators}
    46564676
    46574677The following \Index{manipulator}s control formatting (printing) of the argument output values.
     
    49114931
    49124932
    4913 \subsection{Input Value Manipulators}
    4914 
    4915 The format of numeric input values in the same as C constants without a trailing type suffix, as the input value-type is denoted by the input variable.
    4916 For ©bool© type, the constants are ©true© and ©false©.
    4917 For integral types, any number of digits, optionally preceded by a sign (©+© or ©-©), where a
    4918 \begin{itemize}
    4919 \item
    4920 ©1©-©9© prefix introduces a decimal value (©0©-©9©),
    4921 \item
    4922 ©0© prefix introduces an octal value (©0©-©7©), and
    4923 \item
    4924 ©0x© or ©0X© prefix introduces a hexadecimal value (©0©-©f©) with lower or upper case letters.
    4925 \end{itemize}
    4926 For floating-point types, any number of decimal digits, optionally preceded by a sign (©+© or ©-©), optionally containing a decimal point, and optionally followed by an exponent, ©e© or ©E©, with signed (optional) decimal digits.
    4927 Floating-point values can also be written in hexadecimal format preceded by ©0x© or ©0X© with hexadecimal digits and exponent denoted by ©p© or ©P©.
    4928 
    4929 For the C-string type, the input values are \emph{not} the same as C-string constants, \ie double quotes bracketing arbitrary text with escape sequences.
    4930 Instead, the next sequence of non-whitespace characters are read, and the input sequence is terminated with delimiter ©'\0'©.
    4931 The string variable \emph{must} be large enough to contain the input sequence.
     4933\subsection{Input Manipulators}
     4934
     4935The following \Index{manipulator}s control scanning of input values (reading), and only affect the format of the argument.
     4936
     4937Certain manipulators support a \newterm{scanset}, which is a simple regular expression, where the matching set contains any Latin-1 character (8-bits) or character ranges using minus.
     4938For example, the scanset \lstinline{"a-zA-Z -/?§"} matches any number of characters between ©'a'© and ©'z'©, between ©'A'© and ©'Z'©, between space and ©'/'©, and characters ©'?'© and (Latin-1) ©'§'©.
     4939The following string is matched by this scanset:
     4940\begin{cfa}
     4941!&%$  abAA () ZZZ  ??  xx§\S\S\S§
     4942\end{cfa}
     4943To match a minus, put it as the first character, ©"-0-9"©.
     4944Other complex forms of regular-expression matching are not supported.
     4945
     4946A string variable \emph{must} be large enough to contain the input sequence.
    49324947To force programmers to consider buffer overruns for C-string input, C-strings can only be read with a width field, which should specify a size less than or equal to the C-string size, \eg:
    49334948\begin{cfa}
     
    49364951\end{cfa}
    49374952
    4938 A scanset is a simple regular expression, where the matching set contains any Latin-1 character (8-bits) or character ranges using minus.
    4939 For example, the scanset \lstinline{"a-zA-Z -/?§"} matches characters between ©'a'© and ©'z'©, between ©'A'© and ©'Z'©, between space and ©'/'©, and characters ©'?'© and (Latin-1) ©'§'©.
    4940 The following string is matched by this scanset:
    4941 \begin{cfa}
    4942 !&%$  abAA () ZZZ  ??  xx§\S\S\S§
    4943 \end{cfa}
    4944 To match a minus, put it as the first character, ©"-0-9"©.
    4945 Other complex forms of regular-expression matching are not supported.
    4946 
    4947 The following \Index{manipulator}s control scanning of input values (reading), and only affect the format of the argument.
     4953Currently, there is no mechanism to detect if a value read exceeds the capwhen Most types are finite sized, \eg integral types only store value that fit into their corresponding storage, 8, 16, 32, 64, 128 bits.
     4954Hence, an input value may be too large, and the result of the read is often considered undefined, which leads to difficlt to locate runtime errors.
     4955All reads in \CFA check if values do not fit into the argument variable's type and raise the exception
     4956All types are
     4957
    49484958\begin{enumerate}
    49494959\item
    4950 \Indexc{skip}( pattern )\index{manipulator!skip@©skip©}, ©skip©( length )
    4951 The pattern is composed of white-space and non-white-space characters, where \emph{any} white-space character matches 0 or more input white-space characters (hence, consecutive white-space characters in the pattern are combined), and each non-white-space character matches exactly with an input character.
    4952 The length is composed of the next $N$ characters, including the newline character.
     4960\Indexc{skip}( scanset )\index{manipulator!skip@©skip©}, ©skip©( $N$ )
     4961The first form uses a scanset to skip matching characters.
     4962The second form skips the next $N$ characters, including newline.
    49534963If the match successes, the input characters are discarded, and input continues with the next character.
    49544964If the match fails, the input characters are left unread.
     
    49644974
    49654975\item
    4966 \Indexc{wdi}( maximum, reference )\index{manipulator!wdi@©wdi©}
    4967 For all types except ©char *©, maximum is the maximum number of characters read for the current operation.
     4976\Indexc{wdi}( maximum, variable )\index{manipulator!wdi@©wdi©}
     4977For all types except ©char *©, whitespace is skipped until an appropriate value is found for the specified variable type.
     4978maximum is the maximum number of characters read for the current operation.
    49684979\begin{cfa}[belowskip=0pt]
    49694980char ch;   char ca[3];   int i;   double d;   
    4970 sin | wdi( sizeof(ch), ch ) | wdi( sizeof(ca), ca[0] ) | wdi( 3, i ) | wdi( 8, d );  // c == 'a', ca = "bcd", i == 123, d == 345.6
     4981sin | wdi( sizeof(ch), ch ) | wdi( sizeof(ca), ca[0] ) | wdi( 3, i ) | wdi( 8, d );  // c == 'a', ca == "bcd", i == 123, d == 345.6
    49714982\end{cfa}
    49724983\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     
    49774988Note, input ©wdi© cannot be overloaded with output ©wd© because both have the same parameters but return different types.
    49784989Currently, \CFA cannot distinguish between these two manipulators in the middle of an ©sout©/©sin© expression based on return type.
     4990
     4991\item
     4992\Indexc{wdi}( maximum size, ©char s[]© )\index{manipulator!wdi@©wdi©}
     4993For type ©char *©, maximum is the maximum number of characters read for the current operation.
     4994Any number of non-whitespace characters, stopping at the first whitespace character found. A terminating null character is automatically added at the end of the stored sequence
     4995\begin{cfa}[belowskip=0pt]
     4996char cstr[10];
     4997sin | wdi( sizeof(cstr), cstr );
     4998\end{cfa}
     4999\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     5000®abcd1233.456E+2®
     5001\end{cfa}
     5002
     5003\item
     5004\Indexc{wdi}( maximum size, maximum read, ©char s[]© )\index{manipulator!wdi@©wdi©}
     5005For type ©char *©, maximum is the maximum number of characters read for the current operation.
     5006\begin{cfa}[belowskip=0pt]
     5007char ch;   char ca[3];   int i;   double d;   
     5008sin | wdi( sizeof(ch), ch ) | wdi( sizeof(ca), ca[0] ) | wdi( 3, i ) | wdi( 8, d );  // c == 'a', ca == "bcd", i == 123, d == 345.6
     5009\end{cfa}
     5010\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
     5011®abcd1233.456E+2®
     5012\end{cfa}
    49795013
    49805014\item
     
    50135047\end{cfa}
    50145048
     5049\Indexc{quoted}( char delimit, wdi-input-string )\index{manipulator!quoted@©quoted©}
     5050Is an ©excl© with scanset ©"delimit"©, which consumes all characters up to the delimit character.
     5051If the delimit character is omitted, it defaults to ©'\n'© (newline).
     5052
    50155053\item
    50165054\Indexc{getline}( char delimit, wdi-input-string )\index{manipulator!getline@©getline©}
    5017 Is an @excl@ with scanset ©"delimit"©, which consumes all characters up to the delimit character.
     5055Is an ©excl© with scanset ©"delimit"©, which consumes all characters up to the delimit character.
    50185056If the delimit character is omitted, it defaults to ©'\n'© (newline).
    50195057\end{enumerate}
Note: See TracChangeset for help on using the changeset viewer.