PyObject *rc = 0;
if (!PyArg_ParseTuple(arg, "O&:zero", convszt, &sz)) goto end;
rc = bytestring_pywrap(0, sz);
PyObject *rc = 0;
if (!PyArg_ParseTuple(arg, "O&:zero", convszt, &sz)) goto end;
rc = bytestring_pywrap(0, sz);
if (!convbin(x, &xx) || !convbin(y, &yy)) goto end;
zsz = (size_t)xx.sz + (size_t)yy.sz;
if (xx.sz < 0 || yy.sz < 0 || zsz < xx.sz) VALERR("too long");
if (!convbin(x, &xx) || !convbin(y, &yy)) goto end;
zsz = (size_t)xx.sz + (size_t)yy.sz;
if (xx.sz < 0 || yy.sz < 0 || zsz < xx.sz) VALERR("too long");
memcpy(zp, xx.p, xx.sz); memcpy(zp + xx.sz, yy.p, yy.sz);
end:
return (z);
memcpy(zp, xx.p, xx.sz); memcpy(zp + xx.sz, yy.p, yy.sz);
end:
return (z);
if (xsz == 1) memset(zp, *xp, zsz);
else while (zsz) { memcpy(zp, xp, xsz); zp += xsz; zsz -= xsz; }
end:
if (xsz == 1) memset(zp, *xp, zsz);
else while (zsz) { memcpy(zp, xp, xsz); zp += xsz; zsz -= xsz; }
end:
- if (i < 0 || i >= PyString_GET_SIZE(me)) IXERR("out of range");
- rc = bytestring_pywrap(PyString_AS_STRING(me) + i, 1);
+ if (i < 0 || i >= BIN_LEN(me)) IXERR("out of range");
+ rc = bytestring_pywrap(BIN_PTR(me) + i, 1);
if (PyIndex_Check(ix)) {
i = PyNumber_AsSsize_t(ix, PyExc_IndexError);
if (i == -1 && PyErr_Occurred()) return (0);
if (PyIndex_Check(ix)) {
i = PyNumber_AsSsize_t(ix, PyExc_IndexError);
if (i == -1 && PyErr_Occurred()) return (0);
rc = bytestring_pyitem(me, i);
} else if (PySlice_Check(ix)) {
rc = bytestring_pyitem(me, i);
} else if (PySlice_Check(ix)) {
&i, &j, &k, &n))
return (0);
if (k == 1) return bytestring_pyslice(me, i, j);
rc = bytestring_pywrap(0, n);
&i, &j, &k, &n))
return (0);
if (k == 1) return bytestring_pyslice(me, i, j);
rc = bytestring_pywrap(0, n);
if (!convbin(x, &xx) || !convbin(y, &yy)) goto end; \
if (xx.sz != yy.sz) VALERR("length mismatch"); \
rc = bytestring_pywrap(0, xx.sz); \
if (!convbin(x, &xx) || !convbin(y, &yy)) goto end; \
if (xx.sz != yy.sz) VALERR("length mismatch"); \
rc = bytestring_pywrap(0, xx.sz); \
PyObject *rc = 0; \
if (!convbin(x, &xx)) goto end; \
rc = bytestring_pywrap(0, xx.sz); \
PyObject *rc = 0; \
if (!convbin(x, &xx)) goto end; \
rc = bytestring_pywrap(0, xx.sz); \
void bytestring_pyinit(void)
{
INITTYPE(bytestring, string);
void bytestring_pyinit(void)
{
INITTYPE(bytestring, string);