Home | History | Annotate | Download | only in Modules

Lines Matching defs:in

2 ** Routines to represent binary data in ASCII and vice-versa
12 ** short binary data is zero-extended (so the bits are always in the
13 ** right place), this does *not* reflect in the length.
16 ** each char encodes 6 bits, in similar order as uucode/hqx. Encoding
18 ** Short binary data is filled (in ASCII) with '='.
28 ** Short binary data results in the runt ascii-byte being output with
29 ** the bits in the right place.
34 ** Programs that encode binary data in ASCII are written in
37 ** in unrelated sourcefiles, putting functions in include files,
50 ** in a mail message with little difficulty (maximum line sizes, protecting
206 /* First byte: binary data length (in bytes) */
228 ** The 64 in stead of the expected 63 is because
241 ** Shift it in on the low end, and see if there's
259 /* Extra '`' may be written as padding in some cases */
290 /* The 45 is a limit that appears in all uuencode's */
426 ** Shift it in on the low end, and see if there's
492 newline. Note that 'b' gets encoded as 'Yg==\n' (1 in, 5 out). */
621 Py_ssize_t in, inend, len;
642 for( in=0; in<len; in++) {
643 ch = in_data[in];
650 for(inend=in+1;
652 inend < in+255;
654 if ( inend - in > 3 ) {
655 /* More than 3 in a row. Output RLE. */
658 *out_data++ = inend-in;
659 in = inend-1;
797 ** in case of an orphaned RLE code).
884 /* In Python 2.x we return a signed integer regardless of native platform
900 * check sequence in ADCCP (ANSI X3.66, also known as FIPS PUB 71 *|
904 * this polynomial is or will be included in CCITT V.41, which *|
917 Note that we take it "backwards" and put the highest-order term in
919 X^31 term, etc. The X^0 term (usually shown as "+1") results in
924 chunks at a time) shifts bits into the lowest-order term. In our
926 do it this way? Because the calculated CRC must be transmitted in
928 characters in order from LSB to MSB. By storing the CRC this way,
929 we hand it to the UART in the order low-byte to high-byte; the UART
945 the polynomial in question and use exactly the same "updcrc",
953 logic; the shift must be unsigned (bring in zeroes). On some
954 in assembler by
1181 Py_ssize_t in, out;
1208 in = out = 0;
1209 while (in < datalen) {
1210 if (data[in] == '=') {
1211 in++;
1212 if (in >= datalen) break;
1214 if ((data[in] == '\n') || (data[in] == '\r')) {
1215 if (data[in] != '\n') {
1216 while (in < datalen && data[in] != '\n') in++;
1218 if (in < datalen) in++;
1220 else if (data[in] == '=') {
1223 in++;
1225 else if ((in + 1 < datalen) &&
1226 ((data[in] >= 'A' && data[in] <= 'F') ||
1227 (data[in] >= 'a' && data[in] <= 'f') ||
1228 (data[in] >= '0' && data[in] <= '9')) &&
1229 ((data[in+1] >= 'A' && data[in+1] <= 'F') ||
1230 (data[in+1] >= 'a' && data[in+1] <= 'f') ||
1231 (data[in+1] >= '0' && data[in+1] <= '9'))) {
1233 ch = hexval(data[in]) << 4;
1234 in++;
1235 ch |= hexval(data[in]);
1236 in++;
1243 else if (header && data[in] == '_') {
1245 in++;
1248 odata[out] = data[in];
1249 in++;
1284 * module bug where text ending in CRLF has the CR encoded */
1288 Py_ssize_t in, out;
1318 in = 0;
1319 while (in < datalen) {
1321 if ((data[in] > 126) ||
1322 (data[in] == '=') ||
1323 (header && data[in] == '_') ||
1324 ((data[in] == '.') && (linelen == 0) &&
1325 (in + 1 == datalen || data[in+1] == '\n' ||
1326 data[in+1] == '\r' || data[in+1] == 0)) ||
1327 (!istext && ((data[in] == '\r') || (data[in] == '\n'))) ||
1328 ((data[in] == '\t' || data[in] == ' ') && (in + 1 == datalen)) ||
1329 ((data[in] < 33) &&
1330 (data[in] != '\r') && (data[in] != '\n') &&
1332 (!quotetabs && ((data[in] != '\t') && (data[in] != ' '))))))
1343 in++;
1347 ((data[in] == '\n') ||
1348 ((in+1 < datalen) && (data[in] == '\r') &&
1349 (data[in+1] == '\n'))))
1353 if (in && ((data[in-1] == ' ') || (data[in-1] == '\t')))
1359 if (data[in] == '\r')
1360 in += 2;
1362 in++;
1365 if ((in + 1 != datalen) &&
1366 (data[in+1] != '\n') &&
1376 in++;
1399 in = out = linelen = 0;
1400 while (in < datalen) {
1401 if ((data[in] > 126) ||
1402 (data[in] == '=') ||
1403 (header && data[in] == '_') ||
1404 ((data[in] == '.') && (linelen == 0) &&
1405 (in + 1 == datalen || data[in+1] == '\n' ||
1406 data[in+1] == '\r' || data[in+1] == 0)) ||
1407 (!istext && ((data[in] == '\r') || (data[in] == '\n'))) ||
1408 ((data[in] == '\t' || data[in] == ' ') && (in + 1 == datalen)) ||
1409 ((data[in] < 33) &&
1410 (data[in] != '\r') && (data[in] != '\n') &&
1411 (quotetabs || ((data[in] != '\t') && (data[in] != ' ')))))
1420 to_hex(data[in], &odata[out]);
1422 in++;
1427 ((data[in] == '\n') ||
1428 ((in+1 < datalen) && (data[in] == '\r') &&
1429 (data[in+1] == '\n'))))
1442 if (data[in] == '\r')
1443 in += 2;
1445 in++;
1448 if ((in + 1 != datalen) &&
1449 (data[in+1] != '\n') &&
1457 if (header && data[in] == ' ') {
1459 in++;
1462 odata[out++] = data[in++];
1477 /* List of functions defined in the module */