From: Enlightenment S. <no-...@en...> - 2011-11-14 15:19:53
|
Log: e_dbus/connman: add Domains property Author: lucas Date: 2011-11-14 07:19:46 -0800 (Mon, 14 Nov 2011) New Revision: 65183 Trac: http://trac.enlightenment.org/e/changeset/65183 Modified: trunk/e_dbus/src/lib/connman/E_Connman.h trunk/e_dbus/src/lib/connman/e_connman.c trunk/e_dbus/src/lib/connman/e_connman_private.h trunk/e_dbus/src/lib/connman/e_connman_service.c Modified: trunk/e_dbus/src/lib/connman/E_Connman.h =================================================================== --- trunk/e_dbus/src/lib/connman/E_Connman.h 2011-11-14 15:19:40 UTC (rev 65182) +++ trunk/e_dbus/src/lib/connman/E_Connman.h 2011-11-14 15:19:46 UTC (rev 65183) @@ -152,6 +152,7 @@ EAPI Eina_Bool e_connman_service_roaming_get(const E_Connman_Element *service, Eina_Bool *roaming) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; EAPI Eina_Bool e_connman_service_nameservers_get(const E_Connman_Element *service, unsigned int *count, const char ***nameserver) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT; +EAPI Eina_Bool e_connman_service_domains_get(const E_Connman_Element *service, unsigned int *count, const char ***domains) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT; EAPI Eina_Bool e_connman_service_ipv4_method_get(const E_Connman_Element *service, const char **method) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; EAPI Eina_Bool e_connman_service_ipv4_address_get(const E_Connman_Element *service, const char **address) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; Modified: trunk/e_dbus/src/lib/connman/e_connman.c =================================================================== --- trunk/e_dbus/src/lib/connman/e_connman.c 2011-11-14 15:19:40 UTC (rev 65182) +++ trunk/e_dbus/src/lib/connman/e_connman.c 2011-11-14 15:19:46 UTC (rev 65183) @@ -63,6 +63,7 @@ const char *e_connman_prop_technologies_enabled = NULL; const char *e_connman_prop_technologies_connected = NULL; const char *e_connman_prop_nameservers = NULL; +const char *e_connman_prop_domains = NULL; int _e_dbus_connman_log_dom = -1; @@ -312,6 +313,7 @@ ADD_STRINGSHARE(e_connman_prop_technologies_connected, "ConnectedTechnologies"); ADD_STRINGSHARE(e_connman_prop_nameservers, "Nameservers"); + ADD_STRINGSHARE(e_connman_prop_domains, "Domains"); #undef ADD_STRINGSHARE @@ -406,6 +408,7 @@ _stringshare_del(&e_connman_prop_technologies_enabled); _stringshare_del(&e_connman_prop_technologies_connected); _stringshare_del(&e_connman_prop_nameservers); + _stringshare_del(&e_connman_prop_domains); if (pending_get_name_owner) { Modified: trunk/e_dbus/src/lib/connman/e_connman_private.h =================================================================== --- trunk/e_dbus/src/lib/connman/e_connman_private.h 2011-11-14 15:19:40 UTC (rev 65182) +++ trunk/e_dbus/src/lib/connman/e_connman_private.h 2011-11-14 15:19:46 UTC (rev 65183) @@ -74,6 +74,7 @@ extern const char *e_connman_prop_technologies_connected; extern const char *e_connman_prop_login_required; extern const char *e_connman_prop_nameservers; +extern const char *e_connman_prop_domains; extern int _e_dbus_connman_log_dom; Modified: trunk/e_dbus/src/lib/connman/e_connman_service.c =================================================================== --- trunk/e_dbus/src/lib/connman/e_connman_service.c 2011-11-14 15:19:40 UTC (rev 65182) +++ trunk/e_dbus/src/lib/connman/e_connman_service.c 2011-11-14 15:19:46 UTC (rev 65183) @@ -697,6 +697,38 @@ } /** + * Get property "Domains" value. + * + * If this property isn't found then @c EINA_FALSE is returned. + * If @c EINA_FALSE is returned, then this call failed and parameter-returned + * values shall be considered invalid. + * The list of currently active domains for this service. If the server is + * not in READY or ONLINE state than this list will be empty. + * + * The list of currently used search domains. + * + * @param service path to get property. + * @param count return the number of elements in array. + * @param domains array with pointers to internal strings. These + * strings are not copied in any way, and they are granted to + * be eina_stringshare instances, so one can use + * eina_stringshare_ref() if he wants to save memory and cpu to + * get an extra reference. The array itself is allocated using + * malloc() and should be freed after usage is done. This + * pointer is just set if return is @c EINA_TRUE. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. + */ +Eina_Bool +e_connman_service_domains_get(const E_Connman_Element *service, unsigned int *count, const char ***domains) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(domains, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(count, EINA_FALSE); + return e_connman_element_strings_array_get_stringshared + (service, e_connman_prop_domains, count, domains); +} +/** * Get property "IPv4.Method" value. * * If this property isn't found then @c EINA_FALSE is returned. |