Changeset 1b20da0 in mainline for uspace/app/bdsh/cmds/modules/printf/printf.c
- Timestamp:
- 2018-02-28T17:52:03Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3061bc1
- Parents:
- df6ded8
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:26:03)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:52:03)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/printf/printf.c
rdf6ded8 r1b20da0 60 60 61 61 /** Print a formatted data with lib printf. 62 * 62 * 63 63 * Currently available format flags are: 64 64 * '%d' - integer. 65 65 * '%u' - unsigned integer. 66 66 * '%s' - null-terminated string. 67 ***** 67 ***** 68 68 * @param ch formatted flag. 69 69 * @param arg string with data to print. … … 88 88 89 89 /** Process a control character. 90 * 90 * 91 91 * Currently available characters are: 92 92 * '\n' - new line. 93 ***** 93 ***** 94 94 * @param ch Control character. 95 95 */ … … 107 107 108 108 109 /** Prints formatted data. 109 /** Prints formatted data. 110 110 * 111 111 * Accepted format flags: … … 143 143 144 144 case '\\': 145 if (esc_flag) 145 if (esc_flag) 146 146 goto emit; 147 147 esc_flag = true; … … 149 149 150 150 case '%': 151 if (esc_flag) 151 if (esc_flag) 152 152 goto emit; 153 153 ch = str_decode(fmt, &pos, fmt_sz); 154 if (!ch) { 154 if (!ch) { 155 155 putchar('%'); 156 156 break; … … 170 170 break; 171 171 } 172 putchar(ch); 172 putchar(ch); 173 173 break; 174 174 … … 177 177 esc_flag = false; 178 178 } 179 } 179 } 180 180 181 181 return CMD_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.