srd: change output_new() API call to add()
authorBert Vermeulen <bert@biot.com>
Sun, 8 Jan 2012 23:12:19 +0000 (00:12 +0100)
committerBert Vermeulen <bert@biot.com>
Sun, 8 Jan 2012 23:12:19 +0000 (00:12 +0100)
controller.c
decoders/i2c.py
module_sigrokdecode.c
sigrokdecode.h

index f7ffb2567ca9cee480d8047bcc4daafd45947b8f..1ed852bea9b539ca8c3cf8c5379191617e130e0c 100644 (file)
@@ -293,7 +293,7 @@ int srd_session_feed(uint64_t timeoffset, uint64_t duration, uint8_t *inbuf,
 }
 
 
 }
 
 
-int pd_output_new(struct srd_decoder_instance *di, int output_type,
+int pd_add(struct srd_decoder_instance *di, int output_type,
                char *protocol_id)
 {
        struct srd_pd_output *pdo;
                char *protocol_id)
 {
        struct srd_pd_output *pdo;
index abe4d7ec7e69c4258f1c380475d77a33f764e80e..f098affcbbe966af5d208c85d4fc99c92ca51eaf 100644 (file)
@@ -180,8 +180,8 @@ class Decoder(sigrokdecode.Decoder):
         self.oldsda = None
 
     def start(self, metadata):
         self.oldsda = None
 
     def start(self, metadata):
-        self.output_protocol = self.output_new(sigrokdecode.SRD_OUTPUT_PROTOCOL, 'i2c')
-        self.output_annotation = self.output_new(sigrokdecode.SRD_OUTPUT_ANNOTATION, 'i2c')
+        self.output_protocol = self.add(sigrokdecode.SRD_OUTPUT_PROTOCOL, 'i2c')
+        self.output_annotation = self.add(sigrokdecode.SRD_OUTPUT_ANNOTATION, 'i2c')
 
     def report(self):
         pass
 
     def report(self):
         pass
index e92c9e75b5c7a6613b6cda04986e2b729958cae3..69bd17e396dc8d740a431e27090c19821cfc69ba 100644 (file)
@@ -148,7 +148,7 @@ static PyObject *Decoder_put(PyObject *self, PyObject *args)
 }
 
 
 }
 
 
-static PyObject *Decoder_output_new(PyObject *self, PyObject *args)
+static PyObject *Decoder_add(PyObject *self, PyObject *args)
 {
        PyObject *ret;
        struct srd_decoder_instance *di;
 {
        PyObject *ret;
        struct srd_decoder_instance *di;
@@ -163,7 +163,7 @@ static PyObject *Decoder_output_new(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "is", &output_type, &protocol_id))
                return NULL;
 
        if (!PyArg_ParseTuple(args, "is", &output_type, &protocol_id))
                return NULL;
 
-       pdo_id = pd_output_new(di, output_type, protocol_id);
+       pdo_id = pd_add(di, output_type, protocol_id);
        if (pdo_id < 0)
                Py_RETURN_NONE;
        else
        if (pdo_id < 0)
                Py_RETURN_NONE;
        else
@@ -176,8 +176,7 @@ static PyMethodDef no_methods[] = { {NULL, NULL, 0, NULL} };
 static PyMethodDef Decoder_methods[] = {
        {"put", Decoder_put, METH_VARARGS,
         "Accepts a dictionary with the following keys: time, duration, data"},
 static PyMethodDef Decoder_methods[] = {
        {"put", Decoder_put, METH_VARARGS,
         "Accepts a dictionary with the following keys: time, duration, data"},
-       {"output_new", Decoder_output_new, METH_VARARGS,
-        "Create a new output stream"},
+       {"add", Decoder_add, METH_VARARGS, "Create a new output stream"},
        {NULL, NULL, 0, NULL}
 };
 
        {NULL, NULL, 0, NULL}
 };
 
index 85845c94e565cb1dbcb529f845b331f169325a56..14739698f91189935db782a4d5775395d7bddbbe 100644 (file)
@@ -175,7 +175,7 @@ int srd_run_decoder(uint64_t timeoffset, uint64_t duration,
                struct srd_decoder_instance *dec, uint8_t *inbuf, uint64_t inbuflen);
 int srd_session_feed(uint64_t timeoffset, uint64_t duration, uint8_t *inbuf,
                uint64_t inbuflen);
                struct srd_decoder_instance *dec, uint8_t *inbuf, uint64_t inbuflen);
 int srd_session_feed(uint64_t timeoffset, uint64_t duration, uint8_t *inbuf,
                uint64_t inbuflen);
-int pd_output_new(struct srd_decoder_instance *di, int output_type,
+int pd_add(struct srd_decoder_instance *di, int output_type,
                char *output_id);
 struct srd_decoder_instance *get_di_by_decobject(void *decobject);
 int srd_register_callback(int output_type, void *cb);
                char *output_id);
 struct srd_decoder_instance *get_di_by_decobject(void *decobject);
 int srd_register_callback(int output_type, void *cb);