I am using Gsettings schema and have com.test.gschema.xml file. Now some keys inside the schema are enum and thus I require com.test.enums.xml file. Now I am using CMakeLists and thus can’t use gsettings_ENUM_NAMESPACE and gsettings_ENUM_FILES. On searching I found out that we can make use of glib-mkenums utility but I tried generating the *.enums.xml file using it by providing it
Tag: glib
Extract pointer to data from GPtrArray
I’m using GPtrArray structure to hold pointers to chunks of dynamically allocated memory. As I need as simple as possible and correct freeing of memory I set callback g_ptr_array_new_with_free_func () which will free one element of pointer array. Thus when I call g_ptr_array_free() for all elements of array is called callback which correctly freeing allocated memory. Here is some pseudo
How can I programmatically open the default browser and pass a URL in C/Linux?
Is there a convenient library call that allows me to open the default browser that I can use from C? I poked around in glib and didn’t see anything. There is xdg-open, and I can just system that I guess. Any better ideas? Answer If it is installed then xdg-open would work.