summaryrefslogtreecommitdiffstats
path: root/partition.c
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2022-12-15 13:12:32 +0100
committerJose M. Guisado <jguisado@soleta.eu>2022-12-15 17:37:07 +0100
commit975acaf5498223318ed2c61bf896dc982c1801f4 (patch)
treea50ba8c48ed685e21d9b17faa35fea0d24154511 /partition.c
parenteaf98290cf111f1427d1c3adeea688b90452802a (diff)
coding style: line breaks
Only two line breaks separate copyright notice from source. For the rest of the source file any function declaration or similar block is separated with a line break from any other block. Except when a python function definition is previously followed by a docstring #define block.
Diffstat (limited to 'partition.c')
-rw-r--r--partition.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/partition.c b/partition.c
index 45c391a..5284869 100644
--- a/partition.c
+++ b/partition.c
@@ -12,12 +12,10 @@
#include "fdisk.h"
-
static PyMemberDef Partition_members[] = {
{ NULL }
};
-
static void Partition_dealloc(PartitionObject *self)
{
if (self->pa)
@@ -78,12 +76,10 @@ static int Partition_init(PartitionObject *self, PyObject *args, PyObject *kwds)
return 0;
}
-
static PyMethodDef Partition_methods[] = {
{NULL}
};
-
static PyObject *Partition_get_partno(PartitionObject *self)
{
if (fdisk_partition_has_partno(self->pa)) {
@@ -91,6 +87,7 @@ static PyObject *Partition_get_partno(PartitionObject *self)
}
Py_RETURN_NONE;
}
+
static int Partition_set_partno(PartitionObject *self, PyObject *value, void *closure)
{
size_t num;
@@ -113,6 +110,7 @@ static int Partition_set_partno(PartitionObject *self, PyObject *value, void *cl
return 0;
}
+
static PyObject *Partition_get_size(PartitionObject *self)
{
if (fdisk_partition_has_size(self->pa)) {
@@ -120,6 +118,7 @@ static PyObject *Partition_get_size(PartitionObject *self)
}
Py_RETURN_NONE;
}
+
static int Partition_set_size(PartitionObject *self, PyObject *value, void *closure)
{
uint64_t sectors;
@@ -143,6 +142,7 @@ static int Partition_set_size(PartitionObject *self, PyObject *value, void *clos
return 0;
}
+
static PyObject *Partition_get_type(PartitionObject *self)
{
struct fdisk_parttype *t;
@@ -153,6 +153,7 @@ static PyObject *Partition_get_type(PartitionObject *self)
Py_RETURN_NONE;
}
+
static int Partition_set_type(PartitionObject *self, PyObject *value, void *closure)
{
if (!value) {
@@ -173,6 +174,7 @@ static int Partition_set_type(PartitionObject *self, PyObject *value, void *clos
return 0;
}
+
static PyGetSetDef Partition_getseters[] = {
{"partno", (getter)Partition_get_partno, (setter)Partition_set_partno, "partition number", NULL},
{"size", (getter)Partition_get_size, (setter)Partition_set_size, "number of sectors", NULL},