libdvbv5: move store/retrieve functions upper
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 26 Jan 2014 14:24:53 +0000 (12:24 -0200)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 26 Jan 2014 14:24:53 +0000 (12:24 -0200)
We'll need to use those functions earlier.

So, move them to the beginning of the file.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
lib/libdvbv5/dvb-file.c

index cf3cef3..1c33a90 100644 (file)
 #include "descriptors/desc_atsc_service_location.h"
 #include "descriptors/desc_hierarchy.h"
 
+int store_entry_prop(struct dvb_entry *entry,
+                    uint32_t cmd, uint32_t value)
+{
+       int i;
+
+       for (i = 0; i < entry->n_props; i++) {
+               if (cmd == entry->props[i].cmd)
+                       break;
+       }
+       if (i == entry->n_props) {
+               if (i == DTV_MAX_COMMAND) {
+                       fprintf(stderr, "Can't add property %s\n",
+                              dvb_v5_name[cmd]);
+                       return -1;
+               }
+               entry->n_props++;
+               entry->props[i].cmd = cmd;
+       }
+
+       entry->props[i].u.data = value;
+
+       return 0;
+}
+
+int retrieve_entry_prop(struct dvb_entry *entry,
+                       uint32_t cmd, uint32_t *value)
+{
+       int i;
+
+       for (i = 0; i < entry->n_props; i++) {
+               if (cmd == entry->props[i].cmd) {
+                       *value = entry->props[i].u.data;
+                       return 0;
+               }
+       }
+
+       return -1;
+}
+
 /*
  * Generic parse function for all formats each channel is contained into
  * just one line.
@@ -382,45 +421,6 @@ error:
        return -1;
 }
 
-int store_entry_prop(struct dvb_entry *entry,
-                    uint32_t cmd, uint32_t value)
-{
-       int i;
-
-       for (i = 0; i < entry->n_props; i++) {
-               if (cmd == entry->props[i].cmd)
-                       break;
-       }
-       if (i == entry->n_props) {
-               if (i == DTV_MAX_COMMAND) {
-                       fprintf(stderr, "Can't add property %s\n",
-                              dvb_v5_name[cmd]);
-                       return -1;
-               }
-               entry->n_props++;
-               entry->props[i].cmd = cmd;
-       }
-
-       entry->props[i].u.data = value;
-
-       return 0;
-}
-
-int retrieve_entry_prop(struct dvb_entry *entry,
-                       uint32_t cmd, uint32_t *value)
-{
-       int i;
-
-       for (i = 0; i < entry->n_props; i++) {
-               if (cmd == entry->props[i].cmd) {
-                       *value = entry->props[i].u.data;
-                       return 0;
-               }
-       }
-
-       return -1;
-}
-
 #define CHANNEL "CHANNEL"
 
 static int fill_entry(struct dvb_entry *entry, char *key, char *value)