meson: Only perform macos checks on macos
[geany-mirror.git] / doc / stash-example.c
blob6ef68444363a39645a81296aa401537fd5427c51
1 StashGroup *group;
2 gboolean porcelain_enabled;
3 gchar *potter_name;
4 gint stock;
5 gdouble price;
6 const gchar filename[] = "/path/data.conf";
8 /* setup the group */
9 group = stash_group_new("cup");
10 stash_group_add_boolean(group, &porcelain_enabled, "porcelain", TRUE);
11 stash_group_add_string(group, &potter_name, "potter_name", "Miss Clay");
12 stash_group_add_integer(group, &stock, "stock", 5);
13 stash_group_add_double(group, &price, "price", 1.50);
15 /* load the settings from a file */
16 if (!stash_group_load_from_file(group, filename))
17 g_warning(_("Could not load keyfile %s!"), filename);
19 /* now use settings porcelain_enabled, potter_name, stock, and price */
20 /* ... */
22 /* save settings to file */
23 if (stash_group_save_to_file(group, filename, G_KEY_FILE_NONE) != 0)
24 g_error(_("Could not save keyfile %s!"), filename);
26 /* free memory */
27 stash_group_free(group);