本文整理汇总了C++中cmyth_dbg函数的典型用法代码示例。如果您正苦于以下问题:C++ cmyth_dbg函数的具体用法?C++ cmyth_dbg怎么用?C++ cmyth_dbg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cmyth_dbg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cmyth_proginfo_playgroup
char *
cmyth_proginfo_playgroup(cmyth_proginfo_t prog)
{
if (!prog) {
cmyth_dbg(CMYTH_DBG_ERROR, "%s: NULL playgroup\n",
__FUNCTION__);
return NULL;
}
return ref_hold(prog->proginfo_playgroup);
}
示例2: cmyth_proginfo_originalairdate
cmyth_timestamp_t
cmyth_proginfo_originalairdate(cmyth_proginfo_t prog)
{
if (!prog) {
cmyth_dbg(CMYTH_DBG_ERROR, "%s: NULL original air date\n",
__FUNCTION__);
return NULL;
}
return ref_hold(prog->proginfo_originalairdate);
}
示例3: cmyth_recorder_is_recording
/*
* cmyth_recorder_is_recording(cmyth_recorder_t rec)
*
* Scope: PUBLIC
*
* Description
*
* Determine whether recorder 'rec' is currently recording. Return
* the true / false answer.
*
* Return Value:
*
* Success: 0 if the recorder is idle, 1 if the recorder is recording.
*
* Failure: -(ERRNO)
*/
int
cmyth_recorder_is_recording(cmyth_recorder_t rec)
{
int err, count;
int r;
long c, ret;
char msg[256];
if (!rec) {
cmyth_dbg(CMYTH_DBG_ERROR, "%s: no recorder connection\n",
__FUNCTION__);
return -EINVAL;
}
pthread_mutex_lock(&mutex);
snprintf(msg, sizeof(msg), "QUERY_RECORDER %u[]:[]IS_RECORDING",
rec->rec_id);
if ((err=cmyth_send_message(rec->rec_conn, msg)) < 0) {
cmyth_dbg(CMYTH_DBG_ERROR,
"%s: cmyth_send_message() failed (%d)\n",
__FUNCTION__, err);
ret = err;
goto out;
}
count = cmyth_rcv_length(rec->rec_conn);
if ((r=cmyth_rcv_long(rec->rec_conn, &err, &c, count)) < 0) {
cmyth_dbg(CMYTH_DBG_ERROR,
"%s: cmyth_rcv_length() failed (%d)\n",
__FUNCTION__, r);
ret = err;
goto out;
}
ret = c;
out:
pthread_mutex_unlock(&mutex);
return ret;
}
示例4: cmyth_chanlist_get_count
/*
* cmyth_chanlist_get_count()
*
* Scope: PUBLIC
*
* Description:
*
* Retrieve the number of elements in the channels list
* structure in 'cl'.
*
* Return Value:
*
* Success: A number >= 0 indicating the number of items in 'cl'
*
* Failure: -(errno)
*/
int
cmyth_chanlist_get_count(cmyth_chanlist_t cl)
{
if (!cl) {
cmyth_dbg(CMYTH_DBG_ERROR, "%s: NULL program list\n",
__FUNCTION__);
return -EINVAL;
}
return cl->chanlist_count;
}
示例5: cmyth_proginfo_seriesid
char *
cmyth_proginfo_seriesid(cmyth_proginfo_t prog)
{
if (!prog) {
cmyth_dbg(CMYTH_DBG_ERROR, "%s: NULL series ID\n",
__FUNCTION__);
return NULL;
}
return ref_hold(prog->proginfo_seriesid);
}
示例6: cmyth_proginfo_category
/*
* cmyth_proginfo_category(cmyth_proginfo_t prog)
*
*
* Scope: PUBLIC
*
* Description
*
* Retrieves the 'proginfo_category' field of a program info structure.
*
* The returned string is a pointer to the string within the program
* info structure, so it should not be modified by the caller. The
* return value is a 'char *' for this reason.
*
* Return Value:
*
* Success: A pointer to a 'char *' pointing to the field.
*
* Failure: NULL
*/
char *
cmyth_proginfo_category(cmyth_proginfo_t prog)
{
if (!prog) {
cmyth_dbg(CMYTH_DBG_ERROR, "%s: NULL program information\n",
__FUNCTION__);
return NULL;
}
return ref_hold(prog->proginfo_category);
}
示例7: cmyth_recordingrulelist_get_count
/*
* cmyth_recordingrulelist_get_count()
*
* Scope: PUBLIC
*
* Description:
*
* Retrieve the number of elements in the recording schedule list
* structure in 'rrl'.
*
* Return Value:
*
* Success: A number >= 0 indicating the number of items in 'rrl'
*
* Failure: -(errno)
*/
int
cmyth_recordingrulelist_get_count(cmyth_recordingrulelist_t rrl)
{
if (!rrl) {
cmyth_dbg(CMYTH_DBG_ERROR, "%s: NULL recordingrule list\n",
__FUNCTION__);
return -EINVAL;
}
return rrl->recordingrulelist_count;
}
示例8: cmyth_proginfo_stars
char *
cmyth_proginfo_stars(cmyth_proginfo_t prog)
{
if (!prog) {
cmyth_dbg(CMYTH_DBG_ERROR, "%s: NULL stars\n",
__FUNCTION__);
return NULL;
}
return ref_hold(prog->proginfo_stars);
}
示例9: cmyth_proginfo_inetref
char *
cmyth_proginfo_inetref(cmyth_proginfo_t prog)
{
if (!prog) {
cmyth_dbg(CMYTH_DBG_ERROR, "%s: NULL inetref\n",
__FUNCTION__);
return NULL;
}
return ref_hold(prog->proginfo_inetref);
}
示例10: cmyth_recorder_done_ringbuf
int
cmyth_recorder_done_ringbuf(cmyth_recorder_t rec)
{
int err;
int ret = -1;
char msg[256];
if (!rec) {
cmyth_dbg(CMYTH_DBG_ERROR, "%s: no recorder connection\n",
__FUNCTION__);
return -ENOSYS;
}
if(rec->rec_conn->conn_version >= 26)
return 0;
pthread_mutex_lock(&mutex);
snprintf(msg, sizeof(msg), "QUERY_RECORDER %"PRIu32"[]:[]DONE_RINGBUF",
rec->rec_id);
if ((err=cmyth_send_message(rec->rec_conn, msg)) < 0) {
cmyth_dbg(CMYTH_DBG_ERROR,
"%s: cmyth_send_message() failed (%d)\n",
__FUNCTION__, err);
goto fail;
}
if ((err=cmyth_rcv_okay(rec->rec_conn)) < 0) {
cmyth_dbg(CMYTH_DBG_ERROR,
"%s: cmyth_rcv_okay() failed (%d)\n",
__FUNCTION__, err);
goto fail;
}
ret = 0;
fail:
pthread_mutex_unlock(&mutex);
return ret;
}
示例11: cmyth_recorder_check_channel
/*
* cmyth_recorder_check_channel(cmyth_recorder_t rec, char *channame)
*
* Scope: PUBLIC
*
* Description
*
* Request that the recorder 'rec' check the validity of the channel
* specified by 'channame'.
*
* Return Value:
*
* Check the validity of a channel name.
* Success: 1 - valid channel, 0 - invalid channel
*
* Failure: -(ERRNO)
*/
int
cmyth_recorder_check_channel(cmyth_recorder_t rec,
char *channame)
{
int err;
int ret = -1;
char msg[256];
if (!rec || !channame) {
cmyth_dbg(CMYTH_DBG_ERROR, "%s: invalid args "
"rec = %p, channame = %p\n",
__FUNCTION__, rec, channame);
return -EINVAL;
}
pthread_mutex_lock(&rec->rec_conn->conn_mutex);
snprintf(msg, sizeof(msg),
"QUERY_RECORDER %d[]:[]CHECK_CHANNEL[]:[]%s",
rec->rec_id, channame);
if ((err=cmyth_send_message(rec->rec_conn, msg)) < 0) {
cmyth_dbg(CMYTH_DBG_ERROR,
"%s: cmyth_send_message() failed (%d)\n",
__FUNCTION__, err);
goto fail;
}
if ((err=cmyth_rcv_match(rec->rec_conn, "1")) < 0) {
cmyth_dbg(CMYTH_DBG_ERROR,
"%s: cmyth_rcv_match() failed (%d)\n",
__FUNCTION__, err);
goto fail;
}
ret = 0;
fail:
pthread_mutex_unlock(&rec->rec_conn->conn_mutex);
return ret;
}
示例12: cmyth_timestamp_to_isostring
/*
* cmyth_timestamp_to_isostring(char *str, cmyth_timestamp_t ts)
*
* Scope: PUBLIC
*
* Description
*
* Create a string from the timestamp structure 'ts' and put it in the
* user supplied buffer 'str'. The size of 'str' must be
* CMYTH_TIMESTAMP_LEN + 1 or this will overwrite beyond 'str'.
*
*
* Return Value:
*
* Success: 0
*
* Failure: -(ERRNO)
*/
int
cmyth_timestamp_to_isostring(char *str, cmyth_timestamp_t ts)
{
if (!str) {
cmyth_dbg(CMYTH_DBG_ERROR, "%s: NULL output string provided\n",
__FUNCTION__);
return -EINVAL;
}
if (!ts) {
cmyth_dbg(CMYTH_DBG_ERROR, "%s: NULL timestamp provided\n",
__FUNCTION__);
return -EINVAL;
}
sprintf(str,
"%4.4ld-%2.2ld-%2.2ld",
ts->timestamp_year,
ts->timestamp_month,
ts->timestamp_day);
return 0;
}
示例13: cmyth_db_get_connection
MYSQL *
cmyth_db_get_connection(cmyth_database_t db)
{
if(cmyth_db_check_connection(db) != 0)
{
cmyth_dbg(CMYTH_DBG_ERROR, "%s: cmyth_db_check_connection failed\n",
__FUNCTION__);
return NULL;
}
return db->mysql;
}
示例14: cmyth_proginfo_card_id
long
cmyth_proginfo_card_id(cmyth_proginfo_t prog)
{
if (!prog) {
cmyth_dbg(CMYTH_DBG_ERROR,
"%s: no program info\n", __FUNCTION__);
return -1;
}
return prog->proginfo_card_id;
}
示例15: cmyth_proginfo_port
int
cmyth_proginfo_port(cmyth_proginfo_t prog)
{
if (!prog) {
cmyth_dbg(CMYTH_DBG_ERROR,
"%s: no program info\n", __FUNCTION__);
return -1;
}
return prog->proginfo_port;
}