MCPcopy Create free account
hub / github.com/coreutils/coreutils / print_esc_char

Function print_esc_char

src/stat.c:1075–1112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1073/* Output a single-character \ escape. */
1074
1075static void
1076print_esc_char (char c)
1077{
1078 switch (c)
1079 {
1080 case 'a': /* Alert. */
1081 c ='\a';
1082 break;
1083 case 'b': /* Backspace. */
1084 c ='\b';
1085 break;
1086 case 'e': /* Escape. */
1087 c ='\x1B';
1088 break;
1089 case 'f': /* Form feed. */
1090 c ='\f';
1091 break;
1092 case 'n': /* New line. */
1093 c ='\n';
1094 break;
1095 case 'r': /* Carriage return. */
1096 c ='\r';
1097 break;
1098 case 't': /* Horizontal tab. */
1099 c ='\t';
1100 break;
1101 case 'v': /* Vertical tab. */
1102 c ='\v';
1103 break;
1104 case '"':
1105 case '\\':
1106 break;
1107 default:
1108 error (0, 0, _("warning: unrecognized escape '\\%c'"), c);
1109 break;
1110 }
1111 putchar (c);
1112}
1113
1114ATTRIBUTE_PURE
1115static size_t

Callers 1

print_itFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected