Lines Matching defs:buf

1219     char buf[INET_ADDRSTRLEN];
1220 if (inet_ntop(AF_INET, &addr->sin_addr, buf, sizeof(buf)) == NULL) {
1224 return PyUnicode_FromString(buf);
1233 char buf[INET6_ADDRSTRLEN];
1234 if (inet_ntop(AF_INET6, &addr->sin6_addr, buf, sizeof(buf)) == NULL) {
1238 return PyUnicode_FromString(buf);
1288 char buf[(6 * 2) + 5 + 1];
1298 sprintf(buf, "%02X:%02X:%02X:%02X:%02X:%02X",
1302 sprintf(buf, "%02X:%02X:%02X:%02X:%02X:%02X",
1307 return PyUnicode_FromString(buf);
1612 char *buf;
1633 data->buf = PyBytes_AsString(obj);
1637 data->buf = PyByteArray_AsString(obj);
1645 data->buf = PyUnicode_DATA(obj);
1656 data->buf = PyBytes_AS_STRING(obj2);
1665 if (strlen(data->buf) != len) {
1706 if (path.len == 0 || *(const char *)path.buf == 0) {
1733 memcpy(addr->sun_path, path.buf, path.len);
1847 result = setipaddr(host.buf, (struct sockaddr *)addr,
1892 result = setipaddr(host.buf, (struct sockaddr *)addr,
2055 if (haddr.buf && haddr.len > 8) {
2074 if (haddr.buf) {
2075 memcpy(&addr->sll_addr, haddr.buf, haddr.len);
3041 optval.buf, (int)optval.len);
3043 res = setsockopt(s->sock_fd, level, optname, optval.buf, optval.len);
3076 PyObject *buf;
3116 buf = PyBytes_FromStringAndSize((char *)NULL, buflen);
3117 if (buf == NULL)
3120 (void *)PyBytes_AS_STRING(buf), &buflen);
3122 Py_DECREF(buf);
3125 _PyBytes_Resize(&buf, buflen);
3126 return buf;
3548 PyObject *buf;
3560 buf = PyBytes_FromStringAndSize((char *) 0, recvlen);
3561 if (buf == NULL)
3565 outlen = sock_recv_guts(s, PyBytes_AS_STRING(buf), recvlen, flags);
3569 Py_DECREF(buf);
3575 _PyBytes_Resize(&buf, outlen);
3578 return buf;
3599 char *buf;
3606 buf = pbuf.buf;
3629 readlen = sock_recv_guts(s, buf, recvlen, flags);
3731 PyObject *buf = NULL;
3746 buf = PyBytes_FromStringAndSize((char *) 0, recvlen);
3747 if (buf == NULL)
3750 outlen = sock_recvfrom_guts(s, PyBytes_AS_STRING(buf),
3759 if (_PyBytes_Resize(&buf, outlen) < 0)
3764 ret = PyTuple_Pack(2, buf, addr);
3767 Py_XDECREF(buf);
3787 char *buf;
3796 buf = pbuf.buf;
3815 readlen = sock_recvfrom_guts(s, buf, recvlen, flags, &addr);
3999 PyObject **buf = data;
4001 if (received < PyBytes_GET_SIZE(*buf))
4002 _PyBytes_Resize(buf, received);
4003 Py_XINCREF(*buf);
4004 return *buf;
4015 PyObject *buf = NULL, *retval = NULL;
4024 if ((buf = PyBytes_FromStringAndSize(NULL, bufsize)) == NULL)
4026 iov.iov_base = PyBytes_AS_STRING(buf);
4030 object here (&buf); makeval_recvmsg() may incref the object, or
4033 &makeval_recvmsg, &buf);
4034 Py_XDECREF(buf);
4113 iovs[nbufs].iov_base = bufs[nbufs].buf;
4164 char *buf;
4178 ctx->result = send(s->sock_fd, ctx->buf, (int)ctx->len, ctx->flags);
4180 ctx->result = send(s->sock_fd, ctx->buf, ctx->len, ctx->flags);
4201 ctx.buf = pbuf.buf;
4226 char *buf;
4239 buf = pbuf.buf;
4264 ctx.buf = buf;
4272 buf += n;
4302 char *buf;
4318 ctx->result = sendto(s->sock_fd, ctx->buf, (int)ctx->len, ctx->flags,
4321 ctx->result = sendto(s->sock_fd, ctx->buf, ctx->len, ctx->flags,
4374 ctx.buf = pbuf.buf;
4451 iovs[ndatabufs].iov_base = databufs[ndatabufs].buf;
4627 memcpy(CMSG_DATA(cmsgh), cmsgs[i].data.buf, data_len);
4745 if (iv.buf != NULL) {
4784 if (iv.buf != NULL) {
4796 memcpy(alg_iv->iv, iv.buf, iv.len);
4824 if (iv.buf != NULL) {
5473 wchar_t buf[MAX_COMPUTERNAME_LENGTH + 1];
5474 DWORD size = Py_ARRAY_LENGTH(buf);
5478 if (GetComputerNameExW(ComputerNamePhysicalDnsHostname, buf, &size))
5479 return PyUnicode_FromWideChar(buf, size);
5506 char buf[1024];
5509 res = gethostname(buf, (int) sizeof buf - 1);
5513 buf[sizeof buf - 1] = '\0';
5514 return PyUnicode_DecodeFSDefault(buf);
5533 Py_buffer buf;
5553 res = PyObject_GetBuffer(hnobj, &buf, PyBUF_SIMPLE);
5555 res = sethostname(buf.buf, buf.len);
5556 PyBuffer_Release(&buf);
5758 char buf[16384];
5759 int buf_len = (sizeof buf) - 1;
5777 gethostbyname_r(name, &hp_allocated, buf, buf_len,
5780 h = gethostbyname_r(name, &hp_allocated, buf, buf_len, &errnop);
5833 /* glibcs up to 2.10 assume that the buf argument to
5837 char buf[16384] Py_ALIGNED(8);
5838 int buf_len = (sizeof buf) - 1;
5879 &hp_allocated, buf, buf_len,
5883 &hp_allocated, buf, buf_len, &errnop);
6327 struct in_addr buf;
6348 if (inet_aton(ip_addr, &buf))
6349 return PyBytes_FromStringAndSize((char *)(&buf),
6350 sizeof(buf));
6412 memcpy(&packed_addr, packed_ip.buf, packed_ip.len);
6518 retval = inet_ntop(af, packed_ip.buf, ip, sizeof(ip));
6828 WCHAR buf[NDIS_IF_MAX_STRING_SIZE + 1];
6829 if ((ret = ConvertInterfaceLuidToNameW(&r.InterfaceLuid, buf,
6830 Py_ARRAY_LENGTH(buf)))) {
6836 PyObject *tuple = Py_BuildValue("Iu", r.InterfaceIndex, buf);