本文整理汇总了C++中debug_error函数的典型用法代码示例。如果您正苦于以下问题:C++ debug_error函数的具体用法?C++ debug_error怎么用?C++ debug_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debug_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QUERY
static QUERY(sniff_status_show) {
char *uid = *(va_arg(ap, char **));
session_t *s = session_find(uid);
struct pcap_stat stats;
if (!s)
return -1;
if (!s->connected)
return 0;
if (!s->priv) {
debug_error("sniff_status_show() s->priv NULL\n");
return -1;
}
/* Device: DEVICE (PROMISC?) */
/* some stats */
memset(&stats, 0, sizeof(struct pcap_stat));
if (pcap_stats(GET_DEV(s), &stats) == -1) {
debug_error("sniff_status_show() pcap_stats() failed\n");
return -1;
}
debug("pcap_stats() recv: %d drop: %d ifdrop: %d\n", stats.ps_recv, stats.ps_drop, stats.ps_ifdrop);
print("sniff_pkt_rcv", session_name(s), ekg_itoa(stats.ps_recv));
print("sniff_pkt_drop", session_name(s), ekg_itoa(stats.ps_drop));
print("sniff_conn_db", session_name(s), ekg_itoa(list_count(tcp_connections)));
return 0;
}
示例2: mmfile_format_close_amr
EXPORT_API
int mmfile_format_close_amr (MMFileFormatContext *formatContext)
{
MMFileAMRHandle handle = NULL;
int ret = MMFILE_FORMAT_FAIL;
if (NULL == formatContext ) {
debug_error ("error: invalid params\n");
return MMFILE_FORMAT_FAIL;
}
handle = formatContext->privateFormatData;
if(NULL != handle) {
ret = mmfile_amrparser_close(handle);
if(ret == MMFILE_AMR_PARSER_FAIL) {
debug_error("error: mmfile_format_close_amr\n");
}
}
if(formatContext->streams[MMFILE_AUDIO_STREAM]) {
mmfile_free(formatContext->streams[MMFILE_AUDIO_STREAM]);
formatContext->streams[MMFILE_AUDIO_STREAM] = NULL;
}
formatContext->ReadStream = NULL;
formatContext->ReadFrame = NULL;
formatContext->ReadTag = NULL;
formatContext->Close = NULL;
return MMFILE_FORMAT_SUCCESS;
}
示例3: mmfile_format_open_amr
EXPORT_API
int mmfile_format_open_amr (MMFileFormatContext *formatContext)
{
MMFileAMRHandle handle = NULL;
int res = MMFILE_FORMAT_FAIL;
if (NULL == formatContext || NULL == formatContext->uriFileName) {
debug_error ("error: mmfile_format_open_amr\n");
return MMFILE_FORMAT_FAIL;
}
formatContext->ReadStream = mmfile_format_read_stream_amr;
formatContext->ReadFrame = mmfile_format_read_frame_amr;
formatContext->ReadTag = mmfile_format_read_tag_amr;
formatContext->Close = mmfile_format_close_amr;
formatContext->videoTotalTrackNum = 0;
formatContext->audioTotalTrackNum = 1;
res = mmfile_amrparser_open (&handle, formatContext->uriFileName);
if (MMFILE_AMR_PARSER_FAIL == res) {
debug_error ("mmfile_amrparser_open\n");
return MMFILE_FORMAT_FAIL;
}
formatContext->privateFormatData = handle;
return MMFILE_FORMAT_SUCCESS;
}
示例4: gui_load
void gui_load()
{
debug_start();
pnd_app_get_list();
cfg_gui_read();
gui_load_skin();
if ( ! ( nh = pnd_notify_init() ) )
{
debug_error ( "PND INOTIFY init problem spotted\n" );
}
if ( ! ( nh2 = pnd_dbusnotify_init() ) )
{
debug_error ( "PND DBUSINOTIFY init problem spotted\n" );
}
initStatusCalls();
cpuUsage();
getCPULoad();
set_cpu( pmenu->cpu_mhz );
debug_end();
}
示例5: query_id
static int query_id(const char *name) {
struct query_def *a = NULL;
list_t l;
int i;
for (i=0; i < QUERY_EXTERNAL; i++) {
if (!xstrcmp(query_list[i].name, name)) {
#ifdef DDEBUG
debug_error("Use query_connect_id()/query_emit_id() for: %s\n", name);
#endif
return query_list[i].id;
}
}
for (l = queries_external; l; l = l->next) {
a = l->data;
if (!xstrcmp(a->name, name))
return a->id;
}
debug_error("query_id() NOT FOUND[%d]: %s\n", queries_count - QUERY_EXTERNAL, __(name));
a = xmalloc(sizeof(struct query_def));
a->id = queries_count++;
a->name = xstrdup(name);
list_add(&queries_external, a);
return a->id;
}
示例6: main
int main( )
{
gui_init();
gui_done = 0;
category = EMULATORS;
alpha_up = 1;
alpha = 150;
reset_scroll_count = 1;
if ( cfg_pmenu_read() < 1 )
{
debug_error( "cfg_pmenu_read failed, exiting..." );
GLES2D_Quit();
exit(0);
}
if ( cfg_gui_read() < 1 )
{
GLES2D_Quit();
debug_error( "cfg_gui_read failed, exiting..." );
exit(0);
}
gui_load();
GLES2D_FpsCounterInit();
nh_countdown = 60;
debug_func = 0;
strcpy( now_path, "/media" );
while( ! gui_done )
{
check_rediscover();
handle_dpad();
if ( pmenu->effect )
{
gui_draw();
GLES2D_DrawFont( fnt[SMALL], 750, 0, GLES2D_GetFpsChar() );
GLES2D_SwapBuffers();
GLES2D_FpsCounterUpdate();
}
if( do_quit )
gui_done = 1;
//usleep( 10000 );
}
gui_clean();
system( "echo startxfce4 > /tmp/gui.load" );
return 0;
}
示例7: part_write
static inline int
part_write(char *partition)
{
unsigned long begin = part_begin(partition);
unsigned long end = begin + partool_size - 1;
byte *tmp;
int err;
if (ADDR_BAD==begin) {
return -EINVAL8;
}
err = flash_sect_erase(begin, end);
if (err) {
debug_error("flash erase(begin:0x%x end:0x%x size:0x%x) failed(%d)",
begin, end, partool_size, err);
return err;
}
err = flash_write(part_tmp, begin, partool_size);
if (err) {
debug_error("flash write(begin:0x%x end:0x%x size:0x%x) failed(%d)",
begin, end, partool_size, err);
return err;
}
return 0;
}
示例8: main
int main(void)
{
int n;
int fd[2];
pid_t pid;
char line[MAXLINE];
if (pipe(fd) < 0)
{
debug_error("pipe error");
exit(-1);
}
if ((pid = fork()) < 0)
{
debug_error("fork error");
exit(-1);
}
else if (pid > 0)
{ /* parent */
close(fd[0]);
write(fd[1], "hello pipe\n", 12);
}
else { /* child */
close(fd[1]);
n = read(fd[0], line, MAXLINE);
write(STDOUT_FILENO, line, n);
}
exit(0);
}
示例9: mm_player_sound_filter_preset_apply
int
mm_player_sound_filter_preset_apply(MMHandleType hplayer, MMAudioFilterPresetType type)
{
mm_player_t* player = (mm_player_t*)hplayer;
int result = MM_ERROR_NONE;
debug_fenter();
return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
if (!PLAYER_INI()->use_audio_filter_preset)
{
debug_error("sound filter(preset) is not suppported\n", type);
return MM_ERROR_NOT_SUPPORT_API;
}
if (type < MM_AUDIO_FILTER_PRESET_AUTO || type >= MM_AUDIO_FILTER_PRESET_NUM)
{
debug_error("out of range, type(%d)\n", type);
return MM_ERROR_INVALID_ARGUMENT;
}
/* check if this filter type is supported */
if ( !_mmplayer_is_supported_filter_type( MM_AUDIO_FILTER_TYPE_PRESET, type ) )
{
return MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER;
}
result = _mmplayer_sound_filter_preset_apply(player, type);
return result;
}
示例10: debug_error
/* zwraca watcha */
static watch_t *jabber_dcc_init(int port) {
struct sockaddr_in sin;
int fd;
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
debug_error("jabber_dcc_init() socket() FAILED (%s)\n", strerror(errno));
return NULL;
}
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = INADDR_ANY;
sin.sin_port = g_htons(port);
while (bind(fd, (struct sockaddr *) &sin, sizeof(struct sockaddr_in))) {
debug_error("jabber_dcc_init() bind() port: %d FAILED (%s)\n", port, strerror(errno));
port++;
if (port > 65535) {
close(fd);
return NULL;
}
sin.sin_port = g_htons(port);
}
if (listen(fd, 10)) {
debug_error("jabber_dcc_init() listen() FAILED (%s)\n", strerror(errno));
close(fd);
return NULL;
}
debug_function("jabber_dcc_init() SUCCESSED fd:%d port:%d\n", fd, port);
jabber_dcc_port = port;
jabber_dcc_fd = fd;
return watch_add(&jabber_plugin, fd, WATCH_READ, jabber_dcc_handle_accept, NULL);
}
示例11: mmfile_format_read_stream_amr
EXPORT_API
int mmfile_format_read_stream_amr (MMFileFormatContext *formatContext)
{
MMFileAMRHandle handle = NULL;
tMMFILE_AMR_STREAM_INFO amrinfo = {0,};
MMFileFormatStream *audioStream = NULL;
int ret = MMFILE_FORMAT_FAIL;
if (NULL == formatContext ) {
debug_error ("error: invalid params\n");
ret = MMFILE_FORMAT_FAIL;
goto exception;
}
handle = formatContext->privateFormatData;
ret = mmfile_amrparser_get_stream_info (handle, &amrinfo);
if (MMFILE_FORMAT_SUCCESS != ret) {
debug_error ("error: mmfile_amrparser_get_stream_info\n");
ret = MMFILE_FORMAT_FAIL;
goto exception;
}
formatContext->duration = amrinfo.duration;
formatContext->videoStreamId = -1;
formatContext->videoTotalTrackNum = 0;
formatContext->audioTotalTrackNum = amrinfo.numTracks;
formatContext->nbStreams = 1;
audioStream = mmfile_malloc (sizeof(MMFileFormatStream));
if (NULL == audioStream) {
debug_error ("error: calloc_audiostream\n");
ret = MMFILE_FORMAT_FAIL;
goto exception;
}
audioStream->streamType = MMFILE_AUDIO_STREAM;
audioStream->codecId = MM_AUDIO_CODEC_AMR;
audioStream->bitRate = amrinfo.bitRate;
audioStream->framePerSec = amrinfo.frameRate;
audioStream->width = 0;
audioStream->height = 0;
audioStream->nbChannel = amrinfo.numAudioChannels;
audioStream->samplePerSec = amrinfo.samplingRate;
formatContext->streams[MMFILE_AUDIO_STREAM] = audioStream;
#ifdef __MMFILE_TEST_MODE__
mmfile_format_print_contents (formatContext);
#endif
return MMFILE_FORMAT_SUCCESS;
exception:
return ret;
}
示例12: debug_error
void zblur2D::init()
{
fact=1.01f;
if (in_ib==(imagebuffer *)NULL)
debug_error(miawin, "zblur: input buffer not setted");
if ((in_ib->width != image->width) ||
(in_ib->height != image->height))
debug_error(miawin, "zblur: input and output buffer dimensions mismatching");
}
示例13: _mmplayer_sound_filter_custom_set_level_ext
int
_mmplayer_sound_filter_custom_set_level_ext(mm_player_t *player, MMAudioFilterCustomType custom_filter_type, int level)
{
int filter_level_max = 0;
int filter_level_min = 0;
int count = 1; /* start from 1, because of excepting eq index */
int ext_level_index = 1; /* start from 1, because of excepting eq index */
int result = MM_ERROR_NONE;
debug_fenter();
return_val_if_fail( player, MM_ERROR_PLAYER_NOT_INITIALIZED );
/* check if EQ is supported */
if ( !_mmplayer_is_supported_filter_type( MM_AUDIO_FILTER_TYPE_CUSTOM, custom_filter_type ) )
{
return MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER;
}
while ( count < MM_AUDIO_FILTER_CUSTOM_NUM )
{
if ( PLAYER_INI()->audio_filter_custom_list[count] )
{
if ( count == custom_filter_type )
{
filter_level_min = PLAYER_INI()->audio_filter_custom_min_level_list[ext_level_index];
filter_level_max = PLAYER_INI()->audio_filter_custom_max_level_list[ext_level_index];
debug_msg("level min value(%d), level max value(%d)\n", filter_level_min, filter_level_max);
break;
}
ext_level_index++;
if (ext_level_index == PLAYER_INI()->audio_filter_custom_ext_num + 1)
{
debug_error("could not find min, max value. maybe filter information in ini file is not proper for sound effect plugin\n");
break;
}
}
count++;
}
if ( level < filter_level_min || level > filter_level_max )
{
debug_error("out of range, level(%d)\n", level);
result = MM_ERROR_INVALID_ARGUMENT;
}
else
{
player->audio_filter_info.custom_ext_level[custom_filter_type-1] = level;
debug_msg("set ext[%d] = %d\n", custom_filter_type-1, level);
}
debug_fleave();
return result;
}
示例14: config_disk_indexed
/****************************************************************************
* config_disk_indexed
****************************************************************************/
static cw_bool_t
config_disk_indexed(
struct config *cfg,
struct disk_track *dsk_trk)
{
cw_bool_t val = config_boolean(cfg, NULL, 0);
if (! disk_set_indexed_read(dsk_trk, val)) debug_error();
if (! disk_set_indexed_write(dsk_trk, val)) debug_error();
return (CW_BOOL_OK);
}
示例15: create_shader
static struct fd3_shader_stateobj *
create_shader(struct pipe_context *pctx, const struct pipe_shader_state *cso,
enum shader_t type)
{
struct fd3_shader_stateobj *so = CALLOC_STRUCT(fd3_shader_stateobj);
int ret;
if (!so)
return NULL;
so->type = type;
if (fd_mesa_debug & FD_DBG_DISASM) {
DBG("dump tgsi: type=%d", so->type);
tgsi_dump(cso->tokens, 0);
}
if (type == SHADER_FRAGMENT) {
/* we seem to get wrong colors (maybe swap/endianess or hw issue?)
* with full precision color reg. And blob driver only seems to
* use half precision register for color output (that I can find
* so far), even with highp precision. So for force half precision
* for frag shader:
*/
so->half_precision = true;
}
ret = fd3_compile_shader(so, cso->tokens);
if (ret) {
debug_error("compile failed!");
goto fail;
}
assemble_shader(pctx, so);
if (!so->bo) {
debug_error("assemble failed!");
goto fail;
}
if (type == SHADER_VERTEX)
fixup_vp_regfootprint(so);
if (fd_mesa_debug & FD_DBG_DISASM) {
DBG("disassemble: type=%d", so->type);
disasm_a3xx(fd_bo_map(so->bo), so->info.sizedwords, 0, so->type);
}
return so;
fail:
delete_shader(so);
return NULL;
}