-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31165fa
commit 78fbba9
Showing
20 changed files
with
142 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2024 The Mumble Developers. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license | ||
// that can be found in the LICENSE file at the root of the | ||
// Mumble source tree or at <https://www.mumble.info/LICENSE>. | ||
|
||
#include "Node.h" | ||
|
||
#include <stdlib.h> | ||
|
||
typedef enum CrossAudio_ErrorCode ErrorCode; | ||
|
||
static void freeNodeInner(Node *node) { | ||
free(node->id); | ||
free(node->name); | ||
} | ||
|
||
Nodes *nodesNew(const size_t count) { | ||
Nodes *nodes = malloc(sizeof(Nodes)); | ||
|
||
nodes->count = count; | ||
nodes->items = calloc(count, sizeof(Node)); | ||
|
||
return nodes; | ||
} | ||
|
||
ErrorCode CrossAudio_nodeFree(Node *node) { | ||
freeNodeInner(node); | ||
|
||
free(node); | ||
|
||
return CROSSAUDIO_EC_OK; | ||
} | ||
|
||
ErrorCode CrossAudio_nodesFree(Nodes *nodes) { | ||
for (size_t i = 0; i < nodes->count; ++i) { | ||
freeNodeInner(&nodes->items[i]); | ||
} | ||
|
||
free(nodes->items); | ||
free(nodes); | ||
|
||
return CROSSAUDIO_EC_OK; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2024 The Mumble Developers. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license | ||
// that can be found in the LICENSE file at the root of the | ||
// Mumble source tree or at <https://www.mumble.info/LICENSE>. | ||
|
||
#ifndef CROSSAUDIO_SRC_NODE_H | ||
#define CROSSAUDIO_SRC_NODE_H | ||
|
||
#include "crossaudio/Node.h" | ||
|
||
typedef struct CrossAudio_Node Node; | ||
typedef struct CrossAudio_Nodes Nodes; | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
Nodes *nodesNew(size_t count); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.