use tabs
This commit is contained in:
parent
d808478ab1
commit
5d2a3a3f7c
1 changed files with 18 additions and 18 deletions
|
@ -4,18 +4,18 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
/* estrdup.c -- duplicate a string, die if error
|
/* estrdup.c -- duplicate a string, die if error
|
||||||
*
|
*
|
||||||
* char *string;
|
* char *string;
|
||||||
* char *newstring;
|
* char *newstring;
|
||||||
* newstring = estrdup(string);
|
* newstring = estrdup(string);
|
||||||
*
|
*
|
||||||
* estrdup returns a copy of its argument, located in memory
|
* estrdup returns a copy of its argument, located in memory
|
||||||
* allocated from the heap. If it is unable to allocate the
|
* allocated from the heap. If it is unable to allocate the
|
||||||
* necessary memory, estrdup executes PyErr_NoMemory();
|
* necessary memory, estrdup executes PyErr_NoMemory();
|
||||||
* (Generally, the routine error is not expected to return,
|
* (Generally, the routine error is not expected to return,
|
||||||
* but if it does, estrdup will return NULL.)
|
* but if it does, estrdup will return NULL.)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int callbackLen = 0;
|
int callbackLen = 0;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -459,7 +459,7 @@ telldus_tdRegisterDeviceEvent(PyObject *self, PyObject *args)
|
||||||
|
|
||||||
result = tdRegisterDeviceEvent((TDDeviceEvent) &telldus_deviceEventCallback, 0);
|
result = tdRegisterDeviceEvent((TDDeviceEvent) &telldus_deviceEventCallback, 0);
|
||||||
|
|
||||||
addCallback(func, result);
|
addCallback(func, result);
|
||||||
|
|
||||||
return PyLong_FromLong((long) result);
|
return PyLong_FromLong((long) result);
|
||||||
}
|
}
|
||||||
|
@ -513,7 +513,7 @@ telldus_tdRegisterDeviceChangeEvent(PyObject *self, PyObject *args)
|
||||||
|
|
||||||
result = tdRegisterDeviceChangeEvent((TDDeviceChangeEvent) &telldus_deviceChangeEventCallback, 0);
|
result = tdRegisterDeviceChangeEvent((TDDeviceChangeEvent) &telldus_deviceChangeEventCallback, 0);
|
||||||
|
|
||||||
addCallback(func, result);
|
addCallback(func, result);
|
||||||
|
|
||||||
return PyLong_FromLong((long) result);
|
return PyLong_FromLong((long) result);
|
||||||
}
|
}
|
||||||
|
@ -567,7 +567,7 @@ telldus_tdRegisterRawDeviceEvent(PyObject *self, PyObject *args)
|
||||||
|
|
||||||
result = tdRegisterRawDeviceEvent((TDRawDeviceEvent) &telldus_rawDeviceEventCallback, 0);
|
result = tdRegisterRawDeviceEvent((TDRawDeviceEvent) &telldus_rawDeviceEventCallback, 0);
|
||||||
|
|
||||||
addCallback(func, result);
|
addCallback(func, result);
|
||||||
|
|
||||||
return PyLong_FromLong((long) result);
|
return PyLong_FromLong((long) result);
|
||||||
}
|
}
|
||||||
|
@ -621,7 +621,7 @@ telldus_tdRegisterSensorEvent(PyObject *self, PyObject *args)
|
||||||
|
|
||||||
result = tdRegisterSensorEvent((TDSensorEvent) &telldus_sensorEventCallback, 0);
|
result = tdRegisterSensorEvent((TDSensorEvent) &telldus_sensorEventCallback, 0);
|
||||||
|
|
||||||
addCallback(func, result);
|
addCallback(func, result);
|
||||||
|
|
||||||
return PyLong_FromLong((long) result);
|
return PyLong_FromLong((long) result);
|
||||||
}
|
}
|
||||||
|
@ -631,11 +631,11 @@ telldus_tdUnregisterCallback(PyObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
long id;
|
long id;
|
||||||
PyObject *callback;
|
PyObject *callback;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, "l", &id))
|
if (!PyArg_ParseTuple(args, "l", &id))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (hasCallback(id) == 1) {
|
if (hasCallback(id) == 1) {
|
||||||
callback = getCallback(id);
|
callback = getCallback(id);
|
||||||
Py_DECREF(callback);
|
Py_DECREF(callback);
|
||||||
removeCallback(id);
|
removeCallback(id);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue