local A=require("\115\114\099\046\117\116\105\108\115")return{name="\103\111\098\106\101\099\116",filter={"\037\047\117\115\114\037\047\105\110\099\108\117\100\101\037\047\103\108\105\098\037-\050\037\046\048\037\047\103\111\098\106\101\099\116\037\047","\037\047\117\115\114\037\047\105\110\099\108\117\100\101\037\047\103\108\105\098\037-\050\037\046\048\037\047\103\108\105\098\037-\111\098\106\101\099\116\037\046\104\037\047"};hfile=A.path_combine(A.spec_path(),"\103\111\098\106\101\099\116\095\115\112\101\099\046\104");so={name="\103\111\098\106\101\099\116";fnames={"\108\105\098\103\111\098\106\101\099\116-\050\046\048\046\115\111","\108\105\098\103\111\098\106\101\099\116-\050\046\048-\048\046\100\108\108"}},search_dirs={"\047\117\115\114\047\105\110\099\108\117\100\101\047\103\108\105\098-\050\046\048\047";"\047\117\115\114\047\108\105\098\047\103\108\105\098-\050\046\048\047\105\110\099\108\117\100\101\047"},header_includes={"\103\108\105\098-\111\098\106\101\099\116\046\104"};explicit_function_bodies={g_object_new="\103\112\111\105\110\116\101\114 \103\095\111\098\106\101\099\116\095\110\101\119\040\071\084\121\112\101 \111\098\106\101\099\116\095\116\121\112\101\044 \099\111\110\115\116 \103\099\104\097\114 \042\102\105\114\115\116\095\112\114\111\112\101\114\116\121\095\110\097\109\101\044 \046\046\046\041 \123\n    \071\079\098\106\101\099\116 \042\111\098\106\101\099\116\059\n    \118\097\095\108\105\115\116 \118\097\114\095\097\114\103\115\059\n\n    \047\042 \115\104\111\114\116 \099\105\114\099\117\105\116 \102\111\114 \099\097\108\108\115 \115\117\112\112\108\121\105\110\103 \110\111 \112\114\111\112\101\114\116\105\101\115 \042\047\n    \105\102 \040\033\102\105\114\115\116\095\112\114\111\112\101\114\116\121\095\110\097\109\101\041\n        \114\101\116\117\114\110 \115\116\117\098\095\102\117\110\099\115\046\112\116\114\095\103\095\111\098\106\101\099\116\095\110\101\119\095\119\105\116\104\095\112\114\111\112\101\114\116\105\101\115\040\111\098\106\101\099\116\095\116\121\112\101\044 \048\044 \078\085\076\076\044 \078\085\076\076\041\059\n\n    \118\097\095\115\116\097\114\116\040\118\097\114\095\097\114\103\115\044 \102\105\114\115\116\095\112\114\111\112\101\114\116\121\095\110\097\109\101\041\059\n    \111\098\106\101\099\116 \061 \115\116\117\098\095\102\117\110\099\115\046\112\116\114\095\103\095\111\098\106\101\099\116\095\110\101\119\095\118\097\108\105\115\116\040\111\098\106\101\099\116\095\116\121\112\101\044 \102\105\114\115\116\095\112\114\111\112\101\114\116\121\095\110\097\109\101\044 \118\097\114\095\097\114\103\115\041\059\n    \118\097\095\101\110\100\040\118\097\114\095\097\114\103\115\041\059\n\n    \114\101\116\117\114\110 \111\098\106\101\099\116\059\n\125",g_signal_new="\103\117\105\110\116 \103\095\115\105\103\110\097\108\095\110\101\119 \040\099\111\110\115\116 \103\099\104\097\114 \042\115\105\103\110\097\108\095\110\097\109\101\044 \071\084\121\112\101 \105\116\121\112\101\044 \071\083\105\103\110\097\108\070\108\097\103\115 \115\105\103\110\097\108\095\102\108\097\103\115\044 \103\117\105\110\116 \099\108\097\115\115\095\111\102\102\115\101\116\044 \071\083\105\103\110\097\108\065\099\099\117\109\117\108\097\116\111\114 \097\099\099\117\109\117\108\097\116\111\114\044 \103\112\111\105\110\116\101\114 \097\099\099\117\095\100\097\116\097\044 \071\083\105\103\110\097\108\067\077\097\114\115\104\097\108\108\101\114 \099\095\109\097\114\115\104\097\108\108\101\114\044 \071\084\121\112\101 \114\101\116\117\114\110\095\116\121\112\101\044 \103\117\105\110\116 \110\095\112\097\114\097\109\115\044 \046\046\046\041 \123\n    \118\097\095\108\105\115\116 \097\114\103\115\059\n    \103\117\105\110\116 \115\105\103\110\097\108\095\105\100\059\n\n    \103\095\114\101\116\117\114\110\095\118\097\108\095\105\102\095\102\097\105\108\040\115\105\103\110\097\108\095\110\097\109\101 \033\061 \078\085\076\076\044 \048\041\059\n    \118\097\095\115\116\097\114\116\040\097\114\103\115\044 \110\095\112\097\114\097\109\115\041\059\n\n    \115\105\103\110\097\108\095\105\100 \061 \115\116\117\098\095\102\117\110\099\115\046\112\116\114\095\103\095\115\105\103\110\097\108\095\110\101\119\095\118\097\108\105\115\116\040\115\105\103\110\097\108\095\110\097\109\101\044 \105\116\121\112\101\044 \115\105\103\110\097\108\095\102\108\097\103\115\044\n        \099\108\097\115\115\095\111\102\102\115\101\116 \063 \115\116\117\098\095\102\117\110\099\115\046\112\116\114\095\103\095\115\105\103\110\097\108\095\116\121\112\101\095\099\099\108\111\115\117\114\101\095\110\101\119\040\105\116\121\112\101\044 \099\108\097\115\115\095\111\102\102\115\101\116\041\058 \078\085\076\076\044\n        \097\099\099\117\109\117\108\097\116\111\114\044 \097\099\099\117\095\100\097\116\097\044 \099\095\109\097\114\115\104\097\108\108\101\114\044 \114\101\116\117\114\110\095\116\121\112\101\044 \110\095\112\097\114\097\109\115\044 \097\114\103\115\041\059\n\n    \118\097\095\101\110\100\040\097\114\103\115\041\059\n\n    \114\101\116\117\114\110 \115\105\103\110\097\108\095\105\100\059\n\125"}}
local utils = require("src.utils")

return {
    name = "gobject",
    filter = { "%/usr%/include%/glib%-2%.0%/gobject%/", "%/usr%/include%/glib%-2%.0%/glib%-object%.h%/" },
    hfile = utils.path_combine(utils.spec_path(), "gobject_spec.h"),
    so = { name = "gobject", fnames = { "libgobject-2.0.so", "libgobject-2.0-0.dll" } },
    search_dirs = {
        "/usr/include/glib-2.0/",
        "/usr/lib/glib-2.0/include/",
    },
    header_includes = {
        "glib-object.h",
    },
    explicit_function_bodies = {
        -- From https://github.com/GNOME/glib/blob/83200855579964a20d3929f37a37431e4952d156/gobject/gobject.c#L2406
        g_object_new = [[gpointer g_object_new(GType object_type, const gchar *first_property_name, ...) {
    GObject *object;
    va_list var_args;

    /* short circuit for calls supplying no properties */
    if (!first_property_name)
        return stub_funcs.ptr_g_object_new_with_properties(object_type, 0, NULL, NULL);

    va_start(var_args, first_property_name);
    object = stub_funcs.ptr_g_object_new_valist(object_type, first_property_name, var_args);
    va_end(var_args);

    return object;
}]],
        -- From https://github.com/GNOME/glib/blob/7129521966fa7c4cd876b2aa429f1c8d50290902/gobject/gsignal.c#L1399
        g_signal_new = [[guint g_signal_new (const gchar *signal_name, GType itype, GSignalFlags signal_flags, guint class_offset, GSignalAccumulator accumulator, gpointer accu_data, GSignalCMarshaller c_marshaller, GType return_type, guint n_params, ...) {
    va_list args;
    guint signal_id;

    g_return_val_if_fail(signal_name != NULL, 0);
    va_start(args, n_params);

    signal_id = stub_funcs.ptr_g_signal_new_valist(signal_name, itype, signal_flags,
        class_offset ? stub_funcs.ptr_g_signal_type_cclosure_new(itype, class_offset): NULL,
        accumulator, accu_data, c_marshaller, return_type, n_params, args);

    va_end(args);

    return signal_id;
}]],
    },
}
