diff options
Diffstat (limited to 'plugins/alsa/alsa-transaction.c')
-rw-r--r-- | plugins/alsa/alsa-transaction.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/alsa/alsa-transaction.c b/plugins/alsa/alsa-transaction.c index 1958c87..dcfd028 100644 --- a/plugins/alsa/alsa-transaction.c +++ b/plugins/alsa/alsa-transaction.c @@ -67,6 +67,27 @@ fail: } +bool AlsaMixerTransactionObjectAddTail(AlsaMixerTransaction* list, void* object, AlsaTransactionDestructor destructor) { + bool ret = false; + AlsaMixerTransactionDataItem * newItem = NULL; + if (!list) + goto fail; + + newItem = (AlsaMixerTransactionDataItem *) malloc(sizeof(AlsaMixerTransactionDataItem)); + if (newItem == NULL) + goto fail; + + CDS_INIT_LIST_HEAD(&newItem->list_entry); + newItem->object = object; + newItem->destructor = destructor; + cds_list_add_tail(&newItem->list_entry, &list->item_list); + + ret = true; +fail: + return ret; + +} + void AlsaMixerTransactionDoCleanup(AlsaMixerTransaction* transaction) { AlsaMixerTransactionDataItem * item, *sav; |