From d3d526123beb8083bb05dd9a784081a413331448 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Wed, 27 Apr 2016 14:56:45 +0200 Subject: Break long lines and adjust other whitespace. --- c_src/permdbpy.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'c_src/permdbpy.c') diff --git a/c_src/permdbpy.c b/c_src/permdbpy.c index ff3dc2a..cc1e36f 100644 --- a/c_src/permdbpy.c +++ b/c_src/permdbpy.c @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2016, NORDUnet A/S. + * See LICENSE for licensing information. + */ + #include #include "permdb.h" @@ -99,11 +104,13 @@ addvalue_wrapper(PyObject *self, PyObject *args) const char *data; unsigned int datalength; - if (!PyArg_ParseTuple(args, "O!s#s#", &permdb_type, &state, &key, &keylength, &data, &datalength)) { + if (!PyArg_ParseTuple(args, "O!s#s#", &permdb_type, &state, &key, + &keylength, &data, &datalength)) { return NULL; } - int result = addvalue(state->permdb, (unsigned char *) key, keylength, (unsigned char *) data, datalength, 0); + int result = addvalue(state->permdb, (unsigned char *) key, keylength, + (unsigned char *) data, datalength, 0); if (result < 0) { return NULL; @@ -124,19 +131,22 @@ getvalue_wrapper(PyObject *self, PyObject *args) const char *key; int keylen; - if (!PyArg_ParseTuple(args, "O!s#", &permdb_type, &state, &key, &keylen)) { + if (!PyArg_ParseTuple(args, "O!s#", &permdb_type, &state, &key, + &keylen)) { return NULL; } size_t datalen; - unsigned char *result = getvalue(state->permdb, (unsigned char *) key, keylen, &datalen); + unsigned char *result = + getvalue(state->permdb, (unsigned char *) key, keylen, &datalen); if (result == NULL) { Py_INCREF(Py_None); return Py_None; } - PyObject* resultObj = PyString_FromStringAndSize((char *) result, datalen); + PyObject* resultObj = + PyString_FromStringAndSize((char *) result, datalen); free(result); return resultObj; } @@ -193,3 +203,7 @@ initpermdb() { (void) Py_InitModule("permdb", UtilMethods); } + +/* Local Variables: */ +/* c-file-style: "linux" */ +/* End: */ -- cgit v1.1