1 /************************************************************************* 2 * 3 * $Id$ 4 * 5 * Copyright (C) 2001 Bjorn Reese and Daniel Stenberg. 6 * 7 * Permission to use, copy, modify, and distribute this software for any 8 * purpose with or without fee is hereby granted, provided that the above 9 * copyright notice and this permission notice appear in all copies. 10 * 11 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 12 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 13 * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND 14 * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER. 15 * 16 ************************************************************************/ 17 18 /** @addtogroup Scanf Formatted Scanning Functions. 19 Variations of formatted scanning functions. 20 21 @b SYNOPSIS 22 23 @verbatim 24 cc ... -ltrio -lm 25 26 #include <trio.h> 27 @endverbatim 28 29 @b DESCRIPTION 30 31 This documentation is incomplete. 32 The documentation of the scanf family in [C99] and [UNIX98] also applies 33 to the trio counterparts. 34 35 @b SCANNING 36 37 The scanning is controlled by the format string. 38 The format string can contain normal text and conversion indicators. 39 The normal text can be any character except the nil character 40 (\\000) and the percent character (\\045 = '\\%'). 41 Conversion indicators consists of an indication character (%), followed by 42 zero or more conversion modifiers, and exactly one conversion specifier. 43 44 @b Modifiers 45 46 @em Positional ( @c 9$ ) [UNIX98] 47 48 See @ref trio_printf. 49 50 @b Specifiers 51 52 @em Percent ( @c % ) 53 54 @em Character ( @c c ) 55 56 @em Decimal ( @c d ) 57 58 @em Floating-point ( @c a, @c A, @c e, @c E, @c f, @c F, @c g, @c G ) 59 60 @em Integer ( @c i ) 61 62 @em Count ( @c n ) 63 64 @em Octal ( @c o ) 65 66 @em Pointer ( @c p ) 67 68 @em String ( @c s ) 69 70 @em Unsigned ( @c u ) 71 72 @em Hex ( @c x, @c X ) 73 74 @em Scanlist ( @c [] ) 75 76 Scanlist Exclusion (@c ^ ) 77 78 Scanlist Range ( @c - ) [TRIO] 79 80 @li Only increasing ranges, i.e. @c [a-b], but not @c [b-a]. 81 @li Transitive ranges, ie. @c [a-b-c] equals @c [a-c]. 82 @li Trailing minus, ie. @c [a-] is interpreted as an @c a and a @c -. 83 @li Duplicates are ignored. 84 85 Scanlist Equivalence Class Expression ( @c [= @c =] ) [TRIO] 86 87 Locale dependent (LC_COLLATE). 88 Only one expression can appear inside the delimiters. 89 @li @c [=a=] All letters in the same equivalence class as the letter @c a. 90 @verbatim 91 trio_scanf("%[[=a=]b]\n", buffer); 92 trio_scanf("%[[=a=][=b=]]\n", buffer); 93 @endverbatim 94 95 Scanlist Character Class Expression ( @c [: @c :]) [TRIO] 96 Locale dependent (LC_CTYPE). 97 Only one expression can appear inside the delimiters. 98 @li @c [:alnum:] Same as @c [:alpha:] and @c [:digit:] 99 @li @c [:alpha:] Same as @c [:lower:] and @c [:upper:] 100 @li @c [:cntrl:] Control characters 101 @li @c [:digit:] Decimal digits 102 @li @c [:graph:] Printable characters except space 103 @li @c [:lower:] Lower case alphabetic letters 104 @li @c [:print:] Printable characters 105 @li @c [:punct:] Punctuation 106 @li @c [:space:] Whitespace characters 107 @li @c [:upper:] Upper case alphabetic letters 108 @li @c [:xdigit:] Hexadecimal digits 109 @verbatim 110 trio_scanf("%[[:alnum:]]\n", buffer); 111 trio_scanf("%[[:alpha:][:digit:]]\n", buffer); 112 @endverbatim 113 114 @b RETURN @b VALUES 115 116 @b SEE @b ALSO 117 118 @ref trio_printf 119 120 */ 121