]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
uuid: remove idnode_uuid_as_sstr() fcn
authorJaroslav Kysela <perex@perex.cz>
Mon, 7 Dec 2015 15:38:56 +0000 (16:38 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 7 Dec 2015 15:39:33 +0000 (16:39 +0100)
Use only re-entrant idnode_uuid_as_str() fcn.

52 files changed:
src/access.c
src/api/api_bouquet.c
src/api/api_caclient.c
src/api/api_channel.c
src/api/api_dvr.c
src/api/api_epg.c
src/api/api_epggrab.c
src/api/api_idnode.c
src/api/api_mpegts.c
src/api/api_profile.c
src/api/api_service.c
src/bouquet.c
src/channels.c
src/channels.h
src/descrambler/caclient.c
src/dvr/dvr_autorec.c
src/dvr/dvr_config.c
src/dvr/dvr_db.c
src/dvr/dvr_timerec.c
src/epg.c
src/epggrab/channel.c
src/epggrab/module/opentv.c
src/epggrab/otamux.c
src/esfilter.c
src/htsp_server.c
src/idnode.c
src/idnode.h
src/input/mpegts/dvb_psi.c
src/input/mpegts/iptv/iptv.c
src/input/mpegts/iptv/iptv_mux.c
src/input/mpegts/iptv/iptv_service.c
src/input/mpegts/linuxdvb/linuxdvb_adapter.c
src/input/mpegts/linuxdvb/linuxdvb_ca.c
src/input/mpegts/linuxdvb/linuxdvb_frontend.c
src/input/mpegts/linuxdvb/linuxdvb_satconf.c
src/input/mpegts/mpegts_input.c
src/input/mpegts/mpegts_mux.c
src/input/mpegts/mpegts_mux_dvb.c
src/input/mpegts/mpegts_mux_sched.c
src/input/mpegts/mpegts_network_dvb.c
src/input/mpegts/mpegts_service.c
src/input/mpegts/satip/satip.c
src/input/mpegts/satip/satip_frontend.c
src/input/mpegts/satip/satip_satconf.c
src/input/mpegts/tvhdhomerun/tvhdhomerun.c
src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c
src/profile.c
src/service.c
src/service_mapper.c
src/webui/simpleui.c
src/webui/webui.c
src/webui/xmltv.c

index 5290c9bc11cf4b48dffba08388187a229ae7ce24..d0eb810b5be63f2fbfcff531c49801d281dd12db 100644 (file)
@@ -512,6 +512,7 @@ access_update(access_t *a, access_entry_t *ae)
 {
   idnode_list_mapping_t *ilm;
   const char *s;
+  char ubuf[UUID_HEX_SIZE];
 
   switch (ae->ae_conn_limit_type) {
   case ACCESS_CONN_LIMIT_TYPE_ALL:
@@ -550,7 +551,7 @@ access_update(access_t *a, access_entry_t *ae)
     if(pro && pro->pro_name[0] != '\0') {
       if (a->aa_profiles == NULL)
         a->aa_profiles = htsmsg_create_list();
-      htsmsg_add_str_exclusive(a->aa_profiles, idnode_uuid_as_sstr(&pro->pro_id));
+      htsmsg_add_str_exclusive(a->aa_profiles, idnode_uuid_as_str(&pro->pro_id, ubuf));
     }
   }
 
@@ -559,7 +560,7 @@ access_update(access_t *a, access_entry_t *ae)
     if(dvr && dvr->dvr_config_name[0] != '\0') {
       if (a->aa_dvrcfgs == NULL)
         a->aa_dvrcfgs = htsmsg_create_list();
-      htsmsg_add_str_exclusive(a->aa_dvrcfgs, idnode_uuid_as_sstr(&dvr->dvr_id));
+      htsmsg_add_str_exclusive(a->aa_dvrcfgs, idnode_uuid_as_str(&dvr->dvr_id, ubuf));
      }
   }
 
@@ -574,7 +575,7 @@ access_update(access_t *a, access_entry_t *ae)
         if (ilm == NULL) {
           if (a->aa_chtags == NULL)
             a->aa_chtags = htsmsg_create_list();
-          htsmsg_add_str_exclusive(a->aa_chtags, idnode_uuid_as_sstr(&ct->ct_id));
+          htsmsg_add_str_exclusive(a->aa_chtags, idnode_uuid_as_str(&ct->ct_id, ubuf));
         }
       }
     }
@@ -584,7 +585,7 @@ access_update(access_t *a, access_entry_t *ae)
       if(ct && ct->ct_name[0] != '\0') {
         if (a->aa_chtags == NULL)
           a->aa_chtags = htsmsg_create_list();
-        htsmsg_add_str_exclusive(a->aa_chtags, idnode_uuid_as_sstr(&ct->ct_id));
+        htsmsg_add_str_exclusive(a->aa_chtags, idnode_uuid_as_str(&ct->ct_id, ubuf));
       }
     }
   }
@@ -1145,8 +1146,9 @@ void
 access_entry_save(access_entry_t *ae)
 {
   htsmsg_t *c = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
   idnode_save(&ae->ae_id, c);
-  hts_settings_save(c, "accesscontrol/%s", idnode_uuid_as_sstr(&ae->ae_id));
+  hts_settings_save(c, "accesscontrol/%s", idnode_uuid_as_str(&ae->ae_id, ubuf));
   htsmsg_destroy(c);
 }
 
@@ -1183,8 +1185,9 @@ static void
 access_entry_class_delete(idnode_t *self)
 {
   access_entry_t *ae = (access_entry_t *)self;
+  char ubuf[UUID_HEX_SIZE];
 
-  hts_settings_remove("accesscontrol/%s", idnode_uuid_as_sstr(&ae->ae_id));
+  hts_settings_remove("accesscontrol/%s", idnode_uuid_as_str(&ae->ae_id, ubuf));
   access_entry_destroy(ae);
 }
 
@@ -1719,8 +1722,9 @@ void
 passwd_entry_save(passwd_entry_t *pw)
 {
   htsmsg_t *c = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
   idnode_save(&pw->pw_id, c);
-  hts_settings_save(c, "passwd/%s", idnode_uuid_as_sstr(&pw->pw_id));
+  hts_settings_save(c, "passwd/%s", idnode_uuid_as_str(&pw->pw_id, ubuf));
   htsmsg_destroy(c);
 }
 
@@ -1734,8 +1738,9 @@ static void
 passwd_entry_class_delete(idnode_t *self)
 {
   passwd_entry_t *pw = (passwd_entry_t *)self;
+  char ubuf[UUID_HEX_SIZE];
 
-  hts_settings_remove("passwd/%s", idnode_uuid_as_sstr(&pw->pw_id));
+  hts_settings_remove("passwd/%s", idnode_uuid_as_str(&pw->pw_id, ubuf));
   passwd_entry_destroy(pw);
 }
 
@@ -1884,8 +1889,9 @@ void
 ipblock_entry_save(ipblock_entry_t *ib)
 {
   htsmsg_t *c = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
   idnode_save(&ib->ib_id, c);
-  hts_settings_save(c, "ipblock/%s", idnode_uuid_as_sstr(&ib->ib_id));
+  hts_settings_save(c, "ipblock/%s", idnode_uuid_as_str(&ib->ib_id, ubuf));
   htsmsg_destroy(c);
 }
 
@@ -1909,8 +1915,9 @@ static void
 ipblock_entry_class_delete(idnode_t *self)
 {
   ipblock_entry_t *ib = (ipblock_entry_t *)self;
+  char ubuf[UUID_HEX_SIZE];
 
-  hts_settings_remove("ipblock/%s", idnode_uuid_as_sstr(&ib->ib_id));
+  hts_settings_remove("ipblock/%s", idnode_uuid_as_str(&ib->ib_id, ubuf));
   ipblock_entry_destroy(ib);
 }
 
index 6c917795d7241669f868b6d7411544f595cb625c..4143f975a02bb86175316ca71dde6c7a3381c98b 100644 (file)
@@ -31,12 +31,13 @@ api_bouquet_list
 {
   bouquet_t *bq;
   htsmsg_t *l, *e;
+  char ubuf[UUID_HEX_SIZE];
 
   l = htsmsg_create_list();
   pthread_mutex_lock(&global_lock);
   RB_FOREACH(bq, &bouquets, bq_link) {
     e = htsmsg_create_map();
-    htsmsg_add_str(e, "key", idnode_uuid_as_sstr(&bq->bq_id));
+    htsmsg_add_str(e, "key", idnode_uuid_as_str(&bq->bq_id, ubuf));
     htsmsg_add_str(e, "val", bq->bq_name ?: "");
     htsmsg_add_msg(l, NULL, e);
   }
index b1cd416ad635d837bb438f77dddd2a2fd54f3d91..4b217da7e23388c0e0e567f5b612acbae4e25ecb 100644 (file)
@@ -32,12 +32,13 @@ api_caclient_list
 {
   caclient_t *cac;
   htsmsg_t *l, *e;
+  char ubuf[UUID_HEX_SIZE];
 
   l = htsmsg_create_list();
   pthread_mutex_lock(&global_lock);
   TAILQ_FOREACH(cac, &caclients, cac_link) {
     e = htsmsg_create_map();
-    htsmsg_add_str(e, "uuid", idnode_uuid_as_sstr(&cac->cac_id));
+    htsmsg_add_str(e, "uuid", idnode_uuid_as_str(&cac->cac_id, ubuf));
     htsmsg_add_str(e, "title", idnode_get_title(&cac->cac_id, perm->aa_lang_ui));
     htsmsg_add_str(e, "status", caclient_get_status(cac));
     htsmsg_add_msg(l, NULL, e);
index 36dce3e21f3cf730d0faf651439c3f9ddb739eb0..79df5c5533139d0351d226a88f3cea1ae2ea840b 100644 (file)
@@ -49,7 +49,7 @@ api_channel_list
   channel_t *ch;
   htsmsg_t *l;
   int cfg = api_channel_is_all(perm, args);
-  char buf[128];
+  char buf[128], ubuf[UUID_HEX_SIZE];
 
   l = htsmsg_create_list();
   pthread_mutex_lock(&global_lock);
@@ -57,9 +57,9 @@ api_channel_list
     if (!cfg && !channel_access(ch, perm, 0)) continue;
     if (!ch->ch_enabled) {
       snprintf(buf, sizeof(buf), "{%s}", channel_get_name(ch));
-      api_channel_key_val(l, idnode_uuid_as_sstr(&ch->ch_id), buf);
+      api_channel_key_val(l, idnode_uuid_as_str(&ch->ch_id, ubuf), buf);
     } else {
-      api_channel_key_val(l, idnode_uuid_as_sstr(&ch->ch_id), channel_get_name(ch));
+      api_channel_key_val(l, idnode_uuid_as_str(&ch->ch_id, ubuf), channel_get_name(ch));
     }
   }
   pthread_mutex_unlock(&global_lock);
@@ -107,17 +107,17 @@ api_channel_tag_list
   channel_tag_t *ct;
   htsmsg_t *l;
   int cfg = api_channel_is_all(perm, args);
-  char buf[128];
+  char buf[128], ubuf[UUID_HEX_SIZE];
 
   l = htsmsg_create_list();
   pthread_mutex_lock(&global_lock);
   TAILQ_FOREACH(ct, &channel_tags, ct_link)
     if (cfg || channel_tag_access(ct, perm, 0)) {
       if (ct->ct_enabled) {
-        api_channel_key_val(l, idnode_uuid_as_sstr(&ct->ct_id), ct->ct_name);
+        api_channel_key_val(l, idnode_uuid_as_str(&ct->ct_id, ubuf), ct->ct_name);
       } else {
         snprintf(buf, sizeof(buf), "{%s}", ct->ct_name);
-        api_channel_key_val(l, idnode_uuid_as_sstr(&ct->ct_id), buf);
+        api_channel_key_val(l, idnode_uuid_as_str(&ct->ct_id, ubuf), buf);
       }
     }
   pthread_mutex_unlock(&global_lock);
index 9a455cb5412995c584705936ac7039162f465b74..0354d81f1df0d84ec4a605675a74994bc7deaae0 100644 (file)
@@ -137,6 +137,7 @@ api_dvr_entry_create
   char *s, *lang;
   const char *s1;
   int res = EPERM;
+  char ubuf[UUID_HEX_SIZE];
 
   if (!(conf = htsmsg_get_map(args, "conf")))
     return EINVAL;
@@ -145,7 +146,7 @@ api_dvr_entry_create
   s1 = htsmsg_get_str(conf, "config_name");
   cfg = dvr_config_find_by_list(perm->aa_dvrcfgs, s1);
   if (cfg) {
-    htsmsg_set_str(conf, "config_name", idnode_uuid_as_sstr(&cfg->dvr_id));
+    htsmsg_set_str(conf, "config_name", idnode_uuid_as_str(&cfg->dvr_id, ubuf));
     htsmsg_set_str(conf, "owner", perm->aa_username ?: "");
     htsmsg_set_str(conf, "creator", perm->aa_representative ?: "");
 
@@ -338,6 +339,7 @@ api_dvr_autorec_create
   dvr_config_t *cfg;
   dvr_autorec_entry_t *dae;
   const char *s1;
+  char ubuf[UUID_HEX_SIZE];
 
   if (!(conf  = htsmsg_get_map(args, "conf")))
     return EINVAL;
@@ -352,7 +354,7 @@ api_dvr_autorec_create
   pthread_mutex_lock(&global_lock);
   cfg = dvr_config_find_by_list(perm->aa_dvrcfgs, s1);
   if (cfg) {
-    htsmsg_set_str(conf, "config_name", idnode_uuid_as_sstr(&cfg->dvr_id));
+    htsmsg_set_str(conf, "config_name", idnode_uuid_as_str(&cfg->dvr_id, ubuf));
     dae = dvr_autorec_create(NULL, conf);
     if (dae) {
       dvr_autorec_save(dae);
index 7ac6a6bbfb5867ea9c513d42077450703c0743f0..6d63c011d22055eb60329f3730c5a470a415e557 100644 (file)
@@ -53,10 +53,10 @@ static void
 api_epg_add_channel ( htsmsg_t *m, channel_t *ch )
 {
   int64_t chnum;
-  char buf[32];
+  char buf[32], ubuf[UUID_HEX_SIZE];
   const char *s;
   htsmsg_add_str(m, "channelName", channel_get_name(ch));
-  htsmsg_add_str(m, "channelUuid", channel_get_suuid(ch));
+  htsmsg_add_str(m, "channelUuid", channel_get_uuid(ch, ubuf));
   if ((chnum = channel_get_number(ch)) >= 0) {
     uint32_t maj = chnum / CHANNEL_SPLIT;
     uint32_t min = chnum % CHANNEL_SPLIT;
@@ -81,6 +81,7 @@ api_epg_entry ( epg_broadcast_t *eb, const char *lang, access_t *perm )
   epg_episode_num_t epnum;
   epg_genre_t *eg;
   dvr_entry_t *de;
+  char ubuf[UUID_HEX_SIZE];
 
   if (!ee || !ch) return NULL;
 
@@ -170,9 +171,9 @@ api_epg_entry ( epg_broadcast_t *eb, const char *lang, access_t *perm )
       if (de->de_bcast != eb)
         continue;
       if (access_verify_list(perm->aa_dvrcfgs,
-                             idnode_uuid_as_sstr(&de->de_config->dvr_id)))
+                             idnode_uuid_as_str(&de->de_config->dvr_id, ubuf)))
         continue;
-      htsmsg_add_str(m, "dvrUuid", idnode_uuid_as_sstr(&de->de_id));
+      htsmsg_add_str(m, "dvrUuid", idnode_uuid_as_str(&de->de_id, ubuf));
       htsmsg_add_str(m, "dvrState", dvr_entry_schedstatus(de));
       break;
     }
index 0ad1a25d01e266f16ebeac0d09eea8f67c781e06..fc35bfa753a60d9477a836690ff809bf440a5fef 100644 (file)
@@ -38,10 +38,11 @@ api_epggrab_module_list
 {
   htsmsg_t *l = htsmsg_create_list(), *m;
   epggrab_module_t *mod;
+  char ubuf[UUID_HEX_SIZE];
   pthread_mutex_lock(&global_lock);
   LIST_FOREACH(mod, &epggrab_modules, link) {
     m = htsmsg_create_map();
-    htsmsg_add_str(m, "uuid", idnode_uuid_as_sstr(&mod->idnode));
+    htsmsg_add_str(m, "uuid", idnode_uuid_as_str(&mod->idnode, ubuf));
     htsmsg_add_str(m, "status", epggrab_module_get_status(mod));
     htsmsg_add_str(m, "title", idnode_get_title(&mod->idnode, perm->aa_lang_ui));
     htsmsg_add_msg(l, NULL, m);
index ed3b8d8142df744eb1a6fc19d7beeaf9097c4049..7551e44a54871e74b97301954f8950a9e2a6dcd1 100644 (file)
@@ -126,6 +126,7 @@ api_idnode_grid
   idnode_t *in;
   idnode_set_t ins = { 0 };
   api_idnode_grid_callback_t cb = opaque;
+  char ubuf[UUID_HEX_SIZE];
 
   /* Grid configuration */
   api_idnode_grid_conf(perm, args, &conf);
@@ -143,7 +144,7 @@ api_idnode_grid
   for (i = conf.start; i < ins.is_count && conf.limit != 0; i++) {
     in = ins.is_array[i];
     e = htsmsg_create_map();
-    htsmsg_add_str(e, "uuid", idnode_uuid_as_sstr(in));
+    htsmsg_add_str(e, "uuid", idnode_uuid_as_str(in, ubuf));
     if (idnode_perm(in, perm, NULL))
       continue;
     idnode_read0(in, e, flist, 0, conf.sort.lang);
@@ -176,6 +177,7 @@ api_idnode_load_by_class0
   idnode_set_t    *is;
   idnode_t        *in;
   htsmsg_t        *l, *e;
+  char ubuf[UUID_HEX_SIZE];
 
   // TODO: this only works if pass as integer
   _enum = htsmsg_get_bool_or_default(args, "enum", 0);
@@ -195,7 +197,7 @@ api_idnode_load_by_class0
       /* Name/UUID only */
       if (_enum) {
         e = htsmsg_create_map();
-        htsmsg_add_str(e, "key", idnode_uuid_as_sstr(in));
+        htsmsg_add_str(e, "key", idnode_uuid_as_str(in, ubuf));
         htsmsg_add_str(e, "val", idnode_get_title(in, perm->aa_lang_ui));
 
       /* Full record */
@@ -240,6 +242,7 @@ api_idnode_load
   htsmsg_t *uuids, *l = NULL, *m, *flist;
   htsmsg_field_t *f;
   const char *uuid = NULL, *class;
+  char ubuf[UUID_HEX_SIZE];
 
   /* Class based */
   if ((class = htsmsg_get_str(args, "class"))) {
@@ -284,7 +287,7 @@ api_idnode_load
       }
       if (grid > 0) {
         m = htsmsg_create_map();
-        htsmsg_add_str(m, "uuid", idnode_uuid_as_sstr(in));
+        htsmsg_add_str(m, "uuid", idnode_uuid_as_str(in, ubuf));
         idnode_read0(in, m, flist, 0, perm->aa_lang_ui);
       } else {
         m = idnode_serialize0(in, flist, 0, perm->aa_lang_ui);
@@ -308,7 +311,7 @@ api_idnode_load
       } else {
         if (grid > 0) {
           m = htsmsg_create_map();
-          htsmsg_add_str(m, "uuid", idnode_uuid_as_sstr(in));
+          htsmsg_add_str(m, "uuid", idnode_uuid_as_str(in, ubuf));
           idnode_read0(in, m, flist, 0, perm->aa_lang_ui);
         } else {
           m = idnode_serialize0(in, flist, 0, perm->aa_lang_ui);
index 40396228c5650578471283f57eb71b4d1a135fa7..2e14c235c9355a44be4e1f12e11fa37c69e5edc9 100644 (file)
@@ -38,6 +38,7 @@ api_mpegts_input_network_list
   mpegts_input_t *mi;
   mpegts_network_t *mn;
   idnode_set_t *is;
+  char ubuf[UUID_HEX_SIZE];
   extern const idclass_t mpegts_input_class;
 
   if (!(uuid = htsmsg_get_str(args, "uuid")))
@@ -57,7 +58,7 @@ api_mpegts_input_network_list
       char buf[256];
       htsmsg_t *e = htsmsg_create_map();
       mn = (mpegts_network_t*)is->is_array[i];
-      htsmsg_add_str(e, "key", idnode_uuid_as_sstr(is->is_array[i]));
+      htsmsg_add_str(e, "key", idnode_uuid_as_str(is->is_array[i], ubuf));
       mn->mn_display_name(mn, buf, sizeof(buf));
       htsmsg_add_str(e, "val", buf);
       htsmsg_add_msg(l, NULL, e);
index 8258d1bda8125835713c28d195e5dced6f877dcb..692caabb661132021253f30cf93dda83895a0188 100644 (file)
@@ -32,12 +32,13 @@ api_profile_list
 {
   profile_t *pro;
   htsmsg_t *l, *e;
+  char ubuf[UUID_HEX_SIZE];
 
   l = htsmsg_create_list();
   pthread_mutex_lock(&global_lock);
   TAILQ_FOREACH(pro, &profiles, pro_link) {
     e = htsmsg_create_map();
-    htsmsg_add_str(e, "key", idnode_uuid_as_sstr(&pro->pro_id));
+    htsmsg_add_str(e, "key", idnode_uuid_as_str(&pro->pro_id, ubuf));
     htsmsg_add_str(e, "val", profile_get_name(pro));
     htsmsg_add_msg(l, NULL, e);
   }
index 0efe837ab389934ca7852e80ff721a335dc74f30..9270d975a5612b5d8bcc7a47b3621da88f8c122b 100644 (file)
@@ -66,6 +66,7 @@ static htsmsg_t *
 api_mapper_status_msg ( void )
 {
   htsmsg_t *m;
+  char ubuf[UUID_HEX_SIZE];
   service_mapper_status_t stat = service_mapper_status();
   m = htsmsg_create_map();
   htsmsg_add_u32(m, "total",  stat.total);
@@ -73,7 +74,7 @@ api_mapper_status_msg ( void )
   htsmsg_add_u32(m, "fail",   stat.fail);
   htsmsg_add_u32(m, "ignore", stat.ignore);
   if (stat.active)
-    htsmsg_add_str(m, "active", idnode_uuid_as_sstr(&stat.active->s_id));
+    htsmsg_add_str(m, "active", idnode_uuid_as_str(&stat.active->s_id, ubuf));
   return m;
 }
 
index dcd6f47984cfd30796022cdca2f34677d7e4ceb4..26f43d7b58ca268023203ae4e171c0645cc31a1e 100644 (file)
@@ -57,7 +57,7 @@ bouquet_create(const char *uuid, htsmsg_t *conf,
 {
   bouquet_t *bq, *bq2;
   bouquet_download_t *bqd;
-  char buf[128];
+  char buf[128], ubuf[UUID_HEX_SIZE];
   int i;
 
   lock_assert(&global_lock);
@@ -98,7 +98,7 @@ bouquet_create(const char *uuid, htsmsg_t *conf,
       bq->bq_ext_url = NULL;
     } else {
       free(bq->bq_src);
-      snprintf(buf, sizeof(buf), "exturl://%s", idnode_uuid_as_sstr(&bq->bq_id));
+      snprintf(buf, sizeof(buf), "exturl://%s", idnode_uuid_as_str(&bq->bq_id, ubuf));
       bq->bq_src = strdup(buf);
       bq->bq_download = bqd = calloc(1, sizeof(*bqd));
       bqd->bq = bq;
@@ -558,11 +558,12 @@ bouquet_get_tag_name(bouquet_t *bq, service_t *t)
 void
 bouquet_delete(bouquet_t *bq)
 {
+  char ubuf[UUID_HEX_SIZE];
   if (bq == NULL) return;
   bq->bq_enabled = 0;
   bouquet_map_to_channels(bq);
   if (!bq->bq_shield) {
-    hts_settings_remove("bouquet/%s", idnode_uuid_as_sstr(&bq->bq_id));
+    hts_settings_remove("bouquet/%s", idnode_uuid_as_str(&bq->bq_id, ubuf));
     bouquet_destroy(bq);
   } else {
     idnode_set_free(bq->bq_services);
@@ -578,8 +579,9 @@ void
 bouquet_save(bouquet_t *bq, int notify)
 {
   htsmsg_t *c = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
   idnode_save(&bq->bq_id, c);
-  hts_settings_save(c, "bouquet/%s", idnode_uuid_as_sstr(&bq->bq_id));
+  hts_settings_save(c, "bouquet/%s", idnode_uuid_as_str(&bq->bq_id, ubuf));
   if (bq->bq_shield)
     htsmsg_add_bool(c, "shield", 1);
   htsmsg_destroy(c);
@@ -780,9 +782,10 @@ bouquet_class_chtag_ref_get ( void *obj )
 {
   static const char *buf;
   bouquet_t *bq = obj;
+  char ubuf[UUID_HEX_SIZE];
 
   if (bq->bq_chtag_ptr)
-    buf = idnode_uuid_as_sstr(&bq->bq_chtag_ptr->ct_id);
+    buf = idnode_uuid_as_str(&bq->bq_chtag_ptr->ct_id, ubuf);
   else
     buf = "";
   return &buf;
@@ -819,6 +822,7 @@ bouquet_class_services_get ( void *obj )
   int64_t lcn;
   const char *tag;
   size_t z;
+  char ubuf[UUID_HEX_SIZE];
 
   /* Add all */
   for (z = 0; z < bq->bq_services->is_count; z++) {
@@ -828,7 +832,7 @@ bouquet_class_services_get ( void *obj )
       htsmsg_add_s64(e, "lcn", lcn);
     if ((tag = bouquet_get_tag_name(bq, t)) != NULL)
       htsmsg_add_str(e, "tag", tag);
-    htsmsg_add_msg(m, idnode_uuid_as_sstr(&t->s_id), e);
+    htsmsg_add_msg(m, idnode_uuid_as_str(&t->s_id, ubuf), e);
   }
 
   return m;
index 5851a985f2534b1153d7df28f7450586cf8a884e..5e775176aae7664878f2415af43c39f92afec4d9 100644 (file)
@@ -265,13 +265,12 @@ channel_class_epggrab_list ( void *o, const char *lang )
 static const void *
 channel_class_bouquet_get ( void *o )
 {
-  static const char *sbuf;
   channel_t *ch = o;
   if (ch->ch_bouquet)
-    sbuf = idnode_uuid_as_sstr(&ch->ch_bouquet->bq_id);
+    idnode_uuid_as_str(&ch->ch_bouquet->bq_id, prop_sbuf);
   else
-    sbuf = "";
-  return &sbuf;
+    prop_sbuf[0] = '\0';
+  return &prop_sbuf_ptr;
 }
 
 static int
@@ -531,6 +530,8 @@ channel_find_by_number ( const char *no )
 int
 channel_access(channel_t *ch, access_t *a, int disabled)
 {
+  char ubuf[UUID_HEX_SIZE];
+
   if (!ch)
     return 0;
 
@@ -553,7 +554,7 @@ channel_access(channel_t *ch, access_t *a, int disabled)
     HTSMSG_FOREACH(f, a->aa_chtags) {
       LIST_FOREACH(ilm, &ch->ch_ctms, ilm_in2_link) {
         if (!strcmp(htsmsg_field_get_str(f) ?: "",
-                    idnode_uuid_as_sstr(ilm->ilm_in1)))
+                    idnode_uuid_as_str(ilm->ilm_in1, ubuf)))
           goto chtags_ok;
       }
     }
@@ -894,6 +895,7 @@ channel_delete ( channel_t *ch, int delconf )
   th_subscription_t *s;
   idnode_list_mapping_t *ilm;
   channel_t *ch1, *ch2;
+  char ubuf[UUID_HEX_SIZE];
 
   lock_assert(&global_lock);
 
@@ -937,7 +939,7 @@ channel_delete ( channel_t *ch, int delconf )
 
   /* Settings */
   if (delconf)
-    hts_settings_remove("channel/config/%s", idnode_uuid_as_sstr(&ch->ch_id));
+    hts_settings_remove("channel/config/%s", idnode_uuid_as_str(&ch->ch_id, ubuf));
 
   /* Free memory */
   RB_REMOVE(&channels, ch, ch_link);
@@ -955,10 +957,11 @@ void
 channel_save ( channel_t *ch )
 {
   htsmsg_t *c;
+  char ubuf[UUID_HEX_SIZE];
   if (ch->ch_dont_save == 0) {
     c = htsmsg_create_map();
     idnode_save(&ch->ch_id, c);
-    hts_settings_save(c, "channel/config/%s", idnode_uuid_as_sstr(&ch->ch_id));
+    hts_settings_save(c, "channel/config/%s", idnode_uuid_as_str(&ch->ch_id, ubuf));
     htsmsg_destroy(c);
   }
   /* update the EPG channel <-> channel mapping here */
@@ -1129,12 +1132,13 @@ static void
 channel_tag_destroy(channel_tag_t *ct, int delconf)
 {
   idnode_list_mapping_t *ilm;
+  char ubuf[UUID_HEX_SIZE];
 
   while((ilm = LIST_FIRST(&ct->ct_ctms)) != NULL)
     channel_tag_mapping_destroy(ilm, delconf ? ilm->ilm_in1 : NULL);
 
   if (delconf)
-    hts_settings_remove("channel/tag/%s", idnode_uuid_as_sstr(&ct->ct_id));
+    hts_settings_remove("channel/tag/%s", idnode_uuid_as_str(&ct->ct_id, ubuf));
 
   if(ct->ct_enabled && !ct->ct_internal)
     htsp_tag_delete(ct);
@@ -1159,8 +1163,9 @@ void
 channel_tag_save(channel_tag_t *ct)
 {
   htsmsg_t *c = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
   idnode_save(&ct->ct_id, c);
-  hts_settings_save(c, "channel/tag/%s", idnode_uuid_as_sstr(&ct->ct_id));
+  hts_settings_save(c, "channel/tag/%s", idnode_uuid_as_str(&ct->ct_id, ubuf));
   htsmsg_destroy(c);
   htsp_tag_update(ct);
 }
@@ -1202,7 +1207,8 @@ channel_tag_access(channel_tag_t *ct, access_t *a, int disabled)
   /* Channel tag check */
   if (a->aa_chtags) {
     htsmsg_field_t *f;
-    const char *uuid = idnode_uuid_as_sstr(&ct->ct_id);
+    char ubuf[UUID_HEX_SIZE];
+    const char *uuid = idnode_uuid_as_str(&ct->ct_id, ubuf);
     HTSMSG_FOREACH(f, a->aa_chtags)
       if (!strcmp(htsmsg_field_get_str(f) ?: "", uuid))
         goto chtags_ok;
index 71f93c9d3e1d34cf154d43b4424c38b8e28a04fe..fe74cec8d05a43953f1b49932ab53c62f20ae738 100644 (file)
@@ -183,7 +183,7 @@ int channel_set_icon ( channel_t *ch, const char *icon );
 
 const char *channel_get_epgid ( channel_t *ch );
 
-#define channel_get_suuid(ch) idnode_uuid_as_sstr(&(ch)->ch_id)
+#define channel_get_uuid(ch,ub) idnode_uuid_as_str(&(ch)->ch_id, ub)
 
 #define channel_get_id(ch)    idnode_get_short_uuid((&(ch)->ch_id))
 
index 44f5007a89c78d481d945b8ad30ddf6d95969337..ad73b2a992f7e18250be4740e9042a7febc4e6fa 100644 (file)
@@ -137,10 +137,12 @@ caclient_create
 static void
 caclient_delete(caclient_t *cac, int delconf)
 {
+  char ubuf[UUID_HEX_SIZE];
+
   cac->cac_enabled = 0;
   cac->cac_conf_changed(cac);
   if (delconf)
-    hts_settings_remove("caclient/%s", idnode_uuid_as_sstr(&cac->cac_id));
+    hts_settings_remove("caclient/%s", idnode_uuid_as_str(&cac->cac_id, ubuf));
   pthread_mutex_lock(&caclients_mutex);
   TAILQ_REMOVE(&caclients, cac, cac_link);
   pthread_mutex_unlock(&caclients_mutex);
@@ -155,10 +157,11 @@ caclient_delete(caclient_t *cac, int delconf)
 static void
 caclient_class_save ( idnode_t *in )
 {
+  char ubuf[UUID_HEX_SIZE];
   caclient_t *cac = (caclient_t *)in;
   htsmsg_t *c = htsmsg_create_map();
   idnode_save(in, c);
-  hts_settings_save(c, "caclient/%s", idnode_uuid_as_sstr(in));
+  hts_settings_save(c, "caclient/%s", idnode_uuid_as_str(in, ubuf));
   htsmsg_destroy(c);
   cac->cac_conf_changed(cac);
 }
index 86874c87fcafacaa76ce70dee2a2920e9a87b75d..46e96ab04fbc063ed4cf163e1c1cc80ae175346a 100644 (file)
@@ -104,6 +104,7 @@ dvr_autorec_completed(dvr_entry_t *de, int error_code)
   dvr_entry_t *de_prev;
   dvr_autorec_entry_t *dae = de->de_autorec;
   uint32_t max_count = dvr_autorec_get_max_count(dae);
+  char ubuf[UUID_HEX_SIZE];
 
   if (dae == NULL) return;
   if (max_count <= 0) return;
@@ -123,7 +124,7 @@ dvr_autorec_completed(dvr_entry_t *de, int error_code)
       break;
     if (de_prev) {
       tvhinfo("dvr", "autorec %s removing recordings %s (allowed count %u total %u)",
-              dae->dae_name, idnode_uuid_as_sstr(&de_prev->de_id), max_count, total);
+              dae->dae_name, idnode_uuid_as_str(&de_prev->de_id, ubuf), max_count, total);
       dvr_entry_cancel_delete(de_prev, 0);
     }
   }
@@ -358,10 +359,12 @@ dvr_autorec_add_series_link(const char *dvr_config_name,
 static void
 autorec_entry_destroy(dvr_autorec_entry_t *dae, int delconf)
 {
+  char ubuf[UUID_HEX_SIZE];
+
   dvr_autorec_purge_spawns(dae, delconf, 0);
 
   if (delconf)
-    hts_settings_remove("dvr/autorec/%s", idnode_uuid_as_sstr(&dae->dae_id));
+    hts_settings_remove("dvr/autorec/%s", idnode_uuid_as_str(&dae->dae_id, ubuf));
 
   htsp_autorec_entry_delete(dae);
 
@@ -405,11 +408,12 @@ void
 dvr_autorec_save(dvr_autorec_entry_t *dae)
 {
   htsmsg_t *m = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE]; 
 
   lock_assert(&global_lock);
 
   idnode_save(&dae->dae_id, m);
-  hts_settings_save(m, "dvr/autorec/%s", idnode_uuid_as_sstr(&dae->dae_id));
+  hts_settings_save(m, "dvr/autorec/%s", idnode_uuid_as_str(&dae->dae_id, ubuf));
   htsmsg_destroy(m);
 }
 
@@ -483,13 +487,12 @@ dvr_autorec_entry_class_channel_set(void *o, const void *v)
 static const void *
 dvr_autorec_entry_class_channel_get(void *o)
 {
-  static const char *ret;
   dvr_autorec_entry_t *dae = (dvr_autorec_entry_t *)o;
   if (dae->dae_channel)
-    ret = idnode_uuid_as_sstr(&dae->dae_channel->ch_id);
+    idnode_uuid_as_str(&dae->dae_channel->ch_id, prop_sbuf);
   else
-    ret = "";
-  return &ret;
+    prop_sbuf[0] = '\0';
+  return &prop_sbuf_ptr;
 }
 
 static char *
@@ -544,13 +547,12 @@ dvr_autorec_entry_class_tag_set(void *o, const void *v)
 static const void *
 dvr_autorec_entry_class_tag_get(void *o)
 {
-  static const char *ret;
   dvr_autorec_entry_t *dae = (dvr_autorec_entry_t *)o;
   if (dae->dae_channel_tag)
-    ret = idnode_uuid_as_sstr(&dae->dae_channel_tag->ct_id);
+    idnode_uuid_as_str(&dae->dae_channel_tag->ct_id, prop_sbuf);
   else
-    ret = "";
-  return &ret;
+    prop_sbuf[0] = '\0';
+  return &prop_sbuf_ptr;
 }
 
 static char *
@@ -691,13 +693,12 @@ dvr_autorec_entry_class_config_name_set(void *o, const void *v)
 static const void *
 dvr_autorec_entry_class_config_name_get(void *o)
 {
-  static const char *ret;
   dvr_autorec_entry_t *dae = (dvr_autorec_entry_t *)o;
   if (dae->dae_config)
-    ret = idnode_uuid_as_sstr(&dae->dae_config->dvr_id);
+    idnode_uuid_as_str(&dae->dae_config->dvr_id, prop_sbuf);
   else
-    ret = "";
-  return &ret;
+    prop_sbuf[0] = '\0';
+  return &prop_sbuf_ptr;
 }
 
 static char *
index 3b02925b873bbccda377a6eafe781f827b06e127..125d383f03e2f824e5400ffb62167441402bbbbf 100644 (file)
@@ -234,9 +234,11 @@ dvr_config_create(const char *name, const char *uuid, htsmsg_t *conf)
 static void
 dvr_config_destroy(dvr_config_t *cfg, int delconf)
 {
+  char ubuf[UUID_HEX_SIZE];
+
   if (delconf) {
     tvhinfo("dvr", "Deleting configuration '%s'", cfg->dvr_config_name);
-    hts_settings_remove("dvr/config/%s", idnode_uuid_as_sstr(&cfg->dvr_id));
+    hts_settings_remove("dvr/config/%s", idnode_uuid_as_str(&cfg->dvr_id, ubuf));
   }
   LIST_REMOVE(cfg, config_link);
   idnode_unlink(&cfg->dvr_id);
@@ -513,6 +515,7 @@ void
 dvr_config_save(dvr_config_t *cfg)
 {
   htsmsg_t *m = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
 
   lock_assert(&global_lock);
 
@@ -527,7 +530,7 @@ dvr_config_save(dvr_config_t *cfg)
   if (cfg->dvr_retention_days > DVR_RET_FOREVER)
     cfg->dvr_retention_days = DVR_RET_FOREVER;
   idnode_save(&cfg->dvr_id, m);
-  hts_settings_save(m, "dvr/config/%s", idnode_uuid_as_sstr(&cfg->dvr_id));
+  hts_settings_save(m, "dvr/config/%s", idnode_uuid_as_str(&cfg->dvr_id, ubuf));
   htsmsg_destroy(m);
 }
 
@@ -565,13 +568,14 @@ dvr_config_class_perm(idnode_t *self, access_t *a, htsmsg_t *msg_to_write)
   dvr_config_t *cfg = (dvr_config_t *)self;
   htsmsg_field_t *f;
   const char *uuid, *my_uuid;
+  char ubuf[UUID_HEX_SIZE];
 
   if (access_verify2(a, ACCESS_OR|ACCESS_ADMIN|ACCESS_RECORDER))
     return -1;
   if (!access_verify2(a, ACCESS_ADMIN))
     return 0;
   if (a->aa_dvrcfgs) {
-    my_uuid = idnode_uuid_as_sstr(&cfg->dvr_id);
+    my_uuid = idnode_uuid_as_str(&cfg->dvr_id, ubuf);
     HTSMSG_FOREACH(f, a->aa_dvrcfgs) {
       uuid = htsmsg_field_get_str(f) ?: "";
       if (!strcmp(uuid, my_uuid))
@@ -648,13 +652,12 @@ dvr_config_class_profile_set(void *o, const void *v)
 static const void *
 dvr_config_class_profile_get(void *o)
 {
-  static const char *ret;
   dvr_config_t *cfg = (dvr_config_t *)o;
   if (cfg->dvr_profile)
-    ret = idnode_uuid_as_sstr(&cfg->dvr_profile->pro_id);
+    idnode_uuid_as_str(&cfg->dvr_profile->pro_id, prop_sbuf);
   else
-    ret = "";
-  return &ret;
+    prop_sbuf[0] = '\0';
+  return &prop_sbuf_ptr;
 }
 
 static char *
index 3cdc01cc5a1619aaa1ebba0066e7559face5a6a6..c48760006da250e31c8f69e47214d6d79f6411ed 100644 (file)
@@ -741,7 +741,7 @@ dvr_entry_create(const char *uuid, htsmsg_t *conf, int clone)
          strcmp(de2->de_owner ?: "", de->de_owner ?: "") == 0) {
         tvhlog(LOG_INFO, "dvr", "delete entry %s \"%s\" on \"%s\" start time %"PRId64", "
            "scheduled for recording by \"%s\" (duplicate with %s)",
-          idnode_uuid_as_sstr(&de->de_id),
+          idnode_uuid_as_str(&de->de_id, ubuf),
           lang_str_get(de->de_title, NULL), DVR_CH_NAME(de),
           (int64_t)de2->de_start, de->de_creator ?: "",
           idnode_uuid_as_str(&de2->de_id, ubuf));
@@ -778,13 +778,14 @@ dvr_entry_create_(int enabled, const char *config_uuid, epg_broadcast_t *e,
   time_t t;
   lang_str_t *l;
   htsmsg_t *conf;
+  char ubuf[UUID_HEX_SIZE];
 
   conf = htsmsg_create_map();
   if (enabled >= 0)
     htsmsg_add_u32(conf, "enabled", !!enabled);
   htsmsg_add_s64(conf, "start", start);
   htsmsg_add_s64(conf, "stop", stop);
-  htsmsg_add_str(conf, "channel", idnode_uuid_as_sstr(&ch->ch_id));
+  htsmsg_add_str(conf, "channel", idnode_uuid_as_str(&ch->ch_id, ubuf));
   htsmsg_add_u32(conf, "pri", pri);
   htsmsg_add_u32(conf, "retention", retention);
   htsmsg_add_u32(conf, "removal", removal);
@@ -834,12 +835,12 @@ dvr_entry_create_(int enabled, const char *config_uuid, epg_broadcast_t *e,
     htsmsg_add_u32(conf, "broadcast", e->id);
   if (dae)
   {
-    htsmsg_add_str(conf, "autorec", idnode_uuid_as_sstr(&dae->dae_id));
+    htsmsg_add_str(conf, "autorec", idnode_uuid_as_str(&dae->dae_id, ubuf));
     htsmsg_add_str(conf, "directory", dae->dae_directory ?: "");
   }
   if (dte)
   {
-    htsmsg_add_str(conf, "timerec", idnode_uuid_as_sstr(&dte->dte_id));
+    htsmsg_add_str(conf, "timerec", idnode_uuid_as_str(&dte->dte_id, ubuf));
     htsmsg_add_str(conf, "directory", dte->dte_directory ?: "");
   }
 
@@ -857,7 +858,7 @@ dvr_entry_create_(int enabled, const char *config_uuid, epg_broadcast_t *e,
 
   tvhlog(LOG_INFO, "dvr", "entry %s \"%s\" on \"%s\" starting at %s, "
         "scheduled for recording by \"%s\"",
-         idnode_uuid_as_sstr(&de->de_id),
+         idnode_uuid_as_str(&de->de_id, ubuf),
         lang_str_get(de->de_title, NULL), DVR_CH_NAME(de), tbuf, creator ?: "");
 
   dvr_entry_save(de);
@@ -1227,8 +1228,10 @@ dvr_entry_dec_ref(dvr_entry_t *de)
 void
 dvr_entry_destroy(dvr_entry_t *de, int delconf)
 {
+  char ubuf[UUID_HEX_SIZE];
+
   if (delconf)
-    hts_settings_remove("dvr/log/%s", idnode_uuid_as_sstr(&de->de_id));
+    hts_settings_remove("dvr/log/%s", idnode_uuid_as_str(&de->de_id, ubuf));
 
   htsp_dvr_entry_delete(de);
   
@@ -1282,13 +1285,14 @@ void
 dvr_entry_save(dvr_entry_t *de)
 {
   htsmsg_t *m = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
 
   lock_assert(&global_lock);
 
   idnode_save(&de->de_id, m);
   if (de->de_files)
     htsmsg_add_msg(m, "files", htsmsg_copy(de->de_files));
-  hts_settings_save(m, "dvr/log/%s", idnode_uuid_as_sstr(&de->de_id));
+  hts_settings_save(m, "dvr/log/%s", idnode_uuid_as_str(&de->de_id, ubuf));
   htsmsg_destroy(m);
 }
 
@@ -1552,6 +1556,7 @@ dvr_event_replaced(epg_broadcast_t *e, epg_broadcast_t *new_e)
   dvr_entry_t *de;
   channel_t *ch = e->channel;
   epg_broadcast_t *e2;
+  char ubuf[UUID_HEX_SIZE];
 
   assert(e != NULL);
   assert(new_e != NULL);
@@ -1568,7 +1573,7 @@ dvr_event_replaced(epg_broadcast_t *e, epg_broadcast_t *new_e)
     tvhtrace("dvr",
              "dvr entry %s event replaced %s on %s @ %"PRItime_t
              " to %"PRItime_t,
-             idnode_uuid_as_sstr(&de->de_id),
+             idnode_uuid_as_str(&de->de_id, ubuf),
              epg_broadcast_get_title(e, NULL),
              channel_get_name(ch),
              e->start, e->stop);
@@ -1631,6 +1636,7 @@ void dvr_event_updated(epg_broadcast_t *e)
 {
   dvr_entry_t *de;
   int found = 0;
+  char ubuf[UUID_HEX_SIZE];
 
   if (e->channel == NULL)
     return;
@@ -1650,7 +1656,7 @@ void dvr_event_updated(epg_broadcast_t *e)
         tvhtrace("dvr",
                  "dvr entry %s link to event %s on %s @ %"PRItime_t
                  " to %"PRItime_t,
-                 idnode_uuid_as_sstr(&de->de_id),
+                 idnode_uuid_as_str(&de->de_id, ubuf),
                  epg_broadcast_get_title(e, NULL),
                  channel_get_name(e->channel),
                  e->start, e->stop);
@@ -1669,6 +1675,7 @@ void dvr_event_running(epg_broadcast_t *e, epg_source_t esrc, epg_running_t runn
 {
   dvr_entry_t *de;
   const char *srcname;
+  char ubuf[UUID_HEX_SIZE];
 
   if (esrc != EPG_SOURCE_EIT || e->dvb_eid == 0 || e->channel == NULL)
     return;
@@ -1682,14 +1689,14 @@ void dvr_event_running(epg_broadcast_t *e, epg_source_t esrc, epg_running_t runn
     if (running == EPG_RUNNING_NOW && de->de_dvb_eid == e->dvb_eid) {
       if (de->de_running_pause) {
         tvhdebug("dvr", "dvr entry %s event %s on %s - EPG unpause",
-                 idnode_uuid_as_sstr(&de->de_id),
+                 idnode_uuid_as_str(&de->de_id, ubuf),
                  epg_broadcast_get_title(e, NULL),
                  channel_get_name(e->channel));
         atomic_exchange_time_t(&de->de_running_pause, 0);
       }
       if (!de->de_running_start) {
         tvhdebug("dvr", "dvr entry %s event %s on %s - EPG marking start",
-                 idnode_uuid_as_sstr(&de->de_id),
+                 idnode_uuid_as_str(&de->de_id, ubuf),
                  epg_broadcast_get_title(e, NULL),
                  channel_get_name(e->channel));
         atomic_exchange_time_t(&de->de_running_start, dispatch_clock);
@@ -1698,7 +1705,7 @@ void dvr_event_running(epg_broadcast_t *e, epg_source_t esrc, epg_running_t runn
         atomic_exchange_time_t(&de->de_start, dispatch_clock);
         dvr_entry_set_timer(de);
         tvhdebug("dvr", "dvr entry %s event %s on %s - EPG start",
-                 idnode_uuid_as_sstr(&de->de_id),
+                 idnode_uuid_as_str(&de->de_id, ubuf),
                  epg_broadcast_get_title(e, NULL),
                  channel_get_name(e->channel));
       }
@@ -1716,7 +1723,7 @@ void dvr_event_running(epg_broadcast_t *e, epg_source_t esrc, epg_running_t runn
       if (!de->de_running_stop ||
           de->de_running_start > de->de_running_stop) {
         tvhdebug("dvr", "dvr entry %s %s %s on %s - EPG marking stop",
-                 idnode_uuid_as_sstr(&de->de_id), srcname,
+                 idnode_uuid_as_str(&de->de_id, ubuf), srcname,
                  epg_broadcast_get_title(e, NULL),
                  channel_get_name(de->de_channel));
       }
@@ -1726,14 +1733,14 @@ void dvr_event_running(epg_broadcast_t *e, epg_source_t esrc, epg_running_t runn
         de->de_dont_reschedule = 1;
         dvr_stop_recording(de, SM_CODE_OK, 0, 0);
         tvhdebug("dvr", "dvr entry %s %s %s on %s - EPG stop",
-                 idnode_uuid_as_sstr(&de->de_id), srcname,
+                 idnode_uuid_as_str(&de->de_id, ubuf), srcname,
                  epg_broadcast_get_title(e, NULL),
                  channel_get_name(de->de_channel));
       }
     } else if (running == EPG_RUNNING_PAUSE && de->de_dvb_eid == e->dvb_eid) {
       if (!de->de_running_pause) {
         tvhdebug("dvr", "dvr entry %s event %s on %s - EPG pause",
-                 idnode_uuid_as_sstr(&de->de_id),
+                 idnode_uuid_as_str(&de->de_id, ubuf),
                  epg_broadcast_get_title(e, NULL),
                  channel_get_name(e->channel));
         atomic_exchange_time_t(&de->de_running_pause, dispatch_clock);
@@ -2052,13 +2059,12 @@ dvr_entry_class_config_name_set(void *o, const void *v)
 static const void *
 dvr_entry_class_config_name_get(void *o)
 {
-  static const char *ret;
   dvr_entry_t *de = (dvr_entry_t *)o;
   if (de->de_config)
-    ret = idnode_uuid_as_sstr(&de->de_config->dvr_id);
+    idnode_uuid_as_str(&de->de_config->dvr_id, prop_sbuf);
   else
-    ret = "";
-  return &ret;
+    prop_sbuf[0] = '\0';
+  return &prop_sbuf_ptr;
 }
 
 htsmsg_t *
@@ -2126,13 +2132,12 @@ dvr_entry_class_channel_set(void *o, const void *v)
 static const void *
 dvr_entry_class_channel_get(void *o)
 {
-  static const char *ret;
   dvr_entry_t *de = (dvr_entry_t *)o;
   if (de->de_channel)
-    ret = idnode_uuid_as_sstr(&de->de_channel->ch_id);
+    idnode_uuid_as_str(&de->de_channel->ch_id, prop_sbuf);
   else
-    ret = "";
-  return &ret;
+    prop_sbuf[0] = '\0';
+  return &prop_sbuf_ptr;
 }
 
 static char *
@@ -2270,13 +2275,12 @@ dvr_entry_class_autorec_set(void *o, const void *v)
 static const void *
 dvr_entry_class_autorec_get(void *o)
 {
-  static const char *ret;
   dvr_entry_t *de = (dvr_entry_t *)o;
   if (de->de_autorec)
-    ret = idnode_uuid_as_sstr(&de->de_autorec->dae_id);
+    idnode_uuid_as_str(&de->de_autorec->dae_id, prop_sbuf);
   else
-    ret = "";
-  return &ret;
+    prop_sbuf[0] = '\0';
+  return &prop_sbuf_ptr;
 }
 
 static const void *
@@ -2323,9 +2327,10 @@ static const void *
 dvr_entry_class_timerec_get(void *o)
 {
   static const char *ret;
+  char ubuf[UUID_HEX_SIZE];
   dvr_entry_t *de = (dvr_entry_t *)o;
   if (de->de_timerec)
-    ret = idnode_uuid_as_sstr(&de->de_timerec->dte_id);
+    ret = idnode_uuid_as_str(&de->de_timerec->dte_id, ubuf);
   else
     ret = "";
   return &ret;
@@ -2363,9 +2368,10 @@ static const void *
 dvr_entry_class_parent_get(void *o)
 {
   static const char *ret;
+  char ubuf[UUID_HEX_SIZE];
   dvr_entry_t *de = (dvr_entry_t *)o;
   if (de->de_parent)
-    ret = idnode_uuid_as_sstr(&de->de_parent->de_id);
+    ret = idnode_uuid_as_str(&de->de_parent->de_id, ubuf);
   else
     ret = "";
   return &ret;
@@ -2385,9 +2391,10 @@ static const void *
 dvr_entry_class_child_get(void *o)
 {
   static const char *ret;
+  char ubuf[UUID_HEX_SIZE];
   dvr_entry_t *de = (dvr_entry_t *)o;
   if (de->de_child)
-    ret = idnode_uuid_as_sstr(&de->de_child->de_id);
+    ret = idnode_uuid_as_str(&de->de_child->de_id, ubuf);
   else
     ret = "";
   return &ret;
@@ -2497,15 +2504,12 @@ static const void *
 dvr_entry_class_url_get(void *o)
 {
   dvr_entry_t *de = (dvr_entry_t *)o;
-  static const char *s;
-  static char buf[100];
-  s = "";
+  char ubuf[UUID_HEX_SIZE];
+  prop_sbuf[0] = '\0';
   if (de->de_sched_state == DVR_COMPLETED ||
-      de->de_sched_state == DVR_RECORDING) {
-    snprintf(buf, sizeof(buf), "dvrfile/%s", idnode_uuid_as_sstr(&de->de_id));
-    s = buf;
-  }
-  return &s;
+      de->de_sched_state == DVR_RECORDING)
+    snprintf(prop_sbuf, PROP_SBUF_LEN, "dvrfile/%s", idnode_uuid_as_str(&de->de_id, ubuf));
+  return &prop_sbuf_ptr;
 }
 
 static const void *
@@ -3103,7 +3107,7 @@ dvr_entry_delete(dvr_entry_t *de, int no_missed_time_resched)
   time_t t;
   struct tm tm;
   const char *filename;
-  char tbuf[64], *rdir, *postcmd;
+  char tbuf[64], ubuf[UUID_HEX_SIZE], *rdir, *postcmd;
   int r;
 
   t = dvr_entry_get_start_time(de, 1);
@@ -3113,7 +3117,7 @@ dvr_entry_delete(dvr_entry_t *de, int no_missed_time_resched)
 
   tvhlog(LOG_INFO, "dvr", "delete entry %s \"%s\" on \"%s\" start time %s, "
         "scheduled for recording by \"%s\", retention \"%s\" removal \"%s\"",
-         idnode_uuid_as_sstr(&de->de_id),
+         idnode_uuid_as_str(&de->de_id, ubuf),
         lang_str_get(de->de_title, NULL), DVR_CH_NAME(de), tbuf,
         de->de_creator ?: "",
         dvr_entry_get_retention_string(de),
index 5bce9b8b15bf4bae634f8c304721f8d3b4a45618..639a1dbefb79a028497cbb5e413dd5fccabc8f5e 100644 (file)
@@ -234,10 +234,12 @@ dvr_timerec_update_htsp (dvr_timerec_entry_t *dte, htsmsg_t *conf)
 static void
 timerec_entry_destroy(dvr_timerec_entry_t *dte, int delconf)
 {
+  char ubuf[UUID_HEX_SIZE];
+
   dvr_timerec_purge_spawn(dte, delconf);
 
   if (delconf)
-    hts_settings_remove("dvr/timerec/%s", idnode_uuid_as_sstr(&dte->dte_id));
+    hts_settings_remove("dvr/timerec/%s", idnode_uuid_as_str(&dte->dte_id, ubuf));
 
   htsp_timerec_entry_delete(dte);
 
@@ -267,11 +269,12 @@ void
 dvr_timerec_save(dvr_timerec_entry_t *dte)
 {
   htsmsg_t *m = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
 
   lock_assert(&global_lock);
 
   idnode_save(&dte->dte_id, m);
-  hts_settings_save(m, "dvr/timerec/%s", idnode_uuid_as_sstr(&dte->dte_id));
+  hts_settings_save(m, "dvr/timerec/%s", idnode_uuid_as_str(&dte->dte_id, ubuf));
   htsmsg_destroy(m);
 }
 
@@ -345,13 +348,12 @@ dvr_timerec_entry_class_channel_set(void *o, const void *v)
 static const void *
 dvr_timerec_entry_class_channel_get(void *o)
 {
-  static const char *ret;
   dvr_timerec_entry_t *dte = (dvr_timerec_entry_t *)o;
   if (dte->dte_channel)
-    ret = idnode_uuid_as_sstr(&dte->dte_channel->ch_id);
+    idnode_uuid_as_str(&dte->dte_channel->ch_id, prop_sbuf);
   else
-    ret = "";
-  return &ret;
+    prop_sbuf[0] = '\0';
+  return &prop_sbuf_ptr;
 }
 
 static char *
@@ -456,13 +458,12 @@ dvr_timerec_entry_class_config_name_set(void *o, const void *v)
 static const void *
 dvr_timerec_entry_class_config_name_get(void *o)
 {
-  static const char *buf;
   dvr_timerec_entry_t *dte = (dvr_timerec_entry_t *)o;
   if (dte->dte_config)
-    buf = idnode_uuid_as_sstr(&dte->dte_config->dvr_id);
+    idnode_uuid_as_str(&dte->dte_config->dvr_id, prop_sbuf);
   else
-    buf = "";
-  return &buf;
+    prop_sbuf[0] = '\0';
+  return &prop_sbuf_ptr;
 }
 
 static char *
index abb34104b9c6ba680522d1d1b7b8a2f250196e4f..6588964e7e313ee3f2ddd166193fca6a3661ef0d 100644 (file)
--- a/src/epg.c
+++ b/src/epg.c
@@ -1841,13 +1841,13 @@ epg_broadcast_t *epg_broadcast_get_next ( epg_broadcast_t *broadcast )
 epg_episode_t *epg_broadcast_get_episode
   ( epg_broadcast_t *ebc, int create, int *save )
 {
-  char uri[256];
+  char uri[256], ubuf[UUID_HEX_SIZE];
   epg_episode_t *ee;
   if (!ebc) return NULL;
   if (ebc->episode) return ebc->episode;
   if (!create) return NULL;
   snprintf(uri, sizeof(uri)-1, "tvh://channel-%s/bcast-%u/episode",
-           idnode_uuid_as_sstr(&ebc->channel->ch_id), ebc->id);
+           idnode_uuid_as_str(&ebc->channel->ch_id, ubuf), ebc->id);
   if ((ee = epg_episode_find_by_uri(uri, 1, save)))
     *save |= epg_broadcast_set_episode(ebc, ee, ebc->grabber);
   return ee;
@@ -1880,6 +1880,7 @@ const char *epg_broadcast_get_description ( epg_broadcast_t *b, const char *lang
 htsmsg_t *epg_broadcast_serialize ( epg_broadcast_t *broadcast )
 {
   htsmsg_t *m;
+  char ubuf[UUID_HEX_SIZE];
   if (!broadcast) return NULL;
   if (!broadcast->episode || !broadcast->episode->uri) return NULL;
   if (!(m = _epg_object_serialize((epg_object_t*)broadcast))) return NULL;
@@ -1887,7 +1888,7 @@ htsmsg_t *epg_broadcast_serialize ( epg_broadcast_t *broadcast )
   htsmsg_add_s64(m, "stop", broadcast->stop);
   htsmsg_add_str(m, "episode", broadcast->episode->uri);
   if (broadcast->channel)
-    htsmsg_add_str(m, "channel", channel_get_suuid(broadcast->channel));
+    htsmsg_add_str(m, "channel", channel_get_uuid(broadcast->channel, ubuf));
   if (broadcast->dvb_eid)
     htsmsg_add_u32(m, "dvb_eid", broadcast->dvb_eid);
   if (broadcast->is_widescreen)
index 780e42a797156209a6d07c4266ccc3dbd64f7ac6..05f6e235e439a4f26be59879940e187274a69581 100644 (file)
@@ -386,14 +386,17 @@ epggrab_channel_t *epggrab_channel_find
 void epggrab_channel_save( epggrab_channel_t *ec )
 {
   htsmsg_t *m = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
   idnode_save(&ec->idnode, m);
   hts_settings_save(m, "epggrab/%s/channels/%s",
-                    ec->mod->saveid, idnode_uuid_as_sstr(&ec->idnode));
+                    ec->mod->saveid, idnode_uuid_as_str(&ec->idnode, ubuf));
   htsmsg_destroy(m);
 }
 
 void epggrab_channel_destroy( epggrab_channel_t *ec, int delconf )
 {
+  char ubuf[UUID_HEX_SIZE];
+
   if (ec == NULL) return;
 
   /* Already linked */
@@ -404,7 +407,7 @@ void epggrab_channel_destroy( epggrab_channel_t *ec, int delconf )
 
   if (delconf)
     hts_settings_remove("epggrab/%s/channels/%s",
-                        ec->mod->saveid, idnode_uuid_as_sstr(&ec->idnode));
+                        ec->mod->saveid, idnode_uuid_as_str(&ec->idnode, ubuf));
 
   htsmsg_destroy(ec->newnames);
   htsmsg_destroy(ec->names);
index 2e8adef6bd1d72065f13574d6cd80360f83c9efe..6505e46822463d28a8cee475906cda99b1a378cb 100644 (file)
@@ -360,9 +360,9 @@ opentv_parse_event_section_one
      */
 
     if (ev.serieslink) {
-      char suri[257];
+      char suri[257], ubuf[UUID_HEX_SIZE];
       snprintf(suri, 256, "opentv://channel-%s/series-%d",
-               channel_get_suuid(ch), ev.serieslink);
+               channel_get_uuid(ch, ubuf), ev.serieslink);
       if ((es = epg_serieslink_find_by_uri(suri, 1, &save)))
         save |= epg_broadcast_set_serieslink(ebc, es, src);
     }
index 88a1e08ec9396664475342edcfb2b304e4fd9bcd..71bafe04ddb0d4024a4ac5f3739b5f38f446ae1d 100644 (file)
@@ -118,13 +118,14 @@ epggrab_ota_queue_mux( mpegts_mux_t *mm )
   const char *id;
   epggrab_ota_mux_t *om;
   int epg_flag;
+  char ubuf[UUID_HEX_SIZE];
 
   if (!mm)
     return;
 
   lock_assert(&global_lock);
 
-  id = idnode_uuid_as_sstr(&mm->mm_id);
+  id = idnode_uuid_as_str(&mm->mm_id, ubuf);
   epg_flag = mm->mm_is_epg(mm);
   if (epg_flag < 0 || epg_flag == MM_EPG_DISABLE)
     return;
@@ -275,7 +276,8 @@ epggrab_mux_start ( mpegts_mux_t *mm, void *p )
 {
   epggrab_module_t  *m;
   epggrab_ota_mux_t *ota;
-  const char *uuid = idnode_uuid_as_sstr(&mm->mm_id);
+  char ubuf[UUID_HEX_SIZE];
+  const char *uuid = idnode_uuid_as_str(&mm->mm_id, ubuf);
 
   /* Already started */
   TAILQ_FOREACH(ota, &epggrab_ota_active, om_q_link)
@@ -297,7 +299,8 @@ static void
 epggrab_mux_stop ( mpegts_mux_t *mm, void *p, int reason )
 {
   epggrab_ota_mux_t *ota;
-  const char *uuid = idnode_uuid_as_sstr(&mm->mm_id);
+  char ubuf[UUID_HEX_SIZE];
+  const char *uuid = idnode_uuid_as_str(&mm->mm_id, ubuf);
   int done = EPGGRAB_OTA_DONE_STOLEN;
 
   if (reason == SM_CODE_NO_INPUT)
index 8932b3996d041f624de9a5d76e7e9bbaa52bd9ae..ec906cf2b442057bc4790db6ff8defa2f1ab1c59 100644 (file)
@@ -192,8 +192,9 @@ esfilter_create
 static void
 esfilter_delete(esfilter_t *esf, int delconf)
 {
+  char ubuf[UUID_HEX_SIZE];
   if (delconf)
-    hts_settings_remove("esfilter/%s", idnode_uuid_as_sstr(&esf->esf_id));
+    hts_settings_remove("esfilter/%s", idnode_uuid_as_str(&esf->esf_id, ubuf));
   TAILQ_REMOVE(&esfilters[esf->esf_class], esf, esf_link);
   idnode_unlink(&esf->esf_id);
   free(esf->esf_comment);
@@ -208,8 +209,9 @@ static void
 esfilter_class_save(idnode_t *self)
 {
   htsmsg_t *c = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
   idnode_save(self, c);
-  hts_settings_save(c, "esfilter/%s", idnode_uuid_as_sstr(self));
+  hts_settings_save(c, "esfilter/%s", idnode_uuid_as_str(self, ubuf));
   htsmsg_destroy(c);
 }
 
@@ -217,7 +219,8 @@ static const char *
 esfilter_class_get_title(idnode_t *self, const char *lang)
 {
   esfilter_t *esf = (esfilter_t *)self;
-  return idnode_uuid_as_sstr(&esf->esf_id);
+  char ubuf[UUID_HEX_SIZE];
+  return idnode_uuid_as_str(&esf->esf_id, ubuf);
 }
 
 static void
index 714a01e29312637d45b23099b1a2e823a7b91861..2876d9d7ff4817a4d64f68d073b24c2d9f3d86cf 100644 (file)
@@ -538,6 +538,7 @@ serierec_convert(htsp_connection_t *htsp, htsmsg_t *in, channel_t *ch, int autor
   int32_t approx_time, start, start_window, s32;
   int retval;
   const char *str;
+  char ubuf[UUID_HEX_SIZE];
 
   conf = htsmsg_create_map();
   days = htsmsg_create_list();
@@ -629,7 +630,7 @@ serierec_convert(htsp_connection_t *htsp, htsmsg_t *in, channel_t *ch, int autor
 
   /* Allow channel to be cleared on update -> any channel */
   if (ch || !add) {
-    htsmsg_add_str(conf, "channel", ch ? idnode_uuid_as_sstr(&ch->ch_id) : "");
+    htsmsg_add_str(conf, "channel", ch ? idnode_uuid_as_str(&ch->ch_id, ubuf) : "");
   }
   return conf;
 }
@@ -850,6 +851,7 @@ htsp_build_dvrentry(htsp_connection_t *htsp, dvr_entry_t *de, const char *method
   const char *s = NULL, *error = NULL, *subscriptionError = NULL;
   const char *p, *last;
   int64_t fsize = -1;
+  char ubuf[UUID_HEX_SIZE];
 
   htsmsg_add_u32(out, "id", idnode_get_short_uuid(&de->de_id));
   htsmsg_add_u32(out, "enabled", de->de_enabled >= 1 ? 1 : 0);
@@ -860,10 +862,10 @@ htsp_build_dvrentry(htsp_connection_t *htsp, dvr_entry_t *de, const char *method
     htsmsg_add_u32(out, "eventId",  de->de_bcast->id);
 
   if (de->de_autorec)
-    htsmsg_add_str(out, "autorecId", idnode_uuid_as_sstr(&de->de_autorec->dae_id));
+    htsmsg_add_str(out, "autorecId", idnode_uuid_as_str(&de->de_autorec->dae_id, ubuf));
 
   if (de->de_timerec)
-    htsmsg_add_str(out, "timerecId", idnode_uuid_as_sstr(&de->de_timerec->dte_id));
+    htsmsg_add_str(out, "timerecId", idnode_uuid_as_str(&de->de_timerec->dte_id, ubuf));
 
   htsmsg_add_s64(out, "start",       de->de_start);
   htsmsg_add_s64(out, "stop",        de->de_stop);
@@ -968,9 +970,10 @@ static htsmsg_t *
 htsp_build_autorecentry(htsp_connection_t *htsp, dvr_autorec_entry_t *dae, const char *method)
 {
   htsmsg_t *out = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
   int tad;
 
-  htsmsg_add_str(out, "id",          idnode_uuid_as_sstr(&dae->dae_id));
+  htsmsg_add_str(out, "id",          idnode_uuid_as_str(&dae->dae_id, ubuf));
   htsmsg_add_u32(out, "enabled",     dae->dae_enabled >= 1 ? 1 : 0);
   htsmsg_add_u32(out, "maxDuration", dae->dae_maxduration);
   htsmsg_add_u32(out, "minDuration", dae->dae_minduration);
@@ -1029,8 +1032,9 @@ static htsmsg_t *
 htsp_build_timerecentry(htsp_connection_t *htsp, dvr_timerec_entry_t *dte, const char *method)
 {
   htsmsg_t *out = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
 
-  htsmsg_add_str(out, "id",          idnode_uuid_as_sstr(&dte->dte_id));
+  htsmsg_add_str(out, "id",          idnode_uuid_as_str(&dte->dte_id, ubuf));
   htsmsg_add_u32(out, "enabled",     dte->dte_enabled >= 1 ? 1 : 0);
   htsmsg_add_u32(out, "daysOfWeek",  dte->dte_weekdays);
 
@@ -1551,6 +1555,7 @@ htsp_method_epgQuery(htsp_connection_t *htsp, htsmsg_t *in)
   const char *lang;
   int min_duration;
   int max_duration;
+  char ubuf[UUID_HEX_SIZE];
 
   /* Required */
   if( (query = htsmsg_get_str(in, "query")) == NULL )
@@ -1567,13 +1572,13 @@ htsp_method_epgQuery(htsp_connection_t *htsp, htsmsg_t *in)
     if (!(ch = channel_find_by_id(u32)))
       return htsp_error("Channel does not exist");
     else
-      eq.channel = strdup(idnode_uuid_as_sstr(&ch->ch_id));
+      eq.channel = strdup(idnode_uuid_as_str(&ch->ch_id, ubuf));
   }
   if(!(htsmsg_get_u32(in, "tagId", &u32))) {
     if (!(ct = htsp_channel_tag_find_by_identifier(htsp, u32)))
       return htsp_error("Channel tag does not exist");
     else
-      eq.channel_tag = strdup(idnode_uuid_as_sstr(&ct->ct_id));
+      eq.channel_tag = strdup(idnode_uuid_as_str(&ct->ct_id, ubuf));
   }
   if (!htsmsg_get_u32(in, "contentType", &u32)) {
     if(htsp->htsp_version < 6) u32 <<= 4;
@@ -1660,12 +1665,13 @@ htsp_method_getDvrConfigs(htsp_connection_t *htsp, htsmsg_t *in)
   htsmsg_field_t *f;
   dvr_config_t *cfg;
   const char *uuid, *s;
+  char ubuf[UUID_HEX_SIZE];
 
   l = htsmsg_create_list();
 
   LIST_FOREACH(cfg, &dvrconfigs, config_link)
     if (cfg->dvr_enabled) {
-      uuid = idnode_uuid_as_sstr(&cfg->dvr_id);
+      uuid = idnode_uuid_as_str(&cfg->dvr_id, ubuf);
       if (htsp->htsp_granted_access->aa_dvrcfgs) {
         HTSMSG_FOREACH(f, htsp->htsp_granted_access->aa_dvrcfgs) {
           if (!(s = htsmsg_field_get_str(f)))
@@ -1925,6 +1931,7 @@ htsp_method_addAutorecEntry(htsp_connection_t *htsp, htsmsg_t *in)
   const char *str;
   uint32_t u32;
   channel_t *ch = NULL;
+  char ubuf[UUID_HEX_SIZE];
 
   /* Options */
   if(!(str = htsmsg_get_str(in, "title")))
@@ -1946,7 +1953,7 @@ htsp_method_addAutorecEntry(htsp_connection_t *htsp, htsmsg_t *in)
   out = htsmsg_create_map();
 
   if (dae) {
-    htsmsg_add_str(out, "id", idnode_uuid_as_sstr(&dae->dae_id));
+   htsmsg_add_str(out, "id", idnode_uuid_as_str(&dae->dae_id, ubuf));
     htsmsg_add_u32(out, "success", 1);
   }
   else {
@@ -2047,6 +2054,7 @@ htsp_method_addTimerecEntry(htsp_connection_t *htsp, htsmsg_t *in)
   const char *str;
   channel_t *ch = NULL;
   uint32_t u32;
+  char ubuf[UUID_HEX_SIZE];
 
   /* Options */
   if(!(str = htsmsg_get_str(in, "title")))
@@ -2068,7 +2076,7 @@ htsp_method_addTimerecEntry(htsp_connection_t *htsp, htsmsg_t *in)
   out = htsmsg_create_map();
 
   if (dte) {
-    htsmsg_add_str(out, "id", idnode_uuid_as_sstr(&dte->dte_id));
+    htsmsg_add_str(out, "id", idnode_uuid_as_str(&dte->dte_id, ubuf));
     htsmsg_add_u32(out, "success", 1);
   }
   else {
@@ -3491,11 +3499,13 @@ htsp_autorec_entry_update(dvr_autorec_entry_t *dae)
 void
 htsp_autorec_entry_delete(dvr_autorec_entry_t *dae)
 {
+  char ubuf[UUID_HEX_SIZE];
+
   if(dae == NULL)
     return;
 
   htsmsg_t *m = htsmsg_create_map();
-  htsmsg_add_str(m, "id", idnode_uuid_as_sstr(&dae->dae_id));
+  htsmsg_add_str(m, "id", idnode_uuid_as_str(&dae->dae_id, ubuf));
   htsmsg_add_str(m, "method", "autorecEntryDelete");
   htsp_async_send(m, HTSP_ASYNC_ON, HTSP_ASYNC_AUX_AUTOREC, dae);
 }
@@ -3544,11 +3554,13 @@ htsp_timerec_entry_update(dvr_timerec_entry_t *dte)
 void
 htsp_timerec_entry_delete(dvr_timerec_entry_t *dte)
 {
+  char ubuf[UUID_HEX_SIZE];
+
   if(dte == NULL)
     return;
 
   htsmsg_t *m = htsmsg_create_map();
-  htsmsg_add_str(m, "id", idnode_uuid_as_sstr(&dte->dte_id));
+  htsmsg_add_str(m, "id", idnode_uuid_as_str(&dte->dte_id, ubuf));
   htsmsg_add_str(m, "method", "timerecEntryDelete");
   htsp_async_send(m, HTSP_ASYNC_ON, HTSP_ASYNC_AUX_TIMEREC, dte);
 }
index 38c2d6f5951ea9c2241bc43912654000781c6bed..6857152ff1f603616c69e75e3a8a9a7faf8ab1cb 100644 (file)
@@ -47,8 +47,6 @@ static RB_HEAD(,idclass_link) idrootclasses;
 
 SKEL_DECLARE(idclasses_skel, idclass_link_t);
 
-char idnode_uuid_static[UUID_HEX_SIZE];
-
 /* **************************************************************************
  * Utilities
  * *************************************************************************/
@@ -122,6 +120,7 @@ idnode_insert(idnode_t *in, const char *uuid, const idclass_t *class, int flags)
   int retries = 5;
   uint32_t u32;
   const idclass_t *idc;
+  char ubuf[UUID_HEX_SIZE];
 
   lock_assert(&global_lock);
 
@@ -158,7 +157,7 @@ idnode_insert(idnode_t *in, const char *uuid, const idclass_t *class, int flags)
             uuid, (flags & IDNODE_SHORT_UUID) ? " (short)" : "");
     abort();
   }
-  tvhtrace("idnode", "insert node %s", idnode_uuid_as_sstr(in));
+  tvhtrace("idnode", "insert node %s", idnode_uuid_as_str(in, ubuf));
 
   /* Register the class */
   idclass_register(class); // Note: we never actually unregister
@@ -179,10 +178,12 @@ idnode_insert(idnode_t *in, const char *uuid, const idclass_t *class, int flags)
 void
 idnode_unlink(idnode_t *in)
 {
+  char ubuf[UUID_HEX_SIZE];
+
   lock_assert(&global_lock);
   RB_REMOVE(&idnodes, in, in_link);
   RB_REMOVE(in->in_domain, in, in_domain_link);
-  tvhtrace("idnode", "unlink node %s", idnode_uuid_as_sstr(in));
+  tvhtrace("idnode", "unlink node %s", idnode_uuid_as_str(in, ubuf));
   idnode_notify(in, "delete");
 }
 
@@ -253,12 +254,13 @@ idnode_uuid_as_str(const idnode_t *in, char *uuid)
 const char *
 idnode_get_title(idnode_t *in, const char *lang)
 {
+  static char ubuf[UUID_HEX_SIZE];
   const idclass_t *ic = in->in_class;
   for(; ic != NULL; ic = ic->ic_super) {
     if(ic->ic_get_title != NULL)
       return ic->ic_get_title(in, lang);
   }
-  return idnode_uuid_as_sstr(in);
+  return idnode_uuid_as_str(in, ubuf);
 }
 
 
@@ -630,6 +632,7 @@ idnode_find_all ( const idclass_t *idc, const idnodes_rb_t *domain )
 {
   idnode_t *in;
   const idclass_t *ic;
+  char ubuf[UUID_HEX_SIZE];
   tvhtrace("idnode", "find class %s", idc->ic_class);
   idnode_set_t *is = calloc(1, sizeof(idnode_set_t));
   if (domain == NULL)
@@ -639,7 +642,7 @@ idnode_find_all ( const idclass_t *idc, const idnodes_rb_t *domain )
       ic = in->in_class;
       while (ic) {
         if (ic == idc) {
-          tvhtrace("idnode", "  add node %s", idnode_uuid_as_sstr(in));
+          tvhtrace("idnode", "  add node %s", idnode_uuid_as_str(in, ubuf));
           idnode_set_add(is, in, NULL, NULL);
           break;
         }
@@ -651,7 +654,7 @@ idnode_find_all ( const idclass_t *idc, const idnodes_rb_t *domain )
       ic = in->in_class;
       while (ic) {
         if (ic == idc) {
-          tvhtrace("idnode", "  add node %s", idnode_uuid_as_sstr(in));
+          tvhtrace("idnode", "  add node %s", idnode_uuid_as_str(in, ubuf));
           idnode_set_add(is, in, NULL, NULL);
           break;
         }
@@ -1041,9 +1044,10 @@ idnode_set_as_htsmsg
   ( idnode_set_t *is )
 {
   htsmsg_t *l = htsmsg_create_list();
+  char ubuf[UUID_HEX_SIZE];
   int i;
   for (i = 0; i < is->is_count; i++)
-    htsmsg_add_str(l, NULL, idnode_uuid_as_sstr(is->is_array[i]));
+    htsmsg_add_str(l, NULL, idnode_uuid_as_str(is->is_array[i], ubuf));
   return l;
 }
 
@@ -1314,10 +1318,11 @@ idnode_serialize0(idnode_t *self, htsmsg_t *list, int optmask, const char *lang)
 {
   const idclass_t *idc = self->in_class;
   const char *uuid, *s;
+  char ubuf[UUID_HEX_SIZE];
 
   htsmsg_t *m = htsmsg_create_map();
   if (!idc->ic_snode) {
-    uuid = idnode_uuid_as_sstr(self);
+    uuid = idnode_uuid_as_str(self, ubuf);
     htsmsg_add_str(m, "uuid", uuid);
     htsmsg_add_str(m, "id",   uuid);
   }
@@ -1447,9 +1452,10 @@ idnode_list_get1
 {
   idnode_list_mapping_t *ilm;
   htsmsg_t *l = htsmsg_create_list();
+  char ubuf[UUID_HEX_SIZE];
 
   LIST_FOREACH(ilm, in1_list, ilm_in1_link)
-    htsmsg_add_str(l, NULL, idnode_uuid_as_sstr(ilm->ilm_in2));
+    htsmsg_add_str(l, NULL, idnode_uuid_as_str(ilm->ilm_in2, ubuf));
   return l;
 }
 
@@ -1459,9 +1465,10 @@ idnode_list_get2
 {
   idnode_list_mapping_t *ilm;
   htsmsg_t *l = htsmsg_create_list();
+  char ubuf[UUID_HEX_SIZE];
 
   LIST_FOREACH(ilm, in2_list, ilm_in2_link)
-    htsmsg_add_str(l, NULL, idnode_uuid_as_sstr(ilm->ilm_in1));
+    htsmsg_add_str(l, NULL, idnode_uuid_as_str(ilm->ilm_in1, ubuf));
   return l;
 }
 
@@ -1587,7 +1594,8 @@ void
 idnode_notify ( idnode_t *in, const char *action )
 {
   const idclass_t *ic = in->in_class;
-  const char *uuid = idnode_uuid_as_sstr(in);
+  char ubuf[UUID_HEX_SIZE];
+  const char *uuid = idnode_uuid_as_str(in, ubuf);
 
   if (!tvheadend_running)
     return;
@@ -1612,8 +1620,9 @@ idnode_notify_changed (void *in)
 void
 idnode_notify_title_changed (void *in, const char *lang)
 {
+  char ubuf[UUID_HEX_SIZE];
   htsmsg_t *m = htsmsg_create_map();
-  htsmsg_add_str(m, "uuid", idnode_uuid_as_sstr(in));
+  htsmsg_add_str(m, "uuid", idnode_uuid_as_str(in, ubuf));
   htsmsg_add_str(m, "text", idnode_get_title(in, lang));
   notify_by_msg("title", m, 0);
   idnode_notify_changed(in);
index a639d642501e9ff46f2772e7ab3b15cba6dfe8ff..53665706c531a2c1d8a0f3aa3a9eb5f07dc7caba 100644 (file)
@@ -161,8 +161,6 @@ typedef struct idnode_filter_ele
 
 typedef LIST_HEAD(,idnode_filter_ele) idnode_filter_t;
 
-extern char idnode_uuid_static[UUID_HEX_SIZE];
-
 extern idnode_t tvhlog_conf;
 extern const idclass_t tvhlog_conf_class;
 
@@ -176,8 +174,6 @@ void idnode_unlink(idnode_t *in);
 
 uint32_t      idnode_get_short_uuid (const idnode_t *in);
 const char   *idnode_uuid_as_str  (const idnode_t *in, char *buf);
-static inline const char *idnode_uuid_as_sstr(const idnode_t *in)
-  { return idnode_uuid_as_str(in, idnode_uuid_static); }
 idnode_set_t *idnode_get_childs   (idnode_t *in);
 const char   *idnode_get_title    (idnode_t *in, const char *lang);
 int           idnode_is_leaf      (idnode_t *in);
index 537c2257d6785a30a573c53d2f0ac46e42b9e33a..7e2ef4d0c45affcdefc135bb220e7566153ce90d 100644 (file)
@@ -146,10 +146,11 @@ static void
 dvb_fs_mux_add ( mpegts_table_t *mt, mpegts_mux_t *mm, mpegts_mux_t *mux )
 {
   const char *uuid;
+  char ubuf[UUID_HEX_SIZE];
   char *s;
   int i;
 
-  uuid = idnode_uuid_as_sstr(&mux->mm_id);
+  uuid = idnode_uuid_as_str(&mux->mm_id, ubuf);
   if (mm->mm_fastscan_muxes == NULL)
     mm->mm_fastscan_muxes = calloc(DVB_FASTSCAN_MUXES, UUID_HEX_SIZE);
   for (i = 0; i < DVB_FASTSCAN_MUXES * UUID_HEX_SIZE; i += UUID_HEX_SIZE) {
index 72344775308b125f22c2b54d6ae7d2bc3e31db6f..d4f577223ed876f2e4cff867bc0393744e8247e2 100644 (file)
@@ -90,8 +90,8 @@ iptv_handler_find ( const char *scheme )
 static bouquet_t *
 iptv_bouquet_get (iptv_network_t *in, int create)
 {
-  char buf[128];
-  snprintf(buf, sizeof(buf), "iptv-network://%s", idnode_uuid_as_sstr(&in->mn_id));
+  char buf[128], ubuf[UUID_HEX_SIZE];
+  snprintf(buf, sizeof(buf), "iptv-network://%s", idnode_uuid_as_str(&in->mn_id, ubuf));
   return bouquet_find_by_source(in->mn_network_name, buf, create);
 }
 
@@ -649,6 +649,7 @@ iptv_network_delete ( mpegts_network_t *mn, int delconf )
   char *sane_url = in->in_url_sane;
   char *icon_url = in->in_icon_url;
   char *icon_url_sane = in->in_icon_url_sane;
+  char ubuf[UUID_HEX_SIZE];
 
   gtimer_disarm(&in->in_bouquet_timer);
 
@@ -658,7 +659,7 @@ iptv_network_delete ( mpegts_network_t *mn, int delconf )
   /* Remove config */
   if (delconf) {
     hts_settings_remove("input/iptv/networks/%s",
-                        idnode_uuid_as_sstr(&in->mn_id));
+                        idnode_uuid_as_str(&in->mn_id, ubuf));
     bouquet_delete(iptv_bouquet_get(in, 0));
   }
 
@@ -895,9 +896,10 @@ static void
 iptv_network_config_save ( mpegts_network_t *mn )
 {
   htsmsg_t *c = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
   idnode_save(&mn->mn_id, c);
   hts_settings_save(c, "input/iptv/networks/%s/config",
-                    idnode_uuid_as_sstr(&mn->mn_id));
+                    idnode_uuid_as_str(&mn->mn_id, ubuf));
   htsmsg_destroy(c);
 }
 
@@ -907,6 +909,7 @@ iptv_network_create0
 {
   iptv_network_t *in = calloc(1, sizeof(*in));
   htsmsg_t *c;
+  char ubuf[UUID_HEX_SIZE];
 
   /* Init Network */
   in->in_scan_create        = 1;
@@ -936,7 +939,7 @@ iptv_network_create0
 
   /* Load muxes */
   if ((c = hts_settings_load_r(1, "input/iptv/networks/%s/muxes",
-                                idnode_uuid_as_sstr(&in->mn_id)))) {
+                                idnode_uuid_as_str(&in->mn_id, ubuf)))) {
     htsmsg_field_t *f;
     htsmsg_t *e;
     HTSMSG_FOREACH(f, c) {
index 224d7e636d8ef6f155b3c69b898baa3bc1acce05..6f12fb6df1e94f8f4cb3394e694409df1301dbb1 100644 (file)
@@ -253,12 +253,13 @@ const idclass_t iptv_mux_class =
 static void
 iptv_mux_config_save ( mpegts_mux_t *mm )
 {
-  char ubuf[UUID_HEX_SIZE];
+  char ubuf1[UUID_HEX_SIZE];
+  char ubuf2[UUID_HEX_SIZE];
   htsmsg_t *c = htsmsg_create_map();
   mpegts_mux_save(mm, c);
   hts_settings_save(c, "input/iptv/networks/%s/muxes/%s/config",
-                    idnode_uuid_as_sstr(&mm->mm_network->mn_id),
-                    idnode_uuid_as_str(&mm->mm_id, ubuf));
+                    idnode_uuid_as_str(&mm->mm_network->mn_id, ubuf1),
+                    idnode_uuid_as_str(&mm->mm_id, ubuf2));
   htsmsg_destroy(c);
 }
 
@@ -266,12 +267,13 @@ static void
 iptv_mux_delete ( mpegts_mux_t *mm, int delconf )
 {
   iptv_mux_t *im = (iptv_mux_t*)mm, copy;
-  char ubuf[UUID_HEX_SIZE];
+  char ubuf1[UUID_HEX_SIZE];
+  char ubuf2[UUID_HEX_SIZE];
 
   if (delconf)
     hts_settings_remove("input/iptv/networks/%s/muxes/%s/config",
-                        idnode_uuid_as_sstr(&mm->mm_network->mn_id),
-                        idnode_uuid_as_str(&mm->mm_id, ubuf));
+                        idnode_uuid_as_str(&mm->mm_network->mn_id, ubuf1),
+                        idnode_uuid_as_str(&mm->mm_id, ubuf2));
 
   copy = *im; /* keep pointers */
   mpegts_mux_delete(mm, delconf);
@@ -311,7 +313,8 @@ iptv_mux_create0 ( iptv_network_t *in, const char *uuid, htsmsg_t *conf )
   htsmsg_t *c, *e;
   htsmsg_field_t *f;
   iptv_service_t *ms;
-  char ubuf[UUID_HEX_SIZE];
+  char ubuf1[UUID_HEX_SIZE];
+  char ubuf2[UUID_HEX_SIZE];
 
   /* Create Mux */
   iptv_mux_t *im =
@@ -335,8 +338,8 @@ iptv_mux_create0 ( iptv_network_t *in, const char *uuid, htsmsg_t *conf )
 
   /* Services */
   c = hts_settings_load_r(1, "input/iptv/networks/%s/muxes/%s/services",
-                          idnode_uuid_as_sstr(&in->mn_id),
-                          idnode_uuid_as_str(&im->mm_id, ubuf));
+                          idnode_uuid_as_str(&in->mn_id, ubuf1),
+                          idnode_uuid_as_str(&im->mm_id, ubuf2));
   if (c) {
     HTSMSG_FOREACH(f, c) {
       if (!(e = htsmsg_field_get_map(f))) continue;
index a09db9dab3617ec3341d925f15178cfd5fe67995..31c54af351acb1b495ab1d59b9e0768b844a2b38 100644 (file)
@@ -27,12 +27,13 @@ iptv_service_config_save ( service_t *s )
 {
   mpegts_mux_t     *mm = ((mpegts_service_t *)s)->s_dvb_mux;
   htsmsg_t         *c  = htsmsg_create_map();
+  char ubuf0[UUID_HEX_SIZE];
   char ubuf1[UUID_HEX_SIZE];
   char ubuf2[UUID_HEX_SIZE];
 
   service_save(s, c);
   hts_settings_save(c, "input/iptv/networks/%s/muxes/%s/services/%s",
-                    idnode_uuid_as_sstr(&mm->mm_network->mn_id),
+                    idnode_uuid_as_str(&mm->mm_network->mn_id, ubuf0),
                     idnode_uuid_as_str(&mm->mm_id, ubuf1),
                     idnode_uuid_as_str(&s->s_id, ubuf2));
   htsmsg_destroy(c);
@@ -43,13 +44,14 @@ iptv_service_delete ( service_t *s, int delconf )
 {
   iptv_service_t   *is = (iptv_service_t *)s;
   mpegts_mux_t     *mm = is->s_dvb_mux;
+  char ubuf0[UUID_HEX_SIZE];
   char ubuf1[UUID_HEX_SIZE];
   char ubuf2[UUID_HEX_SIZE];
 
   /* Remove config */
   if (delconf)
     hts_settings_remove("input/iptv/networks/%s/muxes/%s/services/%s",
-                        idnode_uuid_as_sstr(&mm->mm_network->mn_id),
+                        idnode_uuid_as_str(&mm->mm_network->mn_id, ubuf0),
                         idnode_uuid_as_str(&mm->mm_id, ubuf1),
                         idnode_uuid_as_str(&s->s_id, ubuf2));
 
index 75e598e995145f6cafb7f5db448db4daa009da70..ff17bf1cd61dbd5f20b41e0dce2d25de5b72ba7d 100644 (file)
@@ -108,6 +108,7 @@ linuxdvb_adapter_save ( linuxdvb_adapter_t *la )
 #if ENABLE_LINUXDVB_CA
   linuxdvb_ca_t *lca;
 #endif
+  char ubuf[UUID_HEX_SIZE];
 
   m = htsmsg_create_map();
   idnode_save(&la->th_id, m);
@@ -128,7 +129,7 @@ linuxdvb_adapter_save ( linuxdvb_adapter_t *la )
 
   /* Save */
   hts_settings_save(m, "input/linuxdvb/adapters/%s",
-                    idnode_uuid_as_sstr(&la->th_id));
+                    idnode_uuid_as_str(&la->th_id, ubuf));
   htsmsg_destroy(m);
 }
 
index 9c3401bd07a3701c3ba3ed06c1a45d0b8f313a6b..3a93f44a0d28e5773b114f9cee17521b5adb023e 100644 (file)
@@ -901,10 +901,10 @@ linuxdvb_ca_enqueue_capmt(linuxdvb_ca_t *lca, uint8_t slot, const uint8_t *ptr,
 
 void linuxdvb_ca_save( linuxdvb_ca_t *lca, htsmsg_t *msg )
 {
-  char id[8];
+  char id[8], ubuf[UUID_HEX_SIZE];
   htsmsg_t *m = htsmsg_create_map();
 
-  htsmsg_add_str(m, "uuid", idnode_uuid_as_sstr(&lca->lca_id));
+  htsmsg_add_str(m, "uuid", idnode_uuid_as_str(&lca->lca_id, ubuf));
   idnode_save(&lca->lca_id, m);
 
   /* Add to list */
index 2e0e677cb40b691d7541333130adf7024fb5f6cd..2b36c656708ed4dc73cec6a4a379133783e09ff4 100644 (file)
@@ -195,6 +195,7 @@ linuxdvb_frontend_dvbs_class_master_enum( void * self, const char *lang )
   linuxdvb_frontend_t *lfe = self, *lfe2;
   linuxdvb_adapter_t *la;
   tvh_hardware_t *th;
+  char ubuf[UUID_HEX_SIZE];
   htsmsg_t *m = htsmsg_create_list();
   htsmsg_t *e = htsmsg_create_map();
   htsmsg_add_str(e, "key", "");
@@ -206,7 +207,7 @@ linuxdvb_frontend_dvbs_class_master_enum( void * self, const char *lang )
     LIST_FOREACH(lfe2, &la->la_frontends, lfe_link) {
       if (lfe2 != lfe && lfe2->lfe_type == lfe->lfe_type) {
         e = htsmsg_create_map();
-        htsmsg_add_str(e, "key", idnode_uuid_as_sstr(&lfe2->ti_id));
+        htsmsg_add_str(e, "key", idnode_uuid_as_str(&lfe2->ti_id, ubuf));
         htsmsg_add_str(e, "val", lfe2->mi_name);
         htsmsg_add_msg(m, NULL, e);
       }
@@ -360,6 +361,7 @@ linuxdvb_frontend_is_enabled ( mpegts_input_t *mi, mpegts_mux_t *mm, int flags )
   linuxdvb_frontend_t *lfe = (linuxdvb_frontend_t*)mi, *lfe2;
   linuxdvb_adapter_t *la;
   tvh_hardware_t *th;
+  char ubuf[UUID_HEX_SIZE];
 
   if (lfe->lfe_fe_path == NULL) return 0;
   if (!mpegts_input_is_enabled(mi, mm, flags)) return 0;
@@ -374,13 +376,13 @@ linuxdvb_frontend_is_enabled ( mpegts_input_t *mi, mpegts_mux_t *mm, int flags )
     LIST_FOREACH(lfe2, &la->la_frontends, lfe_link) {
       if (lfe2 == lfe) continue;
       if (lfe2->lfe_type != DVB_TYPE_S) continue;
-      if (lfe->lfe_master && !strcmp(lfe->lfe_master, idnode_uuid_as_sstr(&lfe2->ti_id))) {
+      if (lfe->lfe_master && !strcmp(lfe->lfe_master, idnode_uuid_as_str(&lfe2->ti_id, ubuf))) {
         if (lfe2->lfe_satconf == NULL)
           return 0; /* invalid master */
         return linuxdvb_satconf_match_mux(lfe2->lfe_satconf, mm);
       }
       if (lfe2->lfe_master &&
-          !strcmp(lfe2->lfe_master, idnode_uuid_as_sstr(&lfe->ti_id)) &&
+          !strcmp(lfe2->lfe_master, idnode_uuid_as_str(&lfe->ti_id, ubuf)) &&
           lfe2->lfe_refcount > 0) {
         if (lfe->lfe_satconf == NULL)
           return 0;
@@ -1754,17 +1756,17 @@ linuxdvb_frontend_create
 void
 linuxdvb_frontend_save ( linuxdvb_frontend_t *lfe, htsmsg_t *fe )
 {
-  char id[16];
+  char id[16], ubuf[UUID_HEX_SIZE];
   htsmsg_t *m = htsmsg_create_map();
 
   /* Save frontend */
   mpegts_input_save((mpegts_input_t*)lfe, m);
   htsmsg_add_str(m, "type", dvb_type2str(lfe->lfe_type));
-  htsmsg_add_str(m, "uuid", idnode_uuid_as_sstr(&lfe->ti_id));
+  htsmsg_add_str(m, "uuid", idnode_uuid_as_str(&lfe->ti_id, ubuf));
   if (lfe->lfe_satconf && !lfe->lfe_master) {
     htsmsg_t *s = htsmsg_create_map();
     linuxdvb_satconf_save(lfe->lfe_satconf, s);
-    htsmsg_add_str(s, "uuid", idnode_uuid_as_sstr(&lfe->lfe_satconf->ls_id));
+    htsmsg_add_str(s, "uuid", idnode_uuid_as_str(&lfe->lfe_satconf->ls_id, ubuf));
     htsmsg_add_msg(m, "satconf", s);
   }
   htsmsg_delete_field(m, "fe_master");
index f6a72b34f352664a7bc6adbed34c7f34e33f789c..b0ed1d6b133e25fc9f5d76930eb374606676a4dc 100644 (file)
@@ -1037,13 +1037,14 @@ linuxdvb_satconf_save ( linuxdvb_satconf_t *ls, htsmsg_t *m )
 {
   linuxdvb_satconf_ele_t *lse;
   htsmsg_t *l, *e, *c;
+  char ubuf[UUID_HEX_SIZE];
   htsmsg_add_str(m, "type", ls->ls_type);
   idnode_save(&ls->ls_id, m);
   l = htsmsg_create_list();
   TAILQ_FOREACH(lse, &ls->ls_elements, lse_link){ 
     e = htsmsg_create_map();
     idnode_save(&lse->lse_id, e);
-    htsmsg_add_str(e, "uuid", idnode_uuid_as_sstr(&lse->lse_id));
+    htsmsg_add_str(e, "uuid", idnode_uuid_as_str(&lse->lse_id, ubuf));
     if (lse->lse_lnb) {
       c = htsmsg_create_map();
       idnode_save(&lse->lse_lnb->ld_id, c);
@@ -1092,6 +1093,7 @@ linuxdvb_satconf_ele_class_network_set( void *o, const void *p )
   htsmsg_field_t *f;
   const char *str;
   int i, save;
+  char ubuf[UUID_HEX_SIZE];
 
   HTSMSG_FOREACH(f, msg) {
     if (!(str = htsmsg_field_get_str(f))) continue;
@@ -1118,7 +1120,7 @@ linuxdvb_satconf_ele_class_network_set( void *o, const void *p )
     TAILQ_FOREACH(lse, &sc->ls_elements, lse_link) {
       for (i = 0; i < lse->lse_networks->is_count; i++)
         htsmsg_add_str(l, NULL,
-                       idnode_uuid_as_sstr(lse->lse_networks->is_array[i]));
+                       idnode_uuid_as_str(lse->lse_networks->is_array[i], ubuf));
     }
     mpegts_input_class_network_set(ls->lse_parent->ls_frontend, l);
     htsmsg_destroy(l);
@@ -1402,8 +1404,9 @@ void
 linuxdvb_satconf_delete ( linuxdvb_satconf_t *ls, int delconf )
 {
   linuxdvb_satconf_ele_t *lse, *nxt;
+  char ubuf[UUID_HEX_SIZE];
   if (delconf)
-    hts_settings_remove("input/linuxdvb/satconfs/%s", idnode_uuid_as_sstr(&ls->ls_id));
+    hts_settings_remove("input/linuxdvb/satconfs/%s", idnode_uuid_as_str(&ls->ls_id, ubuf));
   gtimer_disarm(&ls->ls_diseqc_timer);
   for (lse = TAILQ_FIRST(&ls->ls_elements); lse != NULL; lse = nxt) {
     nxt = TAILQ_NEXT(lse, lse_link);
index 1914df1a5d585e936f9694c14bc6b6e5bcc6ff03..28ecadd47d373d248dcc516b85b0b845633260d8 100644 (file)
@@ -44,7 +44,7 @@ static void
 mpegts_input_dbus_notify(mpegts_input_t *mi, int64_t subs)
 {
 #if ENABLE_DBUS_1
-  char buf[256];
+  char buf[256], ubuf[UUID_HEX_SIZE];
   htsmsg_t *msg;
 
   if (mi->mi_dbus_subs == subs)
@@ -54,7 +54,7 @@ mpegts_input_dbus_notify(mpegts_input_t *mi, int64_t subs)
   mi->mi_display_name(mi, buf, sizeof(buf));
   htsmsg_add_str(msg, NULL, buf);
   htsmsg_add_s64(msg, NULL, subs);
-  snprintf(buf, sizeof(buf), "/input/mpegts/%s", idnode_uuid_as_sstr(&mi->ti_id));
+  snprintf(buf, sizeof(buf), "/input/mpegts/%s", idnode_uuid_as_str(&mi->ti_id, ubuf));
   dbus_emit_signal(buf, "status", msg);
 #endif
 }
@@ -78,9 +78,10 @@ mpegts_input_class_network_get ( void *obj )
   mpegts_network_link_t *mnl;  
   mpegts_input_t *mi = obj;
   htsmsg_t       *l  = htsmsg_create_list();
+  char ubuf[UUID_HEX_SIZE];
 
   LIST_FOREACH(mnl, &mi->mi_networks, mnl_mi_link)
-    htsmsg_add_str(l, NULL, idnode_uuid_as_sstr(&mnl->mnl_network->mn_id));
+    htsmsg_add_str(l, NULL, idnode_uuid_as_str(&mnl->mnl_network->mn_id, ubuf));
 
   return l;
 }
@@ -95,12 +96,13 @@ htsmsg_t *
 mpegts_input_class_network_enum ( void *obj, const char *lang )
 {
   htsmsg_t *p, *m;
+  char ubuf[UUID_HEX_SIZE];
 
   if (!obj)
     return NULL;
 
   p = htsmsg_create_map();
-  htsmsg_add_str (p, "uuid",    idnode_uuid_as_sstr((idnode_t*)obj));
+  htsmsg_add_str (p, "uuid",    idnode_uuid_as_str((idnode_t*)obj, ubuf));
   htsmsg_add_bool(p, "enum",    1);
 
   m = htsmsg_create_map();
@@ -147,6 +149,7 @@ static int
 mpegts_input_class_linked_set ( void *self, const void *val )
 {
   mpegts_input_t *mi = self, *mi2;
+  char ubuf[UUID_HEX_SIZE];
 
   if (strcmp(val ?: "", mi->mi_linked ?: "")) {
     mi2 = mpegts_input_find(mi->mi_linked);
@@ -163,7 +166,7 @@ mpegts_input_class_linked_set ( void *self, const void *val )
       mi2 = mpegts_input_find((char *)val);
       if (mi2) {
         free(mi2->mi_linked);
-        mi2->mi_linked = strdup(idnode_uuid_as_sstr(&mi->ti_id));
+        mi2->mi_linked = strdup(idnode_uuid_as_str(&mi->ti_id, ubuf));
       }
     }
     if (mi2)
@@ -176,15 +179,14 @@ mpegts_input_class_linked_set ( void *self, const void *val )
 static const void *
 mpegts_input_class_linked_get ( void *self )
 {
-  static const char *ptr;
   mpegts_input_t *mi = self;
-  ptr = "";
+  prop_sbuf[0] = '\0';
   if (mi->mi_linked) {
     mi = mpegts_input_find(mi->mi_linked);
     if (mi)
-      ptr = idnode_uuid_as_sstr(&mi->ti_id);
+      idnode_uuid_as_str(&mi->ti_id, prop_sbuf);
   }
-  return &ptr;
+  return &prop_sbuf_ptr;
 }
 
 static void
@@ -1537,7 +1539,7 @@ mpegts_input_stream_status
   ( mpegts_mux_instance_t *mmi, tvh_input_stream_t *st )
 {
   int s = 0, w = 0;
-  char buf[512];
+  char buf[512], ubuf[UUID_HEX_SIZE];
   th_subscription_t *ths;
   const service_t *t;
   mpegts_mux_t *mm = mmi->mmi_mux;
@@ -1550,7 +1552,7 @@ mpegts_input_stream_status
         w = MAX(w, ths->ths_weight);
       }
 
-  st->uuid        = strdup(idnode_uuid_as_sstr(&mmi->tii_id));
+  st->uuid        = strdup(idnode_uuid_as_str(&mmi->tii_id, ubuf));
   mi->mi_display_name(mi, buf, sizeof(buf));
   st->input_name  = strdup(buf);
   mpegts_mux_nice_name(mm, buf, sizeof(buf));
@@ -1565,11 +1567,11 @@ void
 mpegts_input_empty_status
   ( mpegts_input_t *mi, tvh_input_stream_t *st )
 {
-  char buf[512];
+  char buf[512], ubuf[UUID_HEX_SIZE];
   tvh_input_instance_t *mmi_;
   mpegts_mux_instance_t *mmi;
 
-  st->uuid        = strdup(idnode_uuid_as_sstr(&mi->ti_id));
+  st->uuid        = strdup(idnode_uuid_as_str(&mi->ti_id, ubuf));
   mi->mi_display_name(mi, buf, sizeof(buf));
   st->input_name  = strdup(buf);
   LIST_FOREACH(mmi_, &mi->mi_mux_instances, tii_input_link) {
index 0e985491b2dccbc0df6c90b4096bc9c06547f500..8fdf804a7acd8faa3e40588df59132c56ab4d519 100644 (file)
@@ -355,13 +355,12 @@ mpegts_mux_class_get_network ( void *ptr )
 static const void *
 mpegts_mux_class_get_network_uuid ( void *ptr )
 {
-  static char buf[UUID_HEX_SIZE], *s = buf;
   mpegts_mux_t *mm = ptr;
   if (mm && mm->mm_network)
-    strcpy(buf, idnode_uuid_as_sstr(&mm->mm_network->mn_id) ?: "");
+    idnode_uuid_as_str(&mm->mm_network->mn_id, prop_sbuf);
   else
-    *buf = 0;
-  return &s;
+    prop_sbuf[0] = '\0';
+  return &prop_sbuf_ptr;
 }
 
 static const void *
index 039fff78e0737fb5a018289d206c1279ecd771d4..3b7e8c94fc2ea13706ba5fc611161f310efc4aca 100644 (file)
@@ -680,12 +680,13 @@ const idclass_t dvb_mux_atsc_class =
 static void
 dvb_mux_config_save ( mpegts_mux_t *mm )
 {
-  char ubuf[UUID_HEX_SIZE];
+  char ubuf1[UUID_HEX_SIZE];
+  char ubuf2[UUID_HEX_SIZE];
   htsmsg_t *c = htsmsg_create_map();
   mpegts_mux_save(mm, c);
   hts_settings_save(c, "input/dvb/networks/%s/muxes/%s/config",
-                    idnode_uuid_as_sstr(&mm->mm_network->mn_id),
-                    idnode_uuid_as_str(&mm->mm_id, ubuf));
+                    idnode_uuid_as_str(&mm->mm_network->mn_id, ubuf1),
+                    idnode_uuid_as_str(&mm->mm_id, ubuf2));
   htsmsg_destroy(c);
 }
 
@@ -732,13 +733,14 @@ dvb_mux_create_instances ( mpegts_mux_t *mm )
 static void
 dvb_mux_delete ( mpegts_mux_t *mm, int delconf )
 {
-  char ubuf[UUID_HEX_SIZE];
+  char ubuf1[UUID_HEX_SIZE];
+  char ubuf2[UUID_HEX_SIZE];
 
   /* Remove config */
   if (delconf)
     hts_settings_remove("input/dvb/networks/%s/muxes/%s",
-                      idnode_uuid_as_sstr(&mm->mm_network->mn_id),
-                      idnode_uuid_as_str(&mm->mm_id, ubuf));
+                      idnode_uuid_as_str(&mm->mm_network->mn_id, ubuf1),
+                      idnode_uuid_as_str(&mm->mm_id, ubuf2));
 
   /* Delete the mux */
   mpegts_mux_delete(mm, delconf);
@@ -760,7 +762,8 @@ dvb_mux_create0
   htsmsg_t *c, *e;
   htsmsg_field_t *f;
   dvb_fe_delivery_system_t delsys;
-  char ubuf[UUID_HEX_SIZE];
+  char ubuf1[UUID_HEX_SIZE];
+  char ubuf2[UUID_HEX_SIZE];
 
   /* Class */
   if (ln->ln_type == DVB_TYPE_S) {
@@ -810,8 +813,8 @@ dvb_mux_create0
 
   /* Services */
   c = hts_settings_load_r(1, "input/dvb/networks/%s/muxes/%s/services",
-                         idnode_uuid_as_sstr(&ln->mn_id),
-                         idnode_uuid_as_str(&mm->mm_id, ubuf));
+                         idnode_uuid_as_str(&ln->mn_id, ubuf1),
+                         idnode_uuid_as_str(&mm->mm_id, ubuf2));
   if (c) {
     HTSMSG_FOREACH(f, c) {
       if (!(e = htsmsg_get_map_by_field(f))) continue;
index 6d66548ed87e7d716e065c0ffbc5ea36d33e3a99..590e92b383e3c2e2e76777c8b1b4fbd32015d9bd 100644 (file)
@@ -298,17 +298,20 @@ void
 mpegts_mux_sched_save ( mpegts_mux_sched_t *mms )
 {
   htsmsg_t *c = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
   idnode_save(&mms->mms_id, c);
-  hts_settings_save(c, "muxsched/%s", idnode_uuid_as_sstr(&mms->mms_id));
+  hts_settings_save(c, "muxsched/%s", idnode_uuid_as_str(&mms->mms_id, ubuf));
   htsmsg_destroy(c);
 }
 
 void
 mpegts_mux_sched_delete ( mpegts_mux_sched_t *mms, int delconf )
 {
+  char ubuf[UUID_HEX_SIZE];
+
   LIST_REMOVE(mms, mms_link);
   if (delconf)
-    hts_settings_remove("muxsched/%s", idnode_uuid_as_sstr(&mms->mms_id));
+    hts_settings_remove("muxsched/%s", idnode_uuid_as_str(&mms->mms_id, ubuf));
   if (mms->mms_sub)
     subscription_unsubscribe(mms->mms_sub, UNSUBSCRIBE_FINAL);
   gtimer_disarm(&mms->mms_timer);
index 8c0a8151b81ebecf71463c22875c44ee58e4cd92..ddeeca834a86417017a32c61c479c790221b3fd3 100644 (file)
@@ -43,10 +43,11 @@ static void
 dvb_network_class_delete ( idnode_t *in )
 {
   mpegts_network_t *mn = (mpegts_network_t*)in;
+  char ubuf[UUID_HEX_SIZE];
 
   /* remove config */
   hts_settings_remove("input/dvb/networks/%s", 
-                      idnode_uuid_as_sstr(in));
+                      idnode_uuid_as_str(in, ubuf));
 
   /* Parent delete */
   mpegts_network_delete(mn, 1);
@@ -405,10 +406,11 @@ static void
 dvb_network_config_save ( mpegts_network_t *mn )
 {
   htsmsg_t *c = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
   idnode_save(&mn->mn_id, c);
   htsmsg_add_str(c, "class", mn->mn_id.in_class->ic_class);
   hts_settings_save(c, "input/dvb/networks/%s/config",
-                    idnode_uuid_as_sstr(&mn->mn_id));
+                    idnode_uuid_as_str(&mn->mn_id, ubuf));
   htsmsg_destroy(c);
 }
 
index ba40980bfb2c90a80dc109d72e5455e54ae6d085..c0bb437440e5b6009d137bb4fe191c951de3b5cd 100644 (file)
@@ -48,13 +48,12 @@ mpegts_service_class_get_mux ( void *ptr )
 static const void *
 mpegts_service_class_get_mux_uuid ( void *ptr )
 {
-  static char buf[UUID_HEX_SIZE], *s = buf;
   mpegts_service_t *ms = ptr;
   if (ms && ms->s_dvb_mux)
-    strcpy(buf, idnode_uuid_as_sstr(&ms->s_dvb_mux->mm_id) ?: "");
+    idnode_uuid_as_str(&ms->s_dvb_mux->mm_id, prop_sbuf);
   else
-    *buf = 0;
-  return &s;
+    prop_sbuf[0] = '\0';
+  return &prop_sbuf_ptr;
 }
 
 static const void *
@@ -275,11 +274,12 @@ mpegts_service_config_save ( service_t *t )
 {
   htsmsg_t *c = htsmsg_create_map();
   mpegts_service_t *s = (mpegts_service_t*)t;
+  char ubuf0[UUID_HEX_SIZE];
   char ubuf1[UUID_HEX_SIZE];
   char ubuf2[UUID_HEX_SIZE];
   service_save(t, c);
   hts_settings_save(c, "input/dvb/networks/%s/muxes/%s/services/%s",
-                    idnode_uuid_as_sstr(&s->s_dvb_mux->mm_network->mn_id),
+                    idnode_uuid_as_str(&s->s_dvb_mux->mm_network->mn_id, ubuf0),
                     idnode_uuid_as_str(&s->s_dvb_mux->mm_id, ubuf1),
                     idnode_uuid_as_str(&s->s_id, ubuf2));
   htsmsg_destroy(c);
@@ -652,13 +652,14 @@ mpegts_service_delete ( service_t *t, int delconf )
 {
   mpegts_service_t *ms = (mpegts_service_t*)t;
   mpegts_mux_t     *mm = ms->s_dvb_mux;
+  char ubuf0[UUID_HEX_SIZE];
   char ubuf1[UUID_HEX_SIZE];
   char ubuf2[UUID_HEX_SIZE];
 
   /* Remove config */
   if (delconf && t->s_type == STYPE_STD)
     hts_settings_remove("input/dvb/networks/%s/muxes/%s/services/%s",
-                      idnode_uuid_as_sstr(&mm->mm_network->mn_id),
+                      idnode_uuid_as_str(&mm->mm_network->mn_id, ubuf0),
                       idnode_uuid_as_str(&mm->mm_id, ubuf1),
                       idnode_uuid_as_str(&t->s_id, ubuf2));
 
index d30aa976a5223c770f306fc100206517d3e81139..d0afd9edc4468354632341bad31089328b213a0d 100644 (file)
@@ -45,14 +45,14 @@ static void
 satip_device_dbus_notify( satip_device_t *sd, const char *sig_name )
 {
 #if ENABLE_DBUS_1
-  char buf[256];
+  char buf[256], ubuf[UUID_HEX_SIZE];
 
   htsmsg_t *msg = htsmsg_create_list();
   htsmsg_add_str(msg, NULL, sd->sd_info.addr);
   htsmsg_add_str(msg, NULL, sd->sd_info.location);
   htsmsg_add_str(msg, NULL, sd->sd_info.server);
   htsmsg_add_s64(msg, NULL, sd->sd_info.rtsp_port);
-  snprintf(buf, sizeof(buf), "/input/mpegts/satip/%s", idnode_uuid_as_sstr(&sd->th_id));
+  snprintf(buf, sizeof(buf), "/input/mpegts/satip/%s", idnode_uuid_as_str(&sd->th_id, ubuf));
   dbus_emit_signal(buf, sig_name, msg);
 #endif
 }
@@ -656,6 +656,7 @@ satip_device_save( satip_device_t *sd )
 {
   satip_frontend_t *lfe;
   htsmsg_t *m, *l;
+  char ubuf[UUID_HEX_SIZE];
 
   if (sd->sd_nosave)
     return;
@@ -669,7 +670,7 @@ satip_device_save( satip_device_t *sd )
   htsmsg_add_msg(m, "frontends", l);
 
   hts_settings_save(m, "input/satip/adapters/%s",
-                    idnode_uuid_as_sstr(&sd->th_id));
+                    idnode_uuid_as_str(&sd->th_id, ubuf));
   htsmsg_destroy(m);
 }
 
index 998de49548e87cda5c64cc0fe5435f238207a60a..4c690b754dc617dcd7154200b9307cf17f3dfb1a 100644 (file)
@@ -1848,13 +1848,13 @@ satip_frontend_create
 void
 satip_frontend_save ( satip_frontend_t *lfe, htsmsg_t *fe )
 {
-  char id[16];
+  char id[16], ubuf[UUID_HEX_SIZE];
   htsmsg_t *m = htsmsg_create_map();
 
   /* Save frontend */
   mpegts_input_save((mpegts_input_t*)lfe, m);
   htsmsg_add_str(m, "type", dvb_type2str(lfe->sf_type));
-  htsmsg_add_str(m, "uuid", idnode_uuid_as_sstr(&lfe->ti_id));
+  htsmsg_add_str(m, "uuid", idnode_uuid_as_str(&lfe->ti_id, ubuf));
   if (lfe->ti_id.in_class == &satip_frontend_dvbs_class) {
     satip_satconf_save(lfe, m);
     htsmsg_delete_field(m, "networks");
index 8c4d00e36d81e1d25af229a1b7cf8f400f96cd96..925e7bf331ba68e1f336d12fd45a1b76e3021ac7 100644 (file)
@@ -95,6 +95,7 @@ satip_satconf_class_network_set( void *o, const void *p )
   htsmsg_field_t *f;
   const char *str;
   int i, save;
+  char ubuf[UUID_HEX_SIZE];
 
   HTSMSG_FOREACH(f, msg) {
     if (!(str = htsmsg_field_get_str(f))) continue;
@@ -121,7 +122,7 @@ satip_satconf_class_network_set( void *o, const void *p )
     TAILQ_FOREACH(sfc2, &lfe->sf_satconf, sfc_link) {
       for (i = 0; i < sfc2->sfc_networks->is_count; i++)
         htsmsg_add_str(l, NULL,
-                       idnode_uuid_as_sstr(sfc2->sfc_networks->is_array[i]));
+                       idnode_uuid_as_str(sfc2->sfc_networks->is_array[i], ubuf));
     }
     mpegts_input_class_network_set(lfe, l);
     /* update the slave tuners, too */
index 62daa6440fc7a52cccd8f52532cbedc9bce69c69..6ff7c1cc8e00e59d8cd9f0f4bbc2e1cdc9784585 100644 (file)
@@ -191,6 +191,7 @@ tvhdhomerun_device_save( tvhdhomerun_device_t *hd )
 {
   tvhdhomerun_frontend_t *lfe;
   htsmsg_t *m, *l;
+  char ubuf[UUID_HEX_SIZE];
 
   m = htsmsg_create_map();
   idnode_save(&hd->th_id, m);
@@ -203,7 +204,7 @@ tvhdhomerun_device_save( tvhdhomerun_device_t *hd )
   htsmsg_add_str(m, "fe_override", hd->hd_override_type);
 
   hts_settings_save(m, "input/tvhdhomerun/adapters/%s",
-                    idnode_uuid_as_sstr(&hd->th_id));
+                    idnode_uuid_as_str(&hd->th_id, ubuf));
   htsmsg_destroy(m);
 }
 
index f7a9a0ca34e2d6d7b4646736b7fc21d8f74ea591..e34c2c523071042cf8a6d4e96cdcc7672db09b37 100644 (file)
@@ -521,13 +521,13 @@ tvhdhomerun_frontend_class_save ( idnode_t *in )
 void
 tvhdhomerun_frontend_save ( tvhdhomerun_frontend_t *hfe, htsmsg_t *fe )
 {
-  char id[16];
+  char id[16], ubuf[UUID_HEX_SIZE];
   htsmsg_t *m = htsmsg_create_map();
 
   /* Save frontend */
   mpegts_input_save((mpegts_input_t*)hfe, m);
   htsmsg_add_str(m, "type", dvb_type2str(hfe->hf_type));
-  htsmsg_add_str(m, "uuid", idnode_uuid_as_sstr(&hfe->ti_id));
+  htsmsg_add_str(m, "uuid", idnode_uuid_as_str(&hfe->ti_id, ubuf));
 
   /* Add to list */
   snprintf(id, sizeof(id), "%s #%d", dvb_type2str(hfe->hf_type), hfe->hf_tunerNumber);
index 3d38e1b03aeb9d239ea1e773a300090cfcb5d362..25879009965f77087563793922529f2f1956b3d6 100644 (file)
@@ -133,11 +133,12 @@ profile_release_(profile_t *pro)
 static void
 profile_delete(profile_t *pro, int delconf)
 {
+  char ubuf[UUID_HEX_SIZE];
   pro->pro_enabled = 0;
   if (pro->pro_conf_changed)
     pro->pro_conf_changed(pro);
   if (delconf)
-    hts_settings_remove("profile/%s", idnode_uuid_as_sstr(&pro->pro_id));
+    hts_settings_remove("profile/%s", idnode_uuid_as_str(&pro->pro_id, ubuf));
   TAILQ_REMOVE(&profiles, pro, pro_link);
   idnode_unlink(&pro->pro_id);
   dvr_config_destroy_by_profile(pro, delconf);
@@ -150,12 +151,13 @@ profile_class_save ( idnode_t *in )
 {
   profile_t *pro = (profile_t *)in;
   htsmsg_t *c = htsmsg_create_map();
+  char ubuf[UUID_HEX_SIZE];
   if (pro == profile_default)
     pro->pro_enabled = 1;
   idnode_save(in, c);
   if (pro->pro_shield)
     htsmsg_add_bool(c, "shield", 1);
-  hts_settings_save(c, "profile/%s", idnode_uuid_as_sstr(in));
+  hts_settings_save(c, "profile/%s", idnode_uuid_as_str(in, ubuf));
   htsmsg_destroy(c);
   if (pro->pro_conf_changed)
     pro->pro_conf_changed(pro);
@@ -466,6 +468,7 @@ profile_find_by_list
   profile_t *pro, *res = NULL;
   htsmsg_field_t *f;
   const char *uuid, *uuid2;
+  char ubuf[UUID_HEX_SIZE];
 
   pro = profile_find_by_uuid(name);
   if (!pro)
@@ -473,7 +476,7 @@ profile_find_by_list
   if (!profile_verify(pro, sflags))
     pro = NULL;
   if (uuids) {
-    uuid = pro ? idnode_uuid_as_sstr(&pro->pro_id) : "";
+    uuid = pro ? idnode_uuid_as_str(&pro->pro_id, ubuf) : "";
     HTSMSG_FOREACH(f, uuids) {
       uuid2 = htsmsg_field_get_str(f) ?: "";
       if (strcmp(uuid, uuid2) == 0 && profile_verify(pro, sflags))
@@ -536,11 +539,12 @@ profile_get_htsp_list(htsmsg_t *array, htsmsg_t *filter)
   htsmsg_t *m;
   htsmsg_field_t *f;
   const char *uuid, *s;
+  char ubuf[UUID_HEX_SIZE];
 
   TAILQ_FOREACH(pro, &profiles, pro_link) {
     if (!pro->pro_work)
       continue;
-    uuid = idnode_uuid_as_sstr(&pro->pro_id);
+    uuid = idnode_uuid_as_str(&pro->pro_id, ubuf);
     if (filter) {
       HTSMSG_FOREACH(f, filter) {
         if (!(s = htsmsg_field_get_str(f)))
index 8b4ea924c880ac1a7ebd420da7412438dd142917..0bda93398f4f4deafd2a4a6459bed4cb7d5ab0e5 100644 (file)
@@ -391,6 +391,7 @@ service_build_filter(service_t *t)
   caid_t *ca, *ca2;
   int i, n, p, o, exclusive, sindex;
   uint32_t mask;
+  char ubuf[UUID_HEX_SIZE];
 
   /* rebuild the filtered and ordered components */
   TAILQ_INIT(&t->s_filt_components);
@@ -446,7 +447,7 @@ filter:
             strncmp(esf->esf_language, st->es_lang, 4))
           continue;
         if (esf->esf_service[0]) {
-          if (strcmp(esf->esf_service, idnode_uuid_as_sstr(&t->s_id)))
+          if (strcmp(esf->esf_service, idnode_uuid_as_str(&t->s_id, ubuf)))
             continue;
           if (esf->esf_pid && esf->esf_pid != st->es_pid)
             continue;
index 924db5bd3ca9801678da1d0628390de22fd2f60e..07c8c4a2b334709cf05353d669ee08025c18af3a 100644 (file)
@@ -84,6 +84,7 @@ service_mapper_start ( const service_mapper_conf_t *conf, htsmsg_t *uuids )
   int e, tr, qd = 0;
   service_mapper_item_t *smi;
   service_t *s;
+  char ubuf[UUID_HEX_SIZE];
 
   /* Reset stat counters */
   if (TAILQ_EMPTY(&service_mapper_queue))
@@ -94,7 +95,7 @@ service_mapper_start ( const service_mapper_conf_t *conf, htsmsg_t *uuids )
     if (uuids) {
       htsmsg_field_t *f;
       const char *str;
-      const char *uuid = idnode_uuid_as_sstr(&s->s_id);
+      const char *uuid = idnode_uuid_as_str(&s->s_id, ubuf);
       HTSMSG_FOREACH(f, uuids) {
         if (!(str = htsmsg_field_get_str(f))) continue;
         if (!strcmp(str, uuid)) break;
@@ -102,7 +103,7 @@ service_mapper_start ( const service_mapper_conf_t *conf, htsmsg_t *uuids )
       if (!f) continue;
     }
     tvhtrace("service_mapper", "check service %s (%s)",
-             s->s_nicename, idnode_uuid_as_sstr(&s->s_id));
+             s->s_nicename, idnode_uuid_as_str(&s->s_id, ubuf));
 
     /* Already mapped (or in progress) */
     if (s->s_sm_onqueue) continue;
index ef69b1466e360a8f36ff1c783dbc51b46df166c6..7203e6e929658c714768f24181109931038f46e7 100644 (file)
@@ -182,6 +182,7 @@ page_simple(http_connection_t *hc,
   dvr_query_result_t dqr;
   const char *rstatus = NULL;
   const char *lang  = http_arg_get(&hc->hc_args, "Accept-Language");
+  char ubuf[UUID_HEX_SIZE];
 
   htsbuf_qprintf(hq, "<html>");
   htsbuf_qprintf(hq, "<body>");
@@ -289,7 +290,7 @@ page_simple(http_connection_t *hc,
     rstatus = val2str(de->de_sched_state, recstatustxt);
 
 
-    htsbuf_qprintf(hq, "<a href=\"/pvrinfo/%s\">", idnode_uuid_as_sstr(&de->de_id));
+    htsbuf_qprintf(hq, "<a href=\"/pvrinfo/%s\">", idnode_uuid_as_str(&de->de_id, ubuf));
     
     htsbuf_qprintf(hq, 
                "%02d:%02d-%02d:%02d&nbsp; %s",
@@ -321,7 +322,7 @@ page_einfo(http_connection_t *hc, const char *remain, void *opaque)
   dvr_entry_t *de;
   const char *rstatus;
   dvr_entry_sched_state_t dvr_status;
-  const char *lang  = http_arg_get(&hc->hc_args, "Accept-Language");
+  const char *lang = http_arg_get(&hc->hc_args, "Accept-Language");
   const char *s;
 
   pthread_mutex_lock(&global_lock);
@@ -412,6 +413,7 @@ page_pvrinfo(http_connection_t *hc, const char *remain, void *opaque)
   struct tm a, b;
   dvr_entry_t *de;
   const char *rstatus;
+  char ubuf[UUID_HEX_SIZE];
 
   pthread_mutex_lock(&global_lock);
 
@@ -449,7 +451,7 @@ page_pvrinfo(http_connection_t *hc, const char *remain, void *opaque)
     htsbuf_qprintf(hq, "Recording status: %s<br>", rstatus);
 
   htsbuf_qprintf(hq, "<form method=\"post\" action=\"/pvrinfo/%s\">",
-                idnode_uuid_as_sstr(&de->de_id));
+                idnode_uuid_as_str(&de->de_id, ubuf));
 
   switch(de->de_sched_state) {
   case DVR_SCHEDULED:
index 4d4ddf7c37609978256fc914035b22a41ca1dc5a..86ba165c6f19607b69450570fd59b668454cd837 100644 (file)
@@ -548,6 +548,7 @@ http_channel_playlist(http_connection_t *hc, int pltype, channel_t *channel)
   char buf[255];
   char *profile, *hostpath;
   const char *name;
+  char ubuf[UUID_HEX_SIZE];
 
   if (http_access_verify_channel(hc, ACCESS_STREAMING, channel))
     return HTTP_STATUS_UNAUTHORIZED;
@@ -566,7 +567,7 @@ http_channel_playlist(http_connection_t *hc, int pltype, channel_t *channel)
     htsbuf_append_str(hq, "#EXTM3U\n");
     http_m3u_playlist_add(hq, hostpath, buf, profile, name,
                           channel_get_icon(channel),
-                          channel_get_suuid(channel),
+                          channel_get_uuid(channel, ubuf),
                           hc->hc_access);
 
   } else if (pltype == PLAYLIST_E2) {
@@ -593,7 +594,7 @@ static int
 http_tag_playlist(http_connection_t *hc, int pltype, channel_tag_t *tag)
 {
   htsbuf_queue_t *hq;
-  char buf[255];
+  char buf[255], ubuf[UUID_HEX_SIZE];
   idnode_list_mapping_t *ilm;
   char *profile, *hostpath;
   const char *name;
@@ -641,7 +642,7 @@ http_tag_playlist(http_connection_t *hc, int pltype, channel_tag_t *tag)
     if (pltype == PLAYLIST_M3U) {
       http_m3u_playlist_add(hq, hostpath, buf, profile, name,
                             channel_get_icon(ch),
-                            channel_get_suuid(ch),
+                            channel_get_uuid(ch, ubuf),
                             hc->hc_access);
     } else if (pltype == PLAYLIST_E2) {
       htsbuf_qprintf(hq, "#NAME %s\n", name);
@@ -764,7 +765,7 @@ static int
 http_channel_list_playlist(http_connection_t *hc, int pltype)
 {
   htsbuf_queue_t *hq;
-  char buf[255];
+  char buf[255], ubuf[UUID_HEX_SIZE];
   channel_t *ch;
   channel_t **chlist;
   int idx = 0, count = 0;
@@ -807,7 +808,7 @@ http_channel_list_playlist(http_connection_t *hc, int pltype)
     if (pltype == PLAYLIST_M3U) {
       http_m3u_playlist_add(hq, hostpath, buf, profile, name,
                             channel_get_icon(ch),
-                            channel_get_suuid(ch),
+                            channel_get_uuid(ch, ubuf),
                             hc->hc_access);
     } else if (pltype == PLAYLIST_E2) {
       http_e2_playlist_add(hq, hostpath, buf, profile, name);
@@ -832,7 +833,7 @@ static int
 http_dvr_list_playlist(http_connection_t *hc, int pltype)
 {
   htsbuf_queue_t *hq;
-  char buf[255];
+  char buf[255], ubuf[UUID_HEX_SIZE];
   dvr_entry_t *de;
   const char *uuid;
   char *hostpath;
@@ -864,7 +865,7 @@ http_dvr_list_playlist(http_connection_t *hc, int pltype)
     htsbuf_qprintf(hq, "#EXTINF:%"PRItime_t",%s\n", durration, lang_str_get(de->de_title, NULL));
     
     htsbuf_qprintf(hq, "#EXT-X-TARGETDURATION:%"PRItime_t"\n", durration);
-    uuid = idnode_uuid_as_sstr(&de->de_id);
+    uuid = idnode_uuid_as_str(&de->de_id, ubuf);
     htsbuf_qprintf(hq, "#EXT-X-STREAM-INF:PROGRAM-ID=%s,BANDWIDTH=%d\n", uuid, bandwidth);
     htsbuf_qprintf(hq, "#EXT-X-PROGRAM-DATE-TIME:%s\n", buf);
 
@@ -884,7 +885,7 @@ static int
 http_dvr_playlist(http_connection_t *hc, int pltype, dvr_entry_t *de)
 {
   htsbuf_queue_t *hq = &hc->hc_reply;
-  char buf[255];
+  char buf[255], ubuf[UUID_HEX_SIZE];
   const char *ticket_id = NULL, *uuid;
   time_t durration = 0;
   off_t fsize = 0;
@@ -913,7 +914,7 @@ http_dvr_playlist(http_connection_t *hc, int pltype, dvr_entry_t *de)
     htsbuf_qprintf(hq, "#EXTINF:%"PRItime_t",%s\n", durration, lang_str_get(de->de_title, NULL));
     
     htsbuf_qprintf(hq, "#EXT-X-TARGETDURATION:%"PRItime_t"\n", durration);
-    uuid = idnode_uuid_as_sstr(&de->de_id);
+    uuid = idnode_uuid_as_str(&de->de_id, ubuf);
     htsbuf_qprintf(hq, "#EXT-X-STREAM-INF:PROGRAM-ID=%s,BANDWIDTH=%d\n", uuid, bandwidth);
     htsbuf_qprintf(hq, "#EXT-X-PROGRAM-DATE-TIME:%s\n", buf);
 
index 608e2d726df3e0e831845c14b691558dc597ac52..e1b532e65a0ba7b3c07410b8db924a670f7fbf85 100644 (file)
@@ -65,8 +65,9 @@ static void
 http_xmltv_channel_add(htsbuf_queue_t *hq, const char *hostpath, channel_t *ch)
 {
   const char *icon = channel_get_icon(ch);
+  char ubuf[UUID_HEX_SIZE];
   htsbuf_qprintf(hq, "<channel id=\"%s\">\n<display-name>",
-                 idnode_uuid_as_sstr(&ch->ch_id));
+                 idnode_uuid_as_str(&ch->ch_id, ubuf));
   htsbuf_append_and_escape_xml(hq, channel_get_name(ch));
   htsbuf_append_str(hq, "</display-name>\n");
   if (icon) {
@@ -85,7 +86,7 @@ static void
 http_xmltv_programme_one(htsbuf_queue_t *hq, const char *hostpath,
                          channel_t *ch, epg_broadcast_t *ebc)
 {
-  char start[32], stop[32];
+  char start[32], stop[32], ubuf[UUID_HEX_SIZE];
   epg_episode_t *e = ebc->episode;
   lang_str_ele_t *lse;
 
@@ -93,7 +94,7 @@ http_xmltv_programme_one(htsbuf_queue_t *hq, const char *hostpath,
   http_xmltv_time(start, ebc->start);
   http_xmltv_time(stop, ebc->stop);
   htsbuf_qprintf(hq, "<programme start=\"%s\" stop=\"%s\" channel=\"%s\">\n",
-                 start, stop, idnode_uuid_as_sstr(&ch->ch_id));
+                 start, stop, idnode_uuid_as_str(&ch->ch_id, ubuf));
   RB_FOREACH(lse, e->title, link) {
     htsbuf_qprintf(hq, "  <title lang=\"%s\">", lse->lang);
     htsbuf_append_and_escape_xml(hq, lse->str);