static const void *
access_entry_class_prefix_get(void *o)
{
- static const char *ret;
- ret = access_get_prefix(&((access_entry_t *)o)->ae_ipmasks);
- return &ret;
+ prop_ptr = access_get_prefix(&((access_entry_t *)o)->ae_ipmasks);
+ return &prop_ptr;
}
static int
static const void *
ipblock_entry_class_prefix_get(void *o)
{
- static const char *ret;
- ret = access_get_prefix(&((ipblock_entry_t *)o)->ib_ipmasks);
- return &ret;
+ prop_ptr = access_get_prefix(&((ipblock_entry_t *)o)->ib_ipmasks);
+ return &prop_ptr;
}
CLASS_DOC(ipblocking)
static const void *
bouquet_class_chtag_ref_get ( void *obj )
{
- static const char *buf;
bouquet_t *bq = obj;
if (bq->bq_chtag_ptr)
- buf = idnode_uuid_as_str(&bq->bq_chtag_ptr->ct_id, prop_sbuf);
+ idnode_uuid_as_str(&bq->bq_chtag_ptr->ct_id, prop_sbuf);
else
- buf = "";
- return &buf;
+ prop_sbuf[0] = '\0';
+ return &prop_sbuf_ptr;
}
static char *
static const void *
channel_class_get_icon ( void *obj )
{
- static const char *s;
- s = channel_get_icon(obj);
- return &s;
+ prop_ptr = channel_get_icon(obj);
+ return &prop_ptr;
}
static const char *
static const void *
channel_class_get_name ( void *o )
{
- static const char *s;
- s = channel_get_name(o);
- return &s;
+ prop_str = channel_get_name(o);
+ return &prop_str;
}
static const void *
static const void *
channel_tag_class_get_icon ( void *obj )
{
- static const char *s;
- s = channel_tag_get_icon(obj);
- return &s;
+ prop_ptr = channel_tag_get_icon(obj);
+ return &prop_ptr;
}
/* exported for others */
caclient_class_get_title ( idnode_t *in, const char *lang )
{
caclient_t *cac = (caclient_t *)in;
- static char buf[32];
if (cac->cac_name && cac->cac_name[0])
return cac->cac_name;
- snprintf(buf, sizeof(buf), tvh_gettext_lang(lang, N_("CA client %i")), cac->cac_index);
- return buf;
+ snprintf(prop_sbuf, PROP_SBUF_LEN,
+ tvh_gettext_lang(lang, N_("CA client %i")), cac->cac_index);
+ return prop_sbuf;
}
static void
caclient_class_status_get(void *o)
{
caclient_t *cac = o;
- static const char *ret;
- ret = caclient_get_status(cac);
- return &ret;
+ prop_ptr = caclient_get_status(cac);
+ return &prop_ptr;
}
CLASS_DOC(caclient)
static const void *
constcw_class_key_get(void *o, const uint8_t *key)
{
- static char buf[64];
- static const char *ret = buf;
if (constcw_key_size(o) == 8) {
- snprintf(buf, sizeof(buf),
+ snprintf(prop_sbuf, PROP_SBUF_LEN,
"%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
key[0x0], key[0x1], key[0x2], key[0x3],
key[0x4], key[0x5], key[0x6], key[0x7]);
} else {
- snprintf(buf, sizeof(buf),
+ snprintf(prop_sbuf, PROP_SBUF_LEN,
"%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:"
"%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
key[0x0], key[0x1], key[0x2], key[0x3],
key[0x8], key[0x9], key[0xa], key[0xb],
key[0xc], key[0xd], key[0xe], key[0xf]);
}
- return &ret;
+ return &prop_sbuf_ptr;
}
static const void *
caclient_cwc_class_deskey_get(void *o)
{
cwc_t *cwc = o;
- static char buf[64];
- static const char *ret = buf;
- snprintf(buf, sizeof(buf),
+ snprintf(prop_sbuf, PROP_SBUF_LEN,
"%02x:%02x:%02x:%02x:%02x:%02x:%02x:"
"%02x:%02x:%02x:%02x:%02x:%02x:%02x",
cwc->cwc_confedkey[0x0],
cwc->cwc_confedkey[0xb],
cwc->cwc_confedkey[0xc],
cwc->cwc_confedkey[0xd]);
- return &ret;
+ return &prop_sbuf_ptr;
}
const idclass_t caclient_cwc_class =
static const void *
dvr_autorec_entry_class_time_get(void *o, int tm)
{
- static const char *ret;
- static char buf[16];
if (tm >= 0)
- snprintf(buf, sizeof(buf), "%02d:%02d", tm / 60, tm % 60);
+ snprintf(prop_sbuf, PROP_SBUF_LEN, "%02d:%02d", tm / 60, tm % 60);
else
- strncpy(buf, N_("Any"), 16);
- ret = buf;
- return &ret;
+ strncpy(prop_sbuf, N_("Any"), 16);
+ return &prop_sbuf_ptr;
}
static const void *
static const void *
dvr_autorec_entry_class_brand_get(void *o)
{
- static const char *ret;
dvr_autorec_entry_t *dae = (dvr_autorec_entry_t *)o;
- if (dae->dae_brand)
- ret = dae->dae_brand->uri;
- else
- ret = "";
- return &ret;
+ prop_ptr = dae->dae_brand ? dae->dae_brand->uri : NULL;
+ if (prop_ptr == NULL)
+ prop_ptr = "";
+ return &prop_ptr;
}
static int
static const void *
dvr_autorec_entry_class_season_get(void *o)
{
- static const char *ret;
dvr_autorec_entry_t *dae = (dvr_autorec_entry_t *)o;
- if (dae->dae_season)
- ret = dae->dae_season->uri;
- else
- ret = "";
- return &ret;
+ prop_ptr = dae->dae_season ? dae->dae_season->uri : NULL;
+ if (prop_ptr == NULL)
+ prop_ptr = "";
+ return &prop_ptr;
}
static int
static const void *
dvr_autorec_entry_class_series_link_get(void *o)
{
- static const char *ret;
dvr_autorec_entry_t *dae = (dvr_autorec_entry_t *)o;
- if (dae->dae_serieslink)
- ret = dae->dae_serieslink->uri;
- else
- ret = "";
- return &ret;
+ prop_ptr = dae->dae_serieslink ? dae->dae_serieslink->uri : NULL;
+ if (prop_ptr == NULL)
+ prop_ptr = "";
+ return &prop_ptr;
}
static htsmsg_t *
static const void *
dvr_entry_class_filename_get(void *o)
{
- static const char *ret;
dvr_entry_t *de = (dvr_entry_t *)o;
- const char *s = dvr_get_filename(de);
- ret = s ?: "";
- return &ret;
+ prop_ptr = dvr_get_filename(de) ?: "";
+ return &prop_ptr;
}
static int
static const void *
dvr_entry_class_channel_name_get(void *o)
{
- static const char *ret;
dvr_entry_t *de = (dvr_entry_t *)o;
if (de->de_channel)
- ret = channel_get_name(de->de_channel);
+ prop_str = channel_get_name(de->de_channel);
else
- ret = de->de_channel_name;
- return &ret;
+ prop_ptr = de->de_channel_name;
+ return &prop_ptr;
}
static int
static const void *
dvr_entry_class_autorec_caption_get(void *o)
{
- static const char *ret;
dvr_entry_t *de = (dvr_entry_t *)o;
dvr_autorec_entry_t *dae = de->de_autorec;
if (dae) {
- ret = prop_sbuf;
snprintf(prop_sbuf, PROP_SBUF_LEN, "%s%s%s%s",
dae->dae_name ?: "",
dae->dae_comment ? " (" : "",
dae->dae_comment,
dae->dae_comment ? ")" : "");
} else
- ret = "";
- return &ret;
+ prop_sbuf[0] = '\0';
+ return &prop_sbuf_ptr;
}
static int
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_str(&de->de_timerec->dte_id, ubuf);
+ idnode_uuid_as_str(&de->de_timerec->dte_id, prop_sbuf);
else
- ret = "";
- return &ret;
+ prop_sbuf[0] = '\0';
+ return &prop_sbuf_ptr;
}
static const void *
dvr_entry_class_timerec_caption_get(void *o)
{
- static const char *ret;
dvr_entry_t *de = (dvr_entry_t *)o;
dvr_timerec_entry_t *dte = de->de_timerec;
if (dte) {
- ret = prop_sbuf;
snprintf(prop_sbuf, PROP_SBUF_LEN, "%s%s%s%s",
dte->dte_name ?: "",
dte->dte_comment ? " (" : "",
dte->dte_comment,
dte->dte_comment ? ")" : "");
} else
- ret = "";
- return &ret;
+ prop_sbuf[0] = '\0';
+ return &prop_sbuf_ptr;
}
static int
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_str(&de->de_parent->de_id, ubuf);
+ idnode_uuid_as_str(&de->de_parent->de_id, prop_sbuf);
else
- ret = "";
- return &ret;
+ prop_sbuf[0] = '\0';
+ return &prop_sbuf_ptr;
}
static int
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_str(&de->de_child->de_id, ubuf);
+ idnode_uuid_as_str(&de->de_child->de_id, prop_sbuf);
else
- ret = "";
- return &ret;
+ prop_sbuf[0] = '\0';
+ return &prop_sbuf_ptr;
}
static int
dvr_entry_class_disp_title_get(void *o)
{
dvr_entry_t *de = (dvr_entry_t *)o;
- static const char *s;
- s = "";
- if (de->de_title) {
- s = lang_str_get(de->de_title, idnode_lang(o));
- if (s == NULL)
- s = "";
- }
- return &s;
+ if (de->de_title)
+ prop_ptr = lang_str_get(de->de_title, idnode_lang(o));
+ else
+ prop_ptr = NULL;
+ if (prop_ptr == NULL)
+ prop_ptr = "";
+ return &prop_ptr;
}
static int
dvr_entry_class_disp_subtitle_get(void *o)
{
dvr_entry_t *de = (dvr_entry_t *)o;
- static const char *s;
- s = "";
- if (de->de_subtitle) {
- s = lang_str_get(de->de_subtitle, idnode_lang(o));
- if (s == NULL)
- s = "";
- }
- return &s;
+ if (de->de_subtitle)
+ prop_ptr = lang_str_get(de->de_subtitle, idnode_lang(o));
+ else
+ prop_ptr = NULL;
+ if (prop_ptr == NULL)
+ prop_ptr = "";
+ return &prop_ptr;
}
static const void *
dvr_entry_class_disp_description_get(void *o)
{
dvr_entry_t *de = (dvr_entry_t *)o;
- static const char *s;
- s = "";
- if (de->de_desc) {
- s = lang_str_get(de->de_desc, idnode_lang(o));
- if (s == NULL)
- s = "";
- }
- return &s;
+ if (de->de_desc)
+ prop_ptr = lang_str_get(de->de_desc, idnode_lang(o));
+ else
+ prop_ptr = NULL;
+ if (prop_ptr == NULL)
+ prop_ptr = "";
+ return &prop_ptr;
}
static const void *
dvr_entry_class_status_get(void *o)
{
dvr_entry_t *de = (dvr_entry_t *)o;
- static const char *s;
- static char buf[100];
- strncpy(buf, dvr_entry_status(de), sizeof(buf));
- buf[sizeof(buf)-1] = '\0';
- s = buf;
- return &s;
+ strncpy(prop_sbuf, dvr_entry_status(de), PROP_SBUF_LEN);
+ prop_sbuf[PROP_SBUF_LEN-1] = '\0';
+ return &prop_sbuf_ptr;
}
static const void *
dvr_entry_class_sched_status_get(void *o)
{
dvr_entry_t *de = (dvr_entry_t *)o;
- static const char *s;
- static char buf[100];
- strncpy(buf, dvr_entry_schedstatus(de), sizeof(buf));
- buf[sizeof(buf)-1] = '\0';
- s = buf;
- return &s;
+ strncpy(prop_sbuf, dvr_entry_schedstatus(de), PROP_SBUF_LEN);
+ prop_sbuf[PROP_SBUF_LEN-1] = '\0';
+ return &prop_sbuf_ptr;
}
static const void *
{
dvr_entry_t *de = (dvr_entry_t *)o;
channel_t *ch = de->de_channel;
- static const char *s;
if (ch == NULL) {
- s = "";
- } else if ((s = channel_get_icon(ch)) == NULL) {
- s = "";
+ prop_ptr = NULL;
+ } else {
+ prop_ptr = channel_get_icon(ch);
}
- return &s;
+ if (prop_ptr == NULL)
+ prop_ptr = "";
+ return &prop_ptr;
}
static const void *
static const char *
dvr_timerec_title(dvr_timerec_entry_t *dte, struct tm *start)
{
- static char buf[256];
size_t len;
if (dte->dte_title == NULL)
return _("Unknown");
- len = strftime(buf, sizeof(buf) - 1, dte->dte_title, start);
- buf[len] = '\0';
- return buf;
+ len = strftime(prop_sbuf, PROP_SBUF_LEN-1, dte->dte_title, start);
+ prop_sbuf[len] = '\0';
+ return prop_sbuf;
}
/**
static const void *
dvr_timerec_entry_class_time_get(void *o, int tm)
{
- static const char *ret;
- static char buf[16];
if (tm >= 0)
- snprintf(buf, sizeof(buf), "%02d:%02d", tm / 60, tm % 60);
+ snprintf(prop_sbuf, PROP_SBUF_LEN, "%02d:%02d", tm / 60, tm % 60);
else
- strncpy(buf, N_("Any"), 16);
- ret = buf;
- return &ret;
+ strncpy(prop_sbuf, N_("Any"), 16);
+ return &prop_sbuf_ptr;
}
static const void *
static const void *
linuxdvb_frontend_dvbs_class_satconf_get ( void *self )
{
- static const char *s;
linuxdvb_frontend_t *lfe = self;
if (lfe->lfe_satconf)
- s = lfe->lfe_satconf->ls_type;
+ prop_ptr = lfe->lfe_satconf->ls_type;
else
- s = NULL;
- return &s;
+ prop_ptr = NULL;
+ return &prop_ptr;
}
static htsmsg_t *
static const void *
linuxdvb_satconf_ele_class_lnbtype_get ( void *o )
{
- static const char *s;
linuxdvb_satconf_ele_t *ls = o;
- s = ls->lse_lnb ? ls->lse_lnb->ld_type : NULL;
- return &s;
+ prop_ptr = ls->lse_lnb ? ls->lse_lnb->ld_type : NULL;
+ return &prop_ptr;
}
static int
static const void *
linuxdvb_satconf_ele_class_en50494type_get ( void *o )
{
- static const char *s;
linuxdvb_satconf_ele_t *ls = o;
- s = ls->lse_en50494 ? ls->lse_en50494->ld_type : NULL;
- return &s;
+ prop_ptr = ls->lse_en50494 ? ls->lse_en50494->ld_type : NULL;
+ return &prop_ptr;
}
static int
static const void *
linuxdvb_satconf_ele_class_switchtype_get ( void *o )
{
- static const char *s;
linuxdvb_satconf_ele_t *ls = o;
- s = ls->lse_switch ? ls->lse_switch->ld_type : NULL;
- return &s;
+ prop_ptr = ls->lse_switch ? ls->lse_switch->ld_type : NULL;
+ return &prop_ptr;
}
static int
static const void *
linuxdvb_satconf_ele_class_rotortype_get ( void *o )
{
- static const char *s;
linuxdvb_satconf_ele_t *ls = o;
- s = ls->lse_rotor ? ls->lse_rotor->ld_type : NULL;
- return &s;
+ prop_ptr = ls->lse_rotor ? ls->lse_rotor->ld_type : NULL;
+ return &prop_ptr;
}
static const char *
static const void * \
dvb_mux_##c##_class_##l##_get (void *o)\
{\
- static const char *s;\
dvb_mux_t *lm = o;\
- s = dvb_##t##2str(lm->lm_tuning.dmc_fe_##f);\
- return &s;\
+ prop_ptr = dvb_##t##2str(lm->lm_tuning.dmc_fe_##f);\
+ return &prop_ptr;\
}\
static int \
dvb_mux_##c##_class_##l##_set (void *o, const void *v)\
static const void * \
dvb_mux_##c##_class_##l##_get (void *o)\
{\
- static const char *s;\
dvb_mux_t *lm = o;\
- s = dvb_##t##2str(lm->lm_tuning.u.dmc_fe_##f.p);\
- return &s;\
+ prop_ptr = dvb_##t##2str(lm->lm_tuning.u.dmc_fe_##f.p);\
+ return &prop_ptr;\
}\
static int \
dvb_mux_##c##_class_##l##_set (void *o, const void *v)\
static const void *
dvb_mux_class_delsys_get (void *o)
{
- static const char *s;
dvb_mux_t *lm = o;
- s = dvb_delsys2str(lm->lm_tuning.dmc_fe_delsys);
- return &s;
+ prop_ptr = dvb_delsys2str(lm->lm_tuning.dmc_fe_delsys);
+ return &prop_ptr;
}
static int
static const void *
dvb_network_class_scanfile_get ( void *o )
{
- static const char *s = NULL;
- return &s;
+ prop_ptr = NULL;
+ return &prop_ptr;
}
void
dvb_network_class_orbital_pos_get ( void *o )
{
dvb_network_t *ln = o;
- static char buf[16];
- static const char *s;
- s = NULL;
- if (ln->mn_satpos != INT_MAX) {
- dvb_sat_position_to_str(ln->mn_satpos, buf, sizeof(buf));
- s = buf;
- } else
- s = "";
- return &s;
+ prop_sbuf[0] = '\0';
+ if (ln->mn_satpos != INT_MAX)
+ dvb_sat_position_to_str(ln->mn_satpos, prop_sbuf, PROP_SBUF_LEN);
+ return &prop_sbuf_ptr;
}
static int
#include "lang_str.h"
char prop_sbuf[PROP_SBUF_LEN];
-char *prop_sbuf_ptr = prop_sbuf;
+const char *prop_sbuf_ptr = prop_sbuf;
+const char *prop_ptr;
/* **************************************************************************
* Utilities
#define PROP_SBUF_LEN 4096
extern char prop_sbuf[PROP_SBUF_LEN];
-extern char *prop_sbuf_ptr;
+extern const char *prop_sbuf_ptr;
+extern const char *prop_ptr;
const property_t *prop_find(const property_t *p, const char *name);