<commit_before>/*
 * libvirt-gconfig-domain-sound.c: libvirt domain sound configuration
 *
 * Copyright (C) 2011 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 *
 * Author: <NAME> <<EMAIL>>
 */

#include <config.h>

#include "libvirt-gconfig/libvirt-gconfig.h"
#include "libvirt-gconfig/libvirt-gconfig-object-private.h"

#define GVIR_CONFIG_DOMAIN_SOUND_GET_PRIVATE(obj)                         \
        (G_TYPE_INSTANCE_GET_PRIVATE((obj), GVIR_TYPE_CONFIG_DOMAIN_SOUND, GVirConfigDomainSoundPrivate))

struct _GVirConfigDomainSoundPrivate
{
    gboolean unused;
};

G_DEFINE_TYPE(GVirConfigDomainSound, gvir_config_domain_sound, GVIR_TYPE_CONFIG_DOMAIN_DEVICE);


static void gvir_config_domain_sound_class_init(GVirConfigDomainSoundClass *klass)
{
    g_type_class_add_private(klass, sizeof(GVirConfigDomainSoundPrivate));
}


static void gvir_config_domain_sound_init(GVirConfigDomainSound *sound)
{
    g_debug("Init GVirConfigDomainSound=%p", sound);

    sound->priv = GVIR_CONFIG_DOMAIN_SOUND_GET_PRIVATE(sound);
}


GVirConfigDomainSound *gvir_config_domain_sound_new(void)
{
    GVirConfigObject *object;

    object = gvir_config_object_new(GVIR_TYPE_CONFIG_DOMAIN_SOUND,
                                    "sound", NULL);
    return GVIR_CONFIG_DOMAIN_SOUND(object);
}

GVirConfigDomainSound *gvir_config_domain_sound_new_from_xml(const gchar *xml,
                                                             GError **error)
{
    GVirConfigObject *object;

    object = gvir_config_object_new_from_xml(GVIR_TYPE_CONFIG_DOMAIN_SOUND,
                                             "sound", NULL, xml, error);
    return GVIR_CONFIG_DOMAIN_SOUND(object);
}

void gvir_config_domain_sound_set_model(GVirConfigDomainSound *sound,
                                        GVirConfigDomainSoundModel model)
{
    GVirConfigObject *node;

    g_return_if_fail(GVIR_IS_CONFIG_DOMAIN_SOUND(sound));
    node = gvir_config_object_replace_child(GVIR_CONFIG_OBJECT(sound),
                                            "sound");
    g_return_if_fail(GVIR_IS_CONFIG_OBJECT(node));
    gvir_config_object_set_attribute_with_type(node, "model",
                                               GVIR_TYPE_CONFIG_DOMAIN_SOUND_MODEL,
                                               model,
                                               NULL);
    g_object_unref(G_OBJECT(node));
}<commit_msg>Fix gvir_config_domain_sound_set_model<commit_after>/*
 * libvirt-gconfig-domain-sound.c: libvirt domain sound configuration
 *
 * Copyright (C) 2011 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 *
 * Author: <NAME> <<EMAIL>>
 */

#include <config.h>

#include "libvirt-gconfig/libvirt-gconfig.h"
#include "libvirt-gconfig/libvirt-gconfig-object-private.h"

#define GVIR_CONFIG_DOMAIN_SOUND_GET_PRIVATE(obj)                         \
        (G_TYPE_INSTANCE_GET_PRIVATE((obj), GVIR_TYPE_CONFIG_DOMAIN_SOUND, GVirConfigDomainSoundPrivate))

struct _GVirConfigDomainSoundPrivate
{
    gboolean unused;
};

G_DEFINE_TYPE(GVirConfigDomainSound, gvir_config_domain_sound, GVIR_TYPE_CONFIG_DOMAIN_DEVICE);


static void gvir_config_domain_sound_class_init(GVirConfigDomainSoundClass *klass)
{
    g_type_class_add_private(klass, sizeof(GVirConfigDomainSoundPrivate));
}


static void gvir_config_domain_sound_init(GVirConfigDomainSound *sound)
{
    g_debug("Init GVirConfigDomainSound=%p", sound);

    sound->priv = GVIR_CONFIG_DOMAIN_SOUND_GET_PRIVATE(sound);
}


GVirConfigDomainSound *gvir_config_domain_sound_new(void)
{
    GVirConfigObject *object;

    object = gvir_config_object_new(GVIR_TYPE_CONFIG_DOMAIN_SOUND,
                                    "sound", NULL);
    return GVIR_CONFIG_DOMAIN_SOUND(object);
}

GVirConfigDomainSound *gvir_config_domain_sound_new_from_xml(const gchar *xml,
                                                             GError **error)
{
    GVirConfigObject *object;

    object = gvir_config_object_new_from_xml(GVIR_TYPE_CONFIG_DOMAIN_SOUND,
                                             "sound", NULL, xml, error);
    return GVIR_CONFIG_DOMAIN_SOUND(object);
}

void gvir_config_domain_sound_set_model(GVirConfigDomainSound *sound,
                                        GVirConfigDomainSoundModel model)
{
    g_return_if_fail(GVIR_IS_CONFIG_DOMAIN_SOUND(sound));
    gvir_config_object_set_attribute_with_type(GVIR_CONFIG_OBJECT(sound), "model",
                                               GVIR_TYPE_CONFIG_DOMAIN_SOUND_MODEL,
                                               model,
                                               NULL);
}
{'fraction_non_alphanumeric': 0.06938639023574653, 'fraction_numerical': 0.006687844841999665, 'mean_word_length': 3.0446247464503045, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2971329', 'n_tokens_mistral': 1812, 'n_tokens_neox': 1715, 'n_words': 410}