"alsactl_event_type_get_type";
"alsactl_elem_event_mask_get_type";
- "alsactl_get_card_id_list";
- "alsactl_get_card_sysname";
- "alsactl_get_control_sysname";
- "alsactl_get_control_devnode";
-
"alsactl_card_get_type";
"alsactl_card_new";
"alsactl_card_open";
};
ALSA_GOBJECT_0_2_0 {
+ global:
"alsactl_card_error_get_type";
"alsactl_card_error_quark";
"alsactl_card_write_elem_tlv";
"alsactl_card_read_elem_tlv";
"alsactl_card_command_elem_tlv";
} ALSA_GOBJECT_0_0_0;
+
+ALSA_GOBJECT_0_3_0 {
+ global:
+ "alsactl_get_card_id_list";
+ "alsactl_get_card_sysname";
+ "alsactl_get_control_sysname";
+ "alsactl_get_control_devnode";
+} ALSA_GOBJECT_0_2_0;
* Get the list of numeric ID for available sound cards.
*
* Nodes under sound subsystem in sysfs are used to gather the information.
+ *
+ * Returns: %TRUE when the overall operation finishes successfully, else %FALSE.
*/
-void alsactl_get_card_id_list(guint **entries, gsize *entry_count,
- GError **error)
+gboolean alsactl_get_card_id_list(guint **entries, gsize *entry_count, GError **error)
{
int err;
- g_return_if_fail(entries != NULL);
- g_return_if_fail(entry_count != NULL);
- g_return_if_fail(error == NULL || *error == NULL);
+ g_return_val_if_fail(entries != NULL, FALSE);
+ g_return_val_if_fail(entry_count != NULL, FALSE);
+ g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
err = generate_card_sysnum_list(entries, entry_count);
- if (err < 0)
+ if (err < 0) {
generate_file_error(error, -err, "Fail to generate list of card sysnum");
+ return FALSE;
+ }
+
+ return TRUE;
}
/**
* Allocate sysname for the sound card and return it when it exists.
*
* Nodes under sound subsystem in sysfs are used to gather the information.
+ *
+ * Returns: %TRUE when the overall operation finishes successfully, else %FALSE.
*/
-void alsactl_get_card_sysname(guint card_id, char **sysname, GError **error)
+gboolean alsactl_get_card_sysname(guint card_id, char **sysname, GError **error)
{
int err;
- g_return_if_fail(sysname != NULL);
- g_return_if_fail(error == NULL || *error == NULL);
+ g_return_val_if_fail(sysname != NULL, FALSE);
+ g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
err = lookup_and_allocate_card_sysname(sysname, card_id);
- if (err < 0)
+ if (err < 0) {
generate_file_error(error, -err, "Fail to generate card sysname");
+ return FALSE;
+ }
+
+ return TRUE;
}
/**
* Allocate sysname of control device for the sound card and return it if exists.
*
* Nodes under sound subsystem in sysfs are used to gather the information.
+ *
+ * Returns: %TRUE when the overall operation finishes successfully, else %FALSE.
*/
-void alsactl_get_control_sysname(guint card_id, char **sysname, GError **error)
+gboolean alsactl_get_control_sysname(guint card_id, char **sysname, GError **error)
{
int err;
- g_return_if_fail(sysname != NULL);
- g_return_if_fail(error == NULL || *error == NULL);
+ g_return_val_if_fail(sysname != NULL, FALSE);
+ g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
err = lookup_and_allocate_control_sysname(sysname, card_id);
- if (err < 0)
+ if (err < 0) {
generate_file_error(error, -err, "Fail to generate control sysname");
+ return FALSE;
+ }
+
+ return TRUE;
}
/**
* Allocate string of devnode for control device of the sound card and return it if exists.
*
* Nodes under sound subsystem in sysfs are used to gather the information.
+ *
+ * Returns: %TRUE when the overall operation finishes successfully, else %FALSE.
*/
-void alsactl_get_control_devnode(guint card_id, char **devnode, GError **error)
+gboolean alsactl_get_control_devnode(guint card_id, char **devnode, GError **error)
{
int err;
- g_return_if_fail(devnode != NULL);
- g_return_if_fail(error == NULL || *error == NULL);
+ g_return_val_if_fail(devnode != NULL, FALSE);
+ g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
err = lookup_and_allocate_control_devname(devnode, card_id);
- if (err < 0)
+ if (err < 0) {
generate_file_error(error, -err, "Fail to generate control devname");
+ return FALSE;
+ }
+
+ return TRUE;
}
G_BEGIN_DECLS
-void alsactl_get_card_id_list(guint **entries, gsize *entry_count,
+gboolean alsactl_get_card_id_list(guint **entries, gsize *entry_count,
GError **error);
-void alsactl_get_card_sysname(guint card_id, char **sysname, GError **error);
+gboolean alsactl_get_card_sysname(guint card_id, char **sysname, GError **error);
-void alsactl_get_control_sysname(guint card_id, char **sysname, GError **error);
+gboolean alsactl_get_control_sysname(guint card_id, char **sysname, GError **error);
-void alsactl_get_control_devnode(guint card_id, char **devnode, GError **error);
+gboolean alsactl_get_control_devnode(guint card_id, char **devnode, GError **error);
G_END_DECLS