diff options
author | David Sommerseth <davids@redhat.com> | 2014-01-09 19:50:05 +0100 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2014-01-09 19:50:05 +0100 |
commit | 8156c8880b5148fe2ea19950b2229e1bb80b431c (patch) | |
tree | 1a4dac301e3f58fac281bdad8f2f2fde0d859e82 /python-ethtool/etherinfo_obj.c | |
parent | a5308a1856bbf5268b9f51c87ec3da032c371a6f (diff) | |
download | python-ethtool-8156c8880b5148fe2ea19950b2229e1bb80b431c.tar.gz python-ethtool-8156c8880b5148fe2ea19950b2229e1bb80b431c.tar.xz python-ethtool-8156c8880b5148fe2ea19950b2229e1bb80b431c.zip |
cleanup: Rename etherinfo_py and ethtool_etherinfo_Type
Use PyEtherInfo and PyEtherInfoType the base names, to more easily see their
relation, and more clearly indicate they are Python objects.
Also remove an initialisation of PyEtherInfo/etherinfo_py not needed any more.
Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'python-ethtool/etherinfo_obj.c')
-rw-r--r-- | python-ethtool/etherinfo_obj.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/python-ethtool/etherinfo_obj.c b/python-ethtool/etherinfo_obj.c index f2a43c1..f620157 100644 --- a/python-ethtool/etherinfo_obj.c +++ b/python-ethtool/etherinfo_obj.c @@ -34,9 +34,9 @@ /** * ethtool.etherinfo deallocator - cleans up when a object is deleted * - * @param self etherinfo_py Python object to deallocate + * @param self PyEtherInfo Python object to deallocate */ -static void _ethtool_etherinfo_dealloc(etherinfo_py *self) +static void _ethtool_etherinfo_dealloc(PyEtherInfo *self) { close_netlink(self); Py_XDECREF(self->device); self->device = NULL; @@ -79,12 +79,12 @@ static PyNetlinkIPaddress * get_last_ipv4_address(PyObject *addrlist) /** * ethtool.etherinfo function for retrieving data from a Python object. * - * @param self Pointer to the current etherinfo_py device object + * @param self Pointer to the current PyEtherInfo device object * @param attr_o contains the object member request (which element to return) * * @return Returns a PyObject with the value requested on success, otherwise NULL */ -PyObject *_ethtool_etherinfo_getter(etherinfo_py *self, PyObject *attr_o) +PyObject *_ethtool_etherinfo_getter(PyEtherInfo *self, PyObject *attr_o) { char *attr = PyString_AsString(attr_o); PyNetlinkIPaddress *py_addr; @@ -149,7 +149,7 @@ PyObject *_ethtool_etherinfo_getter(etherinfo_py *self, PyObject *attr_o) * * @return Returns always -1 (failure). */ -int _ethtool_etherinfo_setter(etherinfo_py *self, PyObject *attr_o, PyObject *val_o) +int _ethtool_etherinfo_setter(PyEtherInfo *self, PyObject *attr_o, PyObject *val_o) { PyErr_SetString(PyExc_AttributeError, "etherinfo member values are read-only."); return -1; @@ -159,11 +159,11 @@ int _ethtool_etherinfo_setter(etherinfo_py *self, PyObject *attr_o, PyObject *va /** * Creates a human readable format of the information when object is being treated as a string * - * @param self Pointer to the current etherinfo_py device object + * @param self Pointer to the current PyEtherInfo device object * * @return Returns a PyObject with a string with all of the information */ -PyObject *_ethtool_etherinfo_str(etherinfo_py *self) +PyObject *_ethtool_etherinfo_str(PyEtherInfo *self) { PyObject *ret = NULL; PyObject *ipv4addrs = NULL, *ipv6addrs = NULL; @@ -224,12 +224,12 @@ PyObject *_ethtool_etherinfo_str(etherinfo_py *self) /** * Returns a tuple list of configured IPv4 addresses * - * @param self Pointer to the current etherinfo_py device object to extract IPv4 info from + * @param self Pointer to the current PyEtherInfo device object to extract IPv4 info from * @param notused * * @return Returns a Python tuple list of NetlinkIP4Address objects */ -static PyObject *_ethtool_etherinfo_get_ipv4_addresses(etherinfo_py *self, PyObject *notused) { +static PyObject *_ethtool_etherinfo_get_ipv4_addresses(PyEtherInfo *self, PyObject *notused) { if( !self ) { PyErr_SetString(PyExc_AttributeError, "No data available"); return NULL; @@ -242,12 +242,12 @@ static PyObject *_ethtool_etherinfo_get_ipv4_addresses(etherinfo_py *self, PyObj /** * Returns a tuple list of configured IPv6 addresses * - * @param self Pointer to the current etherinfo_py device object to extract IPv6 info from + * @param self Pointer to the current PyEtherInfo device object to extract IPv6 info from * @param notused * * @return Returns a Python tuple list of NetlinkIP6Address objects */ -static PyObject *_ethtool_etherinfo_get_ipv6_addresses(etherinfo_py *self, PyObject *notused) { +static PyObject *_ethtool_etherinfo_get_ipv6_addresses(PyEtherInfo *self, PyObject *notused) { if( !self ) { PyErr_SetString(PyExc_AttributeError, "No data available"); return NULL; @@ -273,10 +273,10 @@ static PyMethodDef _ethtool_etherinfo_methods[] = { * Definition of the functions a Python class/object requires. * */ -PyTypeObject ethtool_etherinfoType = { +PyTypeObject PyEtherInfo_Type = { PyObject_HEAD_INIT(NULL) .tp_name = "ethtool.etherinfo", - .tp_basicsize = sizeof(etherinfo_py), + .tp_basicsize = sizeof(PyEtherInfo), .tp_flags = Py_TPFLAGS_HAVE_CLASS, .tp_dealloc = (destructor)_ethtool_etherinfo_dealloc, .tp_str = (reprfunc)_ethtool_etherinfo_str, |