diff --git a/src/swe-glib.c b/src/swe-glib.c index b87b03d..dd5b740 100644 --- a/src/swe-glib.c +++ b/src/swe-glib.c @@ -235,3 +235,25 @@ gswe_planet_info_free(GswePlanetInfo *planet_info) } G_DEFINE_BOXED_TYPE(GswePlanetInfo, gswe_planet_info, (GBoxedCopyFunc)gswe_planet_info_copy, (GBoxedFreeFunc)gswe_planet_info_free); + +static GsweSignInfo * +gswe_sign_info_copy(GsweSignInfo *sign_info) +{ + GsweSignInfo *ret = g_new0(GsweSignInfo, 1); + + ret->sign_id = sign_info->sign_id; + ret->name = g_strdup(sign_info->name); + ret->element = sign_info->element; + ret->quality = sign_info->quality; + + return ret; +} + +static void +gswe_sign_info_free(GsweSignInfo *sign_info) +{ + g_free(sign_info->name); + g_free(sign_info); +} + +G_DEFINE_BOXED_TYPE(GsweSignInfo, gswe_sign_info, (GBoxedCopyFunc)gswe_sign_info_copy, (GBoxedFreeFunc)gswe_sign_info_free); diff --git a/src/swe-glib.h b/src/swe-glib.h index 872c6be..b5d8598 100644 --- a/src/swe-glib.h +++ b/src/swe-glib.h @@ -36,5 +36,8 @@ void gswe_init(); GType gswe_planet_info_get_type(void); #define GSWE_TYPE_PLANET_INFO (gswe_planet_info_get_type()) +GType gswe_sign_info_get_type(void); +#define GSWE_TYPE_SIGN_INFO (gswe_sign_info_get_type()) + #endif /* __SWE_GLIB_H__ */