Made GsweSignInfo a boxed type
This commit is contained in:
parent
a4f0c8ef9a
commit
ea91278738
@ -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);
|
||||
|
@ -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__ */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user