diff options
Diffstat (limited to 'apps/codecs/dumb/src/core/rawsig.c')
-rw-r--r-- | apps/codecs/dumb/src/core/rawsig.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/apps/codecs/dumb/src/core/rawsig.c b/apps/codecs/dumb/src/core/rawsig.c new file mode 100644 index 0000000000..926c990655 --- /dev/null +++ b/apps/codecs/dumb/src/core/rawsig.c | |||
@@ -0,0 +1,44 @@ | |||
1 | /* _______ ____ __ ___ ___ | ||
2 | * \ _ \ \ / \ / \ \ / / ' ' ' | ||
3 | * | | \ \ | | || | \/ | . . | ||
4 | * | | | | | | || ||\ /| | | ||
5 | * | | | | | | || || \/ | | ' ' ' | ||
6 | * | | | | | | || || | | . . | ||
7 | * | |_/ / \ \__// || | | | ||
8 | * /_______/ynamic \____/niversal /__\ /____\usic /| . . ibliotheque | ||
9 | * / \ | ||
10 | * / . \ | ||
11 | * rawsig.c - Function to retrieve raw signal / / \ \ | ||
12 | * data from a DUH provided you know | < / \_ | ||
13 | * what type of signal it is. | \/ /\ / | ||
14 | * \_ / > / | ||
15 | * By entheh. | \ / / | ||
16 | * | ' / | ||
17 | * \__/ | ||
18 | */ | ||
19 | |||
20 | #include <stdlib.h> | ||
21 | |||
22 | #include "dumb.h" | ||
23 | #include "internal/dumb.h" | ||
24 | |||
25 | |||
26 | |||
27 | /* You have to specify the type of sigdata, proving you know what to do with | ||
28 | * the pointer. If you get it wrong, you can expect NULL back. | ||
29 | */ | ||
30 | sigdata_t *duh_get_raw_sigdata(DUH *duh, int sig, long type) | ||
31 | { | ||
32 | DUH_SIGNAL *signal; | ||
33 | |||
34 | if (!duh) return NULL; | ||
35 | |||
36 | if ((unsigned int)sig >= (unsigned int)duh->n_signals) return NULL; | ||
37 | |||
38 | signal = duh->signal[sig]; | ||
39 | |||
40 | if (signal && signal->desc->type == type) | ||
41 | return signal->sigdata; | ||
42 | |||
43 | return NULL; | ||
44 | } | ||