1 /* ADG - Automatic Drawing Generation
2 * Copyright (C) 2007,2008,2009,2010,2011,2012 Nicola Fontana <ntd at entidi.it>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
25 * @short_description: A wrapper for #CpmlPair
27 * AdgPair is a wrapper in #GType syntax of the #CpmlPair struct.
35 * Another name for #CpmlPair: check its documentation for the
36 * fields description and visibility details.
42 #include "adg-internal.h"
47 adg_pair_get_type(void)
49 static GType pair_type
= 0;
51 if (G_UNLIKELY(pair_type
== 0))
52 pair_type
= g_boxed_type_register_static("AdgPair",
53 (GBoxedCopyFunc
) adg_pair_dup
,
61 * @pair: the destination #AdgPair
62 * @src: the source #AdgPair
64 * Copies @src in @pair. It works in the same way as
65 * cpml_pair_copy() but performing argument validation
71 adg_pair_copy(AdgPair
*pair
, const AdgPair
*src
)
73 g_return_if_fail(pair
!= NULL
);
74 g_return_if_fail(src
!= NULL
);
76 memcpy(pair
, src
, sizeof(AdgPair
));
81 * @pair: an #AdgPair structure
85 * Returns: (transfer full): the duplicate of @pair: must be freed with g_free() when no longer needed.
90 adg_pair_dup(const AdgPair
*pair
)
92 /* g_memdup() returns NULL if pair is NULL */
93 return g_memdup(pair
, sizeof(AdgPair
));