Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/base85.c @ 3330:a5209a1e53d8
Support buffer interface in base85 codec
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Wed, 11 Oct 2006 09:27:57 -0700 |
parents | e93c926e069e |
children | 4bad632913d8 |
comparison
equal
deleted
inserted
replaced
3329:f472cf9a71af | 3330:a5209a1e53d8 |
---|---|
33 char *dst; | 33 char *dst; |
34 int len, olen, i; | 34 int len, olen, i; |
35 unsigned int acc, val, ch; | 35 unsigned int acc, val, ch; |
36 int pad = 0; | 36 int pad = 0; |
37 | 37 |
38 if (!PyArg_ParseTuple(args, "s#|i", &text, &len, &pad)) | 38 if (!PyArg_ParseTuple(args, "t#|i", &text, &len, &pad)) |
39 return NULL; | 39 return NULL; |
40 | 40 |
41 if (pad) | 41 if (pad) |
42 olen = ((len + 3) / 4 * 5) - 3; | 42 olen = ((len + 3) / 4 * 5) - 3; |
43 else { | 43 else { |
80 const char *text; | 80 const char *text; |
81 char *dst; | 81 char *dst; |
82 int len, i, j, olen, c, cap; | 82 int len, i, j, olen, c, cap; |
83 unsigned int acc; | 83 unsigned int acc; |
84 | 84 |
85 if (!PyArg_ParseTuple(args, "s#", &text, &len)) | 85 if (!PyArg_ParseTuple(args, "t#", &text, &len)) |
86 return NULL; | 86 return NULL; |
87 | 87 |
88 olen = len / 5 * 4; | 88 olen = len / 5 * 4; |
89 i = len % 5; | 89 i = len % 5; |
90 if (i) | 90 if (i) |