+ /* Convert class annotation attribute to GSList of **char */
+ d->annotations = NULL;
+ if (PyObject_HasAttrString(d->py_dec, "annotations")) {
+ py_annlist = PyObject_GetAttrString(d->py_dec, "annotations");
+ if (!PyList_Check(py_annlist)) {
+ srd_err("Protocol decoder module %s annotations should be a list", name);
+ ret = SRD_ERR_PYTHON;
+ goto err_out;
+ }
+ alen = PyList_Size(py_annlist);
+ for (i = 0; i < alen; i++) {
+ py_ann = PyList_GetItem(py_annlist, i);
+ if (!PyList_Check(py_ann) || PyList_Size(py_ann) != 2) {
+ srd_err("Protocol decoder module %s annotation %d should be a list with two elements",
+ name, i+1);
+ ret = SRD_ERR_PYTHON;
+ goto err_out;
+ }
+
+ if (py_strlist_to_char(py_ann, &ann) != SRD_OK) {
+ ret = SRD_ERR_PYTHON;
+ goto err_out;
+ }
+ d->annotations = g_slist_append(d->annotations, ann);
+ }
+ }
+