GNOME Bugzilla – Bug 701318
Add G_SPAWN_DEFAULT to GSpawnFlags
Last modified: 2014-01-21 08:15:55 UTC
Created attachment 245684 [details] [review] Add G_SPAWN_DEFAULT so g_spawn_*() can be called without using 0 if no flags required Add G_SPAWN_DEFAULT to GSpawnFlags - there is no "no flags" value to use which makes the default use case of g_spawn_*() hard to read (lots of NULL and 0). i.e. g_spawn_sync (NULL, argv, NULL, 0, NULL, NULL, NULL, NULL, &exit_status, &error) becomes g_spawn_sync (NULL, argv, NULL, G_SPAWN_DEFAULT, NULL, NULL, NULL, NULL, &exit_status, &error); This is also nicer in non C languages where, i.e. in Vala: Process.spawn_sync (null, argv, SpawnFlags.DEFAULT, null, null, null, out exit_status);
Note I wasn't sure of a good name for the "no flags" case - I would have preferred G_SPAWN_FLAGS_NONE, but none of the other flags have the prefix G_SPAWN_FLAGS_. We could use G_SPAWN_NO_FLAGS which looks good in C, but other languages will make this look like GSpawnFlags.NO_FLAGS which I'm not sure sounds quite right.
You might be able to use nick annotations to tell glib-mkenums which name you prefer, regardless of the C identifier. Of course, various introspection tools might have their own ideas
This is missing the Since tag no?