cpython/Modules/clinic/socketmodule.c.h

/*[clinic input]
preserve
[clinic start generated code]*/

#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
#  include "pycore_gc.h"          // PyGC_Head
#  include "pycore_runtime.h"     // _Py_ID()
#endif
#include "pycore_critical_section.h"// Py_BEGIN_CRITICAL_SECTION()
#include "pycore_modsupport.h"    // _PyArg_UnpackKeywords()

PyDoc_STRVAR(_socket_socket_close__doc__,
"close($self, /)\n"
"--\n"
"\n"
"close()\n"
"\n"
"Close the socket.  It cannot be used after this call.");

#define _SOCKET_SOCKET_CLOSE_METHODDEF

static PyObject *
_socket_socket_close_impl(PySocketSockObject *s);

static PyObject *
_socket_socket_close(PySocketSockObject *s, PyObject *Py_UNUSED(ignored))
{}

static int
sock_initobj_impl(PySocketSockObject *self, int family, int type, int proto,
                  PyObject *fdobj);

static int
sock_initobj(PyObject *self, PyObject *args, PyObject *kwargs)
{}

PyDoc_STRVAR(_socket_socket_ntohs__doc__,
"ntohs($self, x, /)\n"
"--\n"
"\n"
"Convert a 16-bit unsigned integer from network to host byte order.");

#define _SOCKET_SOCKET_NTOHS_METHODDEF

static PyObject *
_socket_socket_ntohs_impl(PySocketSockObject *self, int x);

static PyObject *
_socket_socket_ntohs(PySocketSockObject *self, PyObject *arg)
{}

PyDoc_STRVAR(_socket_socket_htons__doc__,
"htons($self, x, /)\n"
"--\n"
"\n"
"Convert a 16-bit unsigned integer from host to network byte order.");

#define _SOCKET_SOCKET_HTONS_METHODDEF

static PyObject *
_socket_socket_htons_impl(PySocketSockObject *self, int x);

static PyObject *
_socket_socket_htons(PySocketSockObject *self, PyObject *arg)
{}

PyDoc_STRVAR(_socket_socket_inet_aton__doc__,
"inet_aton($self, ip_addr, /)\n"
"--\n"
"\n"
"Convert an IP address in string format (123.45.67.89) to the 32-bit packed binary format used in low-level network functions.");

#define _SOCKET_SOCKET_INET_ATON_METHODDEF

static PyObject *
_socket_socket_inet_aton_impl(PySocketSockObject *self, const char *ip_addr);

static PyObject *
_socket_socket_inet_aton(PySocketSockObject *self, PyObject *arg)
{}

#if defined(HAVE_INET_NTOA)

PyDoc_STRVAR(_socket_socket_inet_ntoa__doc__,
"inet_ntoa($self, packed_ip, /)\n"
"--\n"
"\n"
"Convert an IP address from 32-bit packed binary format to string format.");

#define _SOCKET_SOCKET_INET_NTOA_METHODDEF

static PyObject *
_socket_socket_inet_ntoa_impl(PySocketSockObject *self, Py_buffer *packed_ip);

static PyObject *
_socket_socket_inet_ntoa(PySocketSockObject *self, PyObject *arg)
{}

#endif /* defined(HAVE_INET_NTOA) */

#if (defined(HAVE_IF_NAMEINDEX) || defined(MS_WINDOWS))

PyDoc_STRVAR(_socket_socket_if_nametoindex__doc__,
"if_nametoindex($self, oname, /)\n"
"--\n"
"\n"
"Returns the interface index corresponding to the interface name if_name.");

#define _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF

static PyObject *
_socket_socket_if_nametoindex_impl(PySocketSockObject *self, PyObject *oname);

static PyObject *
_socket_socket_if_nametoindex(PySocketSockObject *self, PyObject *arg)
{}

#endif /* (defined(HAVE_IF_NAMEINDEX) || defined(MS_WINDOWS)) */

#ifndef _SOCKET_SOCKET_INET_NTOA_METHODDEF
    #define _SOCKET_SOCKET_INET_NTOA_METHODDEF
#endif /* !defined(_SOCKET_SOCKET_INET_NTOA_METHODDEF) */

#ifndef _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF
    #define _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF
#endif /* !defined(_SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF) */
/*[clinic end generated code: output=59c36bb31b05de68 input=a9049054013a1b77]*/