コード例 #1
0
ファイル: sniff.c プロジェクト: 11mariom/ekg2
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;
}
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;
}
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
0
ファイル: main.c プロジェクト: Cpasjuste/pmenu
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
0
ファイル: plugins.c プロジェクト: dmilith/ekg2-bsd
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
0
ファイル: main.c プロジェクト: Cpasjuste/pmenu
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
0
ファイル: partool.c プロジェクト: darcyg/ap_project_v2
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
0
ファイル: main.c プロジェクト: 1angJ6/linux-ipcs
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
0
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
0
ファイル: jabber_dcc.c プロジェクト: hiciu/ekg2
/* 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
0
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
0
ファイル: blur2D.cpp プロジェクト: ApocalypseDesign/ad_public
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
0
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
0
ファイル: disk.c プロジェクト: balr0g/cw
/****************************************************************************
 * 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
0
ファイル: fd3_program.c プロジェクト: CSRedRat/mesa-1
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;
}
コード例 #16
0
ファイル: intel_drm_winsys.c プロジェクト: pwnz7777/Mesa-3D
static bool
probe_winsys(struct intel_winsys *winsys)
{
   struct intel_winsys_info *info = &winsys->info;
   int val;

   /*
    * When we need the Nth vertex from a user vertex buffer, and the vertex is
    * uploaded to, say, the beginning of a bo, we want the first vertex in the
    * bo to be fetched.  One way to do this is to set the base address of the
    * vertex buffer to
    *
    *   bo->offset64 + (vb->buffer_offset - vb->stride * N).
    *
    * The second term may be negative, and we need kernel support to do that.
    *
    * This check is taken from the classic driver.  u_vbuf_upload_buffers()
    * guarantees the term is never negative, but it is good to require a
    * recent kernel.
    */
   get_param(winsys, I915_PARAM_HAS_RELAXED_DELTA, &val);
   if (!val) {
      debug_error("kernel 2.6.39 required");
      return false;
   }

   info->devid = drm_intel_bufmgr_gem_get_devid(winsys->bufmgr);

   if (drm_intel_get_aperture_sizes(winsys->fd,
         &info->aperture_mappable, &info->aperture_total)) {
      debug_error("failed to query aperture sizes");
      return false;
   }

   get_param(winsys, I915_PARAM_HAS_LLC, &val);
   info->has_llc = val;
   info->has_address_swizzling = test_address_swizzling(winsys);

   winsys->first_gem_ctx = drm_intel_gem_context_create(winsys->bufmgr);
   info->has_logical_context = (winsys->first_gem_ctx != NULL);

   get_param(winsys, I915_PARAM_HAS_ALIASING_PPGTT, &val);
   info->has_ppgtt = val;

   /* test TIMESTAMP read */
   info->has_timestamp = test_reg_read(winsys, 0x2358);

   get_param(winsys, I915_PARAM_HAS_GEN7_SOL_RESET, &val);
   info->has_gen7_sol_reset = val;

   return true;
}
コード例 #17
0
int32 CParticleSystem::m_Init(void *arg1)
{
  int32 i, j;
  CRenderLib *RL;
  HRESULT hr;
  char8 msg[150];

  strcpy(msg, p_Name);
  strcat(msg, " is a particle system without a texture! please control .ADP file!");
  if (!p_Texture) debug_error(miawin, msg);
  
  j=CGeometricObject::m_Init(arg1);
  if (!j) return(0);

  p_EmitterSpeed*=VEL_SCALE;
  p_EmitterVariation*=VAR_SCALE;
  p_ParticlesLive=0;
  p_PrevFramepos=p_StartTime;
  p_StepTime=0;
  p_MaxBirth=0;

  if (p_EmitterWidthTrack) p_EmitterWidthTrack->m_Init(1);
  if (p_EmitterHeightTrack) p_EmitterHeightTrack->m_Init(1);
  if (p_EmitterSpeedTrack) p_EmitterSpeedTrack->m_Init(1);
  if (p_EmitterVariationTrack) p_EmitterVariationTrack->m_Init(1);

  RL=(CRenderLib *)arg1;
  if (!RL) return(0);
  if (p_Texture->p_Type == GREYSCALE)
	  debug_error(miawin, "Particle system has a grayscale texture! Only 24bit are supported for particles!");
  RL->m_AddUpdate_Texture(p_Texture, 1);

  p_Particles=new Particle[p_MaxParticles];
  for (i=0; i<p_MaxParticles; i++)
  {
     p_Particles[i].age=-1;
     vect_set(&p_Particles[i].pos, 0, 0, 0);
     vect_set(&p_Particles[i].vel, 0, 0, 0);
  }

  // creazione ed inizializzazione del vertexbuffer
  hr=RL->p_Device->CreateVertexBuffer(p_MaxParticles*sizeof(ParticleVBVertex),
                                      D3DUSAGE_WRITEONLY |
									  D3DUSAGE_DYNAMIC | D3DUSAGE_POINTS, // | D3DUSAGE_SOFTWAREPROCESSING,
									  FVF_PARTICLE,
                                      D3DPOOL_DEFAULT,
									  //D3DPOOL_MANAGED,
									  &p_VertexBuffer);

  srand(1);
  return(1);
}
コード例 #18
0
static int __get_userinfo_data(unsigned char *buf, int len, int type, private_data_t **info) {
	int i, ret = 0;

	for (i=0; userinfo[i].type; i++) {
		if (userinfo[i].type != type)
			continue;
		switch (userinfo[i].item) {
			case 'S':
			{
				char *str;
				if (!ICQ_UNPACK(&buf, "S", &str))
					ret = 1;
				else
					private_item_set(info, userinfo[i].name, str);
				break;
			}
			case 'w':
			{
				uint16_t w = 0;
				if (!ICQ_UNPACK(&buf, "w", &w))
					ret = 1;
				else
					private_item_set_int(info, userinfo[i].name, w);
				break;
			}
			case 'b':
			case 'c':
			case 'L':
			{
				uint8_t b = 0;
				if (!ICQ_UNPACK(&buf, "c", &b))
					ret = 1;
				else
					private_item_set_int(info, userinfo[i].name, b);
				break;
			}
			default:
				debug_error("__get_userinfo_data() unknown item type %d\n", userinfo[i].item);
				ret = 1;
				break;
		}
		if (ret)
			private_item_set(info, userinfo[i].name, "");
	}
	if (len)
		debug_error("__get_userinfo_data() more data follow: %u\n", len);
	if (ret)
		debug_error("__get_userinfo_data() type:0x%x error: %u\n", type, len);
	return ret;
}
コード例 #19
0
ファイル: fd2_program.c プロジェクト: Haifen/Mesa-3D
static struct fd2_shader_stateobj *
compile(struct fd_program_stateobj *prog, struct fd2_shader_stateobj *so)
{
	int ret;

	if (fd_mesa_debug & FD_DBG_DISASM) {
		DBG("dump tgsi: type=%d", so->type);
		tgsi_dump(so->tokens, 0);
	}

	ret = fd2_compile_shader(prog, so);
	if (ret)
		goto fail;

	/* NOTE: we don't assemble yet because for VS we don't know the
	 * type information for vertex fetch yet.. so those need to be
	 * patched up later before assembling.
	 */

	so->info.sizedwords = 0;

	return so;

fail:
	debug_error("compile failed!");
	delete_shader(so);
	return NULL;
}
コード例 #20
0
ファイル: fetion_buddylist.c プロジェクト: amoid/oslabs
int fetion_buddylist_edit(User* user , int id , const char* name)
{
	FetionSip* sip = user->sip;
	SipHeader* eheader;
	char *res , *body;
	int ret;
	fetion_sip_set_type(sip , SIP_SERVICE);
	eheader = fetion_sip_event_header_new(SIP_EVENT_SETBUDDYLISTINFO);
	fetion_sip_add_header(sip , eheader);
	body = generate_edit_buddylist_body(id , name);
	res = fetion_sip_to_string(sip , body);
	free(body);
	tcp_connection_send(sip->tcp , res , strlen(res));
	free(res);
	res = fetion_sip_get_response(sip);
	ret = fetion_sip_get_code(res);
	free(res);
	if(ret == 200)
	{
		debug_info("Set buddy list name to %s success" , name);
		return 1;
	}
	else
	{
		debug_error("Set buddy list name to %s failed , errno:%d" , name , ret);
		return -1;
	}
}
コード例 #21
0
/*
 * Class:     org_jnetpcap_packet_JScanner
 * Method:    loadFlags
 * Signature: ([I)V
 */
JNIEXPORT void JNICALL Java_org_jnetpcap_packet_JScanner_loadFlags
(JNIEnv *env, jobject obj, jintArray jflags) {
#ifdef DEBUG
	debug_enter("loadFlags");
#endif

	scanner_t *scanner = (scanner_t *)getJMemoryPhysical(env, obj);
	if (scanner == NULL) {
		return;
	}

	jsize size = env->GetArrayLength(jflags);

#ifdef DEBUG
	debug_trace("load", "loaded %d flags", (int)size);
#endif

	if (size != MAX_ID_COUNT) {
		throwException(env,
				ILLEGAL_ARGUMENT_EXCEPTION,
				"size of array must be MAX_ID_COUNT size");
#ifdef DEBUG
		debug_error("IllegalArgumentException",
				"size of array must be MAX_ID_COUNT size");
#endif
		return;
	}

	env->GetIntArrayRegion(jflags, 0, size, (jint *)scanner->sc_flags);

#ifdef DEBUG
	debug_exit("loadFlags");
#endif
}
コード例 #22
0
ファイル: fetion_buddylist.c プロジェクト: amoid/oslabs
int fetion_buddylist_create(User* user , const char* name)
{
	FetionSip* sip = user->sip;
	SipHeader* eheader;
	char *res , *body;
	int ret;
	fetion_sip_set_type(sip , SIP_SERVICE);
	eheader = fetion_sip_event_header_new(SIP_EVENT_CREATEBUDDYLIST);
	fetion_sip_add_header(sip , eheader);
	body = generate_create_buddylist_body(name);
	res = fetion_sip_to_string(sip , body);
	free(body);
	tcp_connection_send(sip->tcp , res , strlen(res));
	free(res) ; 
	res = fetion_sip_get_response(sip);
	ret = fetion_sip_get_code(res);
	if(ret == 200)
	{
		ret = parse_create_buddylist_response(user , res);
		free(res);
		debug_info("Create buddy list success");
		return ret;
	}
	else
	{
		free(res);
		debug_error("Create buddy list failed , errno :" , ret);
		return -1;
	}
}
コード例 #23
0
ファイル: fetion_buddylist.c プロジェクト: amoid/oslabs
int fetion_buddylist_delete(User* user , int id)
{
	FetionSip* sip = user->sip;
	SipHeader* eheader;
	char *res , *body;
	int ret;
	fetion_sip_set_type(sip , SIP_SERVICE);
	eheader = fetion_sip_event_header_new(SIP_EVENT_DELETEBUDDYLIST);
	fetion_sip_add_header(sip , eheader);
	body = generate_delete_buddylist_body(id);
	res = fetion_sip_to_string(sip , body);
	free(body);
	tcp_connection_send(sip->tcp , res , strlen(res));
	free(res);
	res = fetion_sip_get_response(sip);
	ret = fetion_sip_get_code(res);
	free(res);
	if(ret == 200)
	{
		fetion_group_remove(user->groupList , id);
		debug_info("Delete buddy list success");
		return 1;
	}
	else
	{
		debug_error("Delete buddy list failed , errno:%d" , ret);
		return -1;
	}
}
コード例 #24
0
void AD_Object3D::init_tria(void)
{
  int i, j;
  AD_Tria3D taux;

  // PRECALCOLO DATI GEOMETRICI DEI TRIANGOLI (raggio, punto_medio, ecc)
  for (i=0; i<num_tria; i++)
  {
	if ((tria[i].v1==(AD_Vertex3D *)NULL) ||
	    (tria[i].v2==(AD_Vertex3D *)NULL) ||
	    (tria[i].v3==(AD_Vertex3D *)NULL))
	{ debug_error(miawin, "Lod error, NULL vertex reference"); }

    if (tria_init(&tria[i])==-1) return;
  }

  // ordino i triangoli per materiale usato
  for (i=0; i<num_tria-1; i++)
  {
	for (j=i+1; j<num_tria; j++)
	{
	  if (tria[i].materiale  < tria[j].materiale)
	  {
		taux=tria[i];
		tria[i]=tria[j];
		tria[j]=taux;
	  }
	}
  }
}
コード例 #25
0
/* NOTE : parameter eq_index is only used for _set_eq_level() */
int
mm_player_sound_filter_custom_set_level(MMHandleType hplayer, MMAudioFilterCustomType filter_custom_type, int eq_index, int level)
{
	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 );

	/* check if this filter type is supported */
	if ( !_mmplayer_is_supported_filter_type( MM_AUDIO_FILTER_TYPE_CUSTOM, filter_custom_type ) )
	{
		return MM_ERROR_PLAYER_SOUND_EFFECT_NOT_SUPPORTED_FILTER;
	}

	if (filter_custom_type == MM_AUDIO_FILTER_CUSTOM_EQ)
	{
		result = _mmplayer_sound_filter_custom_set_level_eq(player, eq_index, level);
	}
	else if (filter_custom_type > MM_AUDIO_FILTER_CUSTOM_EQ || filter_custom_type < MM_AUDIO_FILTER_CUSTOM_NUM)
	{
		result = _mmplayer_sound_filter_custom_set_level_ext(player, filter_custom_type, level);
	}
	else
	{
		debug_error("out of range, filter type(%d)\n", filter_custom_type);
		result = MM_ERROR_INVALID_ARGUMENT;
	}
	return result;
}
コード例 #26
0
int
mm_player_sound_filter_bypass (MMHandleType hplayer)
{
	mm_player_t* player = (mm_player_t*)hplayer;
	int result = MM_ERROR_NONE;
	GstElement *filter_element = NULL;
	debug_fenter();

	return_val_if_fail(player, MM_ERROR_PLAYER_NOT_INITIALIZED);

	if ( !PLAYER_INI()->use_audio_filter_preset && !PLAYER_INI()->use_audio_filter_custom )
	{
		debug_error("sound filter(preset/custom) is not suppported\n");
		return MM_ERROR_NOT_SUPPORT_API;
	}
	if ( !player->pipeline || !player->pipeline->audiobin )
	{
		debug_warning("filter element is not created yet.\n");
	}
	else
	{
		return_val_if_fail( player->pipeline->audiobin, MM_ERROR_PLAYER_NOT_INITIALIZED );
		filter_element = player->pipeline->audiobin[MMPLAYER_A_FILTER].gst;

		/* order action to sound effect plugin */
		g_object_set(filter_element, "filter-action", MM_AUDIO_FILTER_TYPE_NONE, NULL);
		debug_log("filter-action = %d\n", MM_AUDIO_FILTER_TYPE_NONE);
	}

	debug_fleave();
	return result;
}
コード例 #27
0
ファイル: id_context.c プロジェクト: jay8muel/Renderfusion
static void
identity_bind_sampler_states(struct pipe_context *_pipe,
                             unsigned shader,
                             unsigned start,
                             unsigned num_samplers,
                             void **samplers)
{
   struct identity_context *id_pipe = identity_context(_pipe);
   struct pipe_context *pipe = id_pipe->pipe;

   /* remove this when we have pipe->bind_sampler_states(..., start, ...) */
   assert(start == 0);

   switch (shader) {
   case PIPE_SHADER_VERTEX:
      pipe->bind_vertex_sampler_states(pipe, num_samplers, samplers);
      break;
   case PIPE_SHADER_GEOMETRY:
      pipe->bind_geometry_sampler_states(pipe, num_samplers, samplers);
      break;
   case PIPE_SHADER_FRAGMENT:
      pipe->bind_fragment_sampler_states(pipe, num_samplers, samplers);
      break;
   default:
      debug_error("Unexpected shader in identity_bind_sampler_states()");
   }
}
コード例 #28
0
ファイル: xmlnode.c プロジェクト: 11mariom/ekg2
void xmlnode_handle_end(void *data, const char *name)
{
	session_t *s = (session_t *) data;
	xmlnode_t *n;
	jabber_private_t *j;

	if (!s || !(j = s->priv) || !name) {
		debug_error("[jabber] xmlnode_handle_end() invalid parameters\n");
		return;
	}

	if (!(n = j->node)) {
			/* XXX: dj, maybe we set some sessionvar here,
			 * and then take a look at it before submitting PROTOCOL_DISCONNECTED
			 * with some weird error? */
		debug("[jabber] end tag within <stream>, ignoring\n");
		return;
	}

	if (!n->parent) {
		jabber_handle(data, n);
		xmlnode_free(n);
		j->node = NULL;
		return;
	} else {
		j->node = n->parent;
	}
}
コード例 #29
0
ファイル: stuff.c プロジェクト: dmilith/ekg2-bsd
struct timer *timer_add_ms(plugin_t *plugin, const char *name, unsigned int period, int persist, int (*function)(int, void *), void *data) {
	struct timer *t;
	struct timeval tv;

	/* wylosuj now± nazwê, je¶li nie mamy */
	if (!name)
		debug_error("timer_add() without name\n");

	t = xmalloc(sizeof(struct timer));
	gettimeofday(&tv, NULL);
	tv.tv_sec += (period / 1000);
	tv.tv_usec += ((period % 1000) * 1000);
	if (tv.tv_usec >= 1000000) {
		tv.tv_usec -= 1000000;
		tv.tv_sec++;
	}
	memcpy(&(t->ends), &tv, sizeof(tv));
	t->name = xstrdup(name);
	t->period = period;
	t->persist = persist;
	t->function = function;
	t->data = data;
	t->plugin = plugin;

	timers_add(t);
	return t;
}
コード例 #30
0
ファイル: avatar.c プロジェクト: GrayHatter/uTox
int set_avatar(uint32_t friend_number, const uint8_t *data, uint32_t size) {
    if (size > UTOX_AVATAR_MAX_DATA_LENGTH) {
        debug_error("Avatars:\t avatar too large\n");
        return 0;
    }

    uint16_t w, h;
    UTOX_NATIVE_IMAGE *image = decode_image_rgb((UTOX_IMAGE)data, size, &w, &h, 1);
    if(!UTOX_NATIVE_IMAGE_IS_VALID(image)) {
        debug("Avatars:\t avatar is invalid\n");
        return 0;
    } else {
        if (friend_number == -1) {
            avatar_free_image(&self.avatar);
            self.avatar.image  = image;
            self.avatar.width  = w;
            self.avatar.height = h;
            self.avatar.format = UTOX_AVATAR_FORMAT_PNG;
            tox_hash(self.avatar.hash, data, size);
        } else {
            FRIEND *f = &friend[friend_number];
            avatar_free_image(&f->avatar);

            f->avatar.image  = image;
            f->avatar.width  = w;
            f->avatar.height = h;
            f->avatar.format = UTOX_AVATAR_FORMAT_PNG;
            tox_hash(f->avatar.hash, data, size);
        }

        return 1;
    }
}