本文整理汇总了C++中ref_release函数的典型用法代码示例。如果您正苦于以下问题:C++ ref_release函数的具体用法?C++ ref_release怎么用?C++ ref_release使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ref_release函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cmyth_proginfo_programid
CStdString MythProgramInfo::ProgramID()
{
char* progId = cmyth_proginfo_programid(*m_proginfo_t);
CStdString retval(progId);
ref_release(progId);
return retval;
}
示例2: cmyth_recordingrule_set_subtitle
void
cmyth_recordingrule_set_subtitle(cmyth_recordingrule_t rr, char *subtitle)
{
if (rr->subtitle)
ref_release(rr->subtitle);
rr->subtitle = ref_strdup(subtitle);
}
示例3: cmyth_recordingrule_set_storagegroup
void
cmyth_recordingrule_set_storagegroup(cmyth_recordingrule_t rr, char *storagegroup)
{
if (rr->storagegroup)
ref_release(rr->storagegroup);
rr->storagegroup = ref_strdup(storagegroup);
}
示例4: cmyth_recordingrule_set_starttime
void
cmyth_recordingrule_set_starttime(cmyth_recordingrule_t rr, time_t starttime)
{
if (rr->starttime)
ref_release(rr->starttime);
rr->starttime = cmyth_timestamp_from_unixtime(starttime);
}
示例5: cmyth_recordingrule_set_description
void
cmyth_recordingrule_set_description(cmyth_recordingrule_t rr, char *description)
{
if (rr->description)
ref_release(rr->description);
rr->description = ref_strdup(description);
}
示例6: cmyth_recordingrule_callsign
CStdString MythRecordingRule::Callsign() const
{
char *buf = cmyth_recordingrule_callsign(*m_recordingrule_t);
CStdString retval(buf);
ref_release(buf);
return retval;
}
示例7: run
void run(char *conf_file) {
struct running rr;
struct event *sig1_ev,*sig2_ev,*sig_hup;
evthread_use_pthreads();
setup_running(&rr);
register_interface_types(&rr);
register_source_types(&rr);
run_config(&rr,conf_file);
start_stats_timer(&rr);
ref_release(&(rr.ic_running));
event_add(sq_consumer(rr.sq),0);
event_add(si_consumer(rr.si),0);
sq_release(rr.sq);
evsignal_add(sig1_ev=evsignal_new(rr.eb,SIGINT,user_quit,&rr),0);
evsignal_add(sig2_ev=evsignal_new(rr.eb,SIGTERM,user_quit,&rr),0);
evsignal_add(sig_hup=evsignal_new(rr.eb,SIGHUP,hupev,&rr),0);
rr.sigkill_timer = event_new(rr.eb,-1,EV_PERSIST,sigkill_self,&rr);
log_info(("Starting event loop"));
event_base_loop(rr.eb,0);
log_info(("Event loop finished"));
event_del(sig1_ev);
event_del(sig2_ev);
event_del(sig_hup);
event_free(sig1_ev);
event_free(sig2_ev);
event_free(sig_hup);
closedown(&rr);
log_info(("Bye!"));
config_finished();
}
示例8: cmyth_mysql_query_create
/**
* Allocate a dynamic query string to have parameters added to it
* \param db database connection object
* \param query_string Query string with ? placemarks for all dynamic
* parameters, this is NOT copied and must therefore
* remain valid for the life of the query.
*/
cmyth_mysql_query_t *
cmyth_mysql_query_create(cmyth_database_t db, const char * query_string)
{
cmyth_mysql_query_t * out;
out = ref_alloc(sizeof(*out));
if(out != NULL)
{
ref_set_destroy(out,query_destroy);
out->source = out->source_pos = query_string;
out->source_len = strlen(out->source);
out->buf_size = out->source_len *2;
out->buf_used = 0;
out->db = ref_hold(db);
out->buf = ref_alloc(out->buf_size);
if(out->buf == NULL)
{
ref_release(out);
out = NULL;
}
else
{
out->buf[0] = '\0';
}
}
return out;
}
示例9: cmyth_recordingrule_set_profile
void
cmyth_recordingrule_set_profile(cmyth_recordingrule_t rr, char *profile)
{
if (rr->profile)
ref_release(rr->profile);
rr->profile = ref_strdup(profile);
}
示例10: cmyth_mysql_query_result
MYSQL_RES *
cmyth_mysql_query_result(cmyth_mysql_query_t * query)
{
MYSQL_RES * retval = NULL;
int ret;
char * query_str;
MYSQL *mysql = cmyth_db_get_connection(query->db);
if(mysql == NULL)
return NULL;
query_str = cmyth_mysql_query_string(query);
if(query_str == NULL)
return NULL;
ret = mysql_query(mysql,query_str);
ref_release(query_str);
if(ret != 0)
{
cmyth_dbg(CMYTH_DBG_ERROR, "%s: mysql_query(%s) Failed: %s\n",
__FUNCTION__, query_str, mysql_error(mysql));
return NULL;
}
retval = mysql_store_result(mysql);
if(retval == NULL)
{
cmyth_dbg(CMYTH_DBG_ERROR, "%s: mysql_use_result Failed: %s\n",
__FUNCTION__, query_str, mysql_error(mysql));
}
return retval;
}
示例11: query_destroy
/**
* Internal only! Registered as callback to de-allocate actual buffer if
* the query is de-allocated
* \param p pointer to the query data structure
*/
static void
query_destroy(void *p)
{
cmyth_mysql_query_t * query = (cmyth_mysql_query_t *)p;
if(query->buf != NULL)
{
ref_release(query->buf);
query->buf = NULL;
query->buf_size = 0;
}
if(query->db != NULL)
{
ref_release(query->db);
query->db = NULL;
}
}
示例12: get_event
static int
get_event(char *host)
{
struct timeval tv;
cmyth_conn_t event;
if ((event=cmyth_conn_connect_event(host, 6543,
16*1024, 4096)) == NULL) {
return -1;
}
tv.tv_sec = 1;
tv.tv_usec = 0;
if (cmyth_event_select(event, &tv) > 0) {
cmyth_event_t e;
char data[128];
memset(data, 0, sizeof(data));
e = cmyth_event_get(event, data, sizeof(data));
printf("Event: %d '%s'\n", e, data);
}
ref_release(event);
return 0;
}
示例13: cmyth_proginfo_pathname
CStdString MythProgramInfo::Path()
{
char* path = cmyth_proginfo_pathname(*m_proginfo_t);
CStdString retval(path);
ref_release(path);
return retval;
}
示例14: cmyth_proginfo_subtitle
CStdString MythProgramInfo::Subtitle()
{
char* subtitle = cmyth_proginfo_subtitle(*m_proginfo_t);
CStdString retval(subtitle);
ref_release(subtitle);
return retval;
}
示例15: cmyth_recordingrule_storagegroup
CStdString MythRecordingRule::StorageGroup() const
{
char *buf = cmyth_recordingrule_storagegroup(*m_recordingrule_t);
CStdString retval(buf);
ref_release(buf);
return retval;
}