* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* Authors: Christian Kellner <gicmo@gnome.org>
* Samuel Cormier-Iijima <sciyoshi@gmail.com>
#include "glibintl.h"
#include "gnetworkingprivate.h"
+struct _GInetAddressPrivate
+{
+ GSocketFamily family;
+ union {
+ struct in_addr ipv4;
+ struct in6_addr ipv6;
+ } addr;
+};
/**
* SECTION:ginetaddress
* @short_description: An IPv4/IPv6 address
+ * @include: gio/gio.h
*
* #GInetAddress represents an IPv4 or IPv6 internet address. Use
* g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
*/
G_DEFINE_TYPE_WITH_CODE (GInetAddress, g_inet_address, G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GInetAddress)
g_networking_init ();)
-struct _GInetAddressPrivate
-{
- GSocketFamily family;
- union {
- struct in_addr ipv4;
- struct in6_addr ipv6;
- } addr;
-};
-
enum
{
PROP_0,
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (GInetAddressPrivate));
-
gobject_class->set_property = g_inet_address_set_property;
gobject_class->get_property = g_inet_address_get_property;
static void
g_inet_address_init (GInetAddress *address)
{
- address->priv = G_TYPE_INSTANCE_GET_PRIVATE (address,
- G_TYPE_INET_ADDRESS,
- GInetAddressPrivate);
+ address->priv = g_inet_address_get_instance_private (address);
}
/**
struct in6_addr in6_addr;
#endif
+ g_return_val_if_fail (string != NULL, NULL);
+
/* If this GInetAddress is the first networking-related object to be
* created, then we won't have called g_networking_init() yet at
* this point.