コード例 #1
0
ファイル: eupnp_http_message.c プロジェクト: ningerso/eupnp
/*
 * Destructor for the Eupnp_HTTP_Request structure
 *
 * Frees the object and its attributes, including headers added.
 *
 * @param r previously created request
 */
void
eupnp_http_request_free(Eupnp_HTTP_Request *r)
{
   if (!r)
      return;

   if (r->method)
      eina_stringshare_del(r->method);
   if (r->http_version)
      eina_stringshare_del(r->http_version);
   if (r->uri)
      eina_stringshare_del(r->uri);

   if (r->headers)
     {
	Eina_Array_Iterator it;
	Eupnp_HTTP_Header *h;
	int i;

	EINA_ARRAY_ITER_NEXT(r->headers, i, h, it)
	   eupnp_http_header_free(h);

	eina_array_free(r->headers);
     }

   free(r);
}
コード例 #2
0
ファイル: dir.c プロジェクト: OpenInkpot-archive/madshelf
static void _free_files(Eina_Array* files)
{
    char* item;
    Eina_Array_Iterator iterator;
    unsigned int i;
    EINA_ARRAY_ITER_NEXT(files, i, item, iterator)
        free(item);
    eina_array_free(files);
}
コード例 #3
0
static void
_properties_names_array_free(Eina_Array *properties_names)
{
   Eina_Array_Iterator it;
   void *name;
   unsigned int i;

   EINA_ARRAY_ITER_NEXT(properties_names, i, name, it)
     free(name);

   eina_array_free(properties_names);
}
コード例 #4
0
ファイル: eina_suite.c プロジェクト: tguillem/efl
static void _mempool_shutdown(void)
{
   unsigned int i;
   Eina_Array_Iterator it;
   Eina_Module *module;	
   eina_module_list_free(_modules);
   if (_modules)
     {
        EINA_ARRAY_ITER_NEXT(_modules, i, module, it)
          free(module);
        eina_array_free(_modules);
     }
   eina_shutdown();
}
コード例 #5
0
ファイル: eina_bench_hash.c プロジェクト: RomainNaour/efl
static void
eina_bench_lookup_evas(int request)
{
   Evas_Hash *hash = NULL;
   Eina_Array *array = NULL;
   int *tmp_val;
   Eina_Array_Iterator it;
   unsigned int i;
   unsigned int j;

   array = eina_array_new(10000);

   for (i = 0; i < (unsigned int)request; ++i)
     {
        char tmp_key[10];

        tmp_val = malloc(sizeof (int));

        if (!tmp_val)
           continue;

        eina_convert_itoa(i, tmp_key);
        *tmp_val = i;

        hash = evas_hash_add(hash, tmp_key, tmp_val);

        eina_array_push(array, tmp_val);
     }

   srand(time(NULL));

   for (j = 0; j < 200; ++j)
      for (i = 0; i < (unsigned int)request; ++i)
        {
           char tmp_key[10];

           eina_convert_itoa(rand() % request, tmp_key);

           tmp_val = evas_hash_find(hash, tmp_key);
        }

   evas_hash_free(hash);

   EINA_ARRAY_ITER_NEXT(array, i, tmp_val, it)
     free(tmp_val);

   eina_array_free(array);
}
コード例 #6
0
ファイル: eupnp_http_message.c プロジェクト: ningerso/eupnp
/*
 * Prints out info about the Eupnp_HTTP_Response object
 *
 * Use EINA_ERROR_LEVEL=3 for seeing the printed messages.
 *
 * @param r: previously created response
 */
void
eupnp_http_response_dump(Eupnp_HTTP_Response *r)
{
   if (!r)
      return;

   DEBUG("Dumping HTTP response\n");
   if (r->http_version)
      DEBUG("* HTTP Version: %s\n", r->http_version);
   if (r->status_code)
      DEBUG("* Status Code: %d\n", r->status_code);
   if (r->reason_phrase)
      DEBUG("* Reason Phrase: %s\n", r->reason_phrase);

   if (r->headers)
     {
	Eina_Array_Iterator it;
	Eupnp_HTTP_Header *h;
	int i;

	EINA_ARRAY_ITER_NEXT(r->headers, i, h, it)
	   DEBUG("** %s: %s\n", h->key, h->value);
     }
}
コード例 #7
0
ファイル: eupnp_http_message.c プロジェクト: ningerso/eupnp
/*
 * Destructor for the Eupnp_HTTP_Response structure
 *
 * Frees the object and its attributes, including headers added.
 *
 * @param r previously created response
 */
void
eupnp_http_response_free(Eupnp_HTTP_Response *r)
{
   if (!r) return;

   if (r->http_version)
      eina_stringshare_del(r->http_version);
   if (r->reason_phrase)
      eina_stringshare_del(r->reason_phrase);

   if (r->headers)
     {
	Eina_Array_Iterator it;
	Eupnp_HTTP_Header *h;
	int i;

	EINA_ARRAY_ITER_NEXT(r->headers, i, h, it)
	   eupnp_http_header_free(h);

	eina_array_free(r->headers);
     }

   free(r);
}
コード例 #8
0
ファイル: eupnp_http_message.c プロジェクト: ningerso/eupnp
/*
 * Prints out info about the Eupnp_HTTP_Request object
 *
 * Use EINA_ERROR_LEVEL=3 for seeing the printed messages.
 *
 * @param r: previously created request
 */
void
eupnp_http_request_dump(Eupnp_HTTP_Request *r)
{
   if (!r)
      return;

   DEBUG("Dumping HTTP request\n");
   if (r->method)
      DEBUG("* Method: %s\n", r->method);
   if (r->uri)
      DEBUG("* URI: %s\n", r->uri);
   if (r->http_version)
      DEBUG("* HTTP Version: %s\n", r->http_version);

   if (r->headers)
     {
	Eina_Array_Iterator it;
	Eupnp_HTTP_Header *h;
	int i;

	EINA_ARRAY_ITER_NEXT(r->headers, i, h, it)
	   DEBUG("** %s: %s\n", h->key, h->value);
     }
}
コード例 #9
0
ファイル: module.c プロジェクト: GeeXboX/enna
/**
 * @brief Init the module system
 */
int
enna_module_init(void)
{
    Eina_Array_Iterator iterator;
    unsigned int i;
    
#ifdef USE_STATIC_MODULES
    Enna_Module_Api *api;

    /* Populate the array of available plugins statically */
    _plugins_array = eina_array_new(20);
    #ifdef BUILD_ACTIVITY_BOOKSTORE
        eina_array_push(_plugins_array, &enna_mod_activity_bookstore_api);
    #endif
    #ifdef BUILD_ACTIVITY_CONFIGURATION
        eina_array_push(_plugins_array, &enna_mod_activity_configuration_api);
    #endif
    #ifdef BUILD_ACTIVITY_GAMES
        eina_array_push(_plugins_array, &enna_mod_activity_games_api);
    #endif
    #ifdef BUILD_ACTIVITY_MUSIC
        eina_array_push(_plugins_array, &enna_mod_activity_music_api);
    #endif
    #ifdef BUILD_ACTIVITY_PHOTO
        eina_array_push(_plugins_array, &enna_mod_activity_photo_api);
    #endif
    #ifdef BUILD_ACTIVITY_TV
        eina_array_push(_plugins_array, &enna_mod_activity_tv_api);
    #endif
    #ifdef BUILD_ACTIVITY_VIDEO
        eina_array_push(_plugins_array, &enna_mod_activity_video_api);
    #endif
    #ifdef BUILD_ACTIVITY_WEATHER
        eina_array_push(_plugins_array, &enna_mod_activity_weather_api);
    #endif
    #ifdef BUILD_BROWSER_CDDA
        eina_array_push(_plugins_array, &enna_mod_browser_cdda_api);
    #endif
    #ifdef BUILD_BROWSER_DVD
        eina_array_push(_plugins_array, &enna_mod_browser_dvd_api);
    #endif
    #ifdef BUILD_BROWSER_IPOD
        eina_array_push(_plugins_array, &enna_mod_browser_ipod_api);
    #endif
    #ifdef BUILD_BROWSER_SPOTIFY
        eina_array_push(_plugins_array, &enna_mod_browser_spotify_api);
    #endif
    #ifdef BUILD_BROWSER_LOCALFILES
        eina_array_push(_plugins_array, &enna_mod_browser_localfiles_api);
    #endif
    #ifdef BUILD_BROWSER_NETSTREAMS
        eina_array_push(_plugins_array, &enna_mod_browser_netstreams_api);
    #endif
    #ifdef BUILD_BROWSER_PODCASTS
        eina_array_push(_plugins_array, &enna_mod_browser_podcasts_api);
    #endif
    #ifdef BUILD_BROWSER_SHOUTCAST
        eina_array_push(_plugins_array, &enna_mod_browser_shoutcast_api);
    #endif
    #ifdef BUILD_BROWSER_UPNP
        eina_array_push(_plugins_array, &enna_mod_browser_upnp_api);
    #endif
    #ifdef BUILD_BROWSER_VALHALLA
        eina_array_push(_plugins_array, &enna_mod_browser_valhalla_api);
    #endif
    #ifdef BUILD_GADGET_DATE
        eina_array_push(_plugins_array, &enna_mod_gadget_date_api);
    #endif
    #ifdef BUILD_GADGET_DUMMY
        eina_array_push(_plugins_array, &enna_mod_gadget_dummy_api);
    #endif
    #ifdef BUILD_GADGET_WEATHER
        eina_array_push(_plugins_array, &enna_mod_gadget_weather_api);
    #endif
    #ifdef BUILD_INPUT_KBD
        eina_array_push(_plugins_array, &enna_mod_input_kbd_api);
    #endif
    #ifdef BUILD_INPUT_LIRC
        eina_array_push(_plugins_array, &enna_mod_input_lirc_api);
    #endif
    #ifdef BUILD_INPUT_WIIMOTE
        eina_array_push(_plugins_array, &enna_mod_input_wiimote_api);
    #endif
    #ifdef BUILD_VOLUME_HAL
        eina_array_push(_plugins_array, &enna_mod_volume_hal_api);
    #endif
    #ifdef BUILD_VOLUME_MTAB
        eina_array_push(_plugins_array, &enna_mod_volume_mtab_api);
    #endif
    #ifdef BUILD_VOLUME_UDEV
        eina_array_push(_plugins_array, &enna_mod_volume_udev_api);
    #endif

    /* Log the array */
    enna_log(ENNA_MSG_INFO, NULL, "Available Plugins (static):");
    EINA_ARRAY_ITER_NEXT(_plugins_array, i, api, iterator)
        enna_log(ENNA_MSG_INFO, NULL, "\t * %s", api->name);

#else
    Eina_Module *module;

    /* Populate the array of available plugins dinamically */
    _plugins_array = eina_array_new(20);
    _plugins_array = eina_module_list_get(_plugins_array,
                        PACKAGE_LIB_DIR"/enna/modules/", 0, NULL, NULL);
    enna_log(ENNA_MSG_INFO, NULL,
              "Plugin Directory: %s", PACKAGE_LIB_DIR"/enna/modules/");

    /* Log the array */
    enna_log(ENNA_MSG_INFO, NULL, "Available Plugins (dynamic):");
    EINA_ARRAY_ITER_NEXT(_plugins_array, i, module, iterator)
        enna_log(ENNA_MSG_INFO, NULL, "\t * %s", eina_module_file_get(module));
#endif /* USE_STATIC_MODULES */

#if ENABLE_CONFIG_PANEL
    _config_panel = enna_config_panel_register(_("Modules"), "icon/module",
                                  _config_panel_show, _config_panel_hide, NULL);
#endif

    return 0;
}