| 1 |
#include <girepository.h> |
| 2 |
|
| 3 |
#include "meson-sample.h" |
| 4 |
|
| 5 |
gint |
| 6 |
main (gint argc, |
| 7 |
gchar *argv[]) |
| 8 |
{ |
| 9 |
GError * error = NULL; |
| 10 |
|
| 11 |
GOptionContext * ctx = g_option_context_new (NULL); |
| 12 |
g_option_context_add_group (ctx, g_irepository_get_option_group ()); |
| 13 |
|
| 14 |
if (!g_option_context_parse (ctx, &argc, &argv, &error)) { |
| 15 |
g_print ("sample: %s\n", error->message); |
| 16 |
g_option_context_free (ctx); |
| 17 |
if (error) { |
| 18 |
g_error_free (error); |
| 19 |
} |
| 20 |
|
| 21 |
return 1; |
| 22 |
} |
| 23 |
|
| 24 |
MesonSample * i = meson_sample_new (); |
| 25 |
MesonDep1 * dep1 = meson_dep1_new (); |
| 26 |
MesonDep2 * dep2 = meson_dep2_new ("Hello, meson/c!"); |
| 27 |
meson_sample_print_message (i, dep1, dep2); |
| 28 |
|
| 29 |
g_object_unref (i); |
| 30 |
g_object_unref (dep1); |
| 31 |
g_object_unref (dep2); |
| 32 |
g_option_context_free (ctx); |
| 33 |
|
| 34 |
return 0; |
| 35 |
} |