test_boxed.c 563 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include "test_boxed.h"
  2. #include <glib.h>
  3. #include <glib-object.h>
  4. GBExample* gi_cpp_gbexample_new ()
  5. {
  6. return g_new0 (GBExample, 1);
  7. }
  8. static GBExample*
  9. gb_example_copy (const GBExample * src)
  10. {
  11. GBExample *out = gi_cpp_gbexample_new ();
  12. *out = *src;
  13. return out;
  14. }
  15. static void
  16. gb_example_free (GBExample * ex)
  17. {
  18. g_free (ex);
  19. }
  20. G_DEFINE_BOXED_TYPE (GBExample, gi_cpp_gbexample, gb_example_copy, gb_example_free)
  21. CBExample* gi_cpp_cbexample_new ()
  22. {
  23. return g_new0 (CBExample, 1);
  24. }
  25. void gi_cpp_cbexample_free (CBExample * ex)
  26. {
  27. g_free (ex);
  28. }