make a symbol in module-ptorocol-stub static
[profile/ivi/pulseaudio.git] / src / polyp-error.c
1 #include <stdio.h>
2 #include <stdlib.h>
3
4 #include "polyp-error.h"
5 #include "protocol-native-spec.h"
6
7 static const char* const errortab[PA_ERROR_MAX] = {
8     [PA_ERROR_OK] = "OK",
9     [PA_ERROR_ACCESS] = "Access denied",
10     [PA_ERROR_COMMAND] = "Unknown command",
11     [PA_ERROR_INVALID] = "Invalid argument",
12     [PA_ERROR_EXIST] = "Entity exists",
13     [PA_ERROR_NOENTITY] = "No such entity",
14     [PA_ERROR_CONNECTIONREFUSED] = "Connection refused",
15     [PA_ERROR_PROTOCOL] = "Protocol corrupt",
16     [PA_ERROR_TIMEOUT] = "Timeout",
17     [PA_ERROR_AUTHKEY] = "Not authorization key",
18     [PA_ERROR_INTERNAL] = "Internal error",
19     [PA_ERROR_CONNECTIONTERMINATED] = "Connection terminated",
20     [PA_ERROR_KILLED] = "Entity killed",
21 };
22
23 const char*pa_strerror(uint32_t error) {
24     if (error >= PA_ERROR_MAX)
25         return NULL;
26
27     return errortab[error];
28 }