summaryrefslogtreecommitdiffstats
path: root/rdcp_error.c
blob: 623f0f7c9ff207f381b4977b9666ec4ded29478b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
#include "rdcp_error.h"

GQuark
rdcp_error_quark (void)
{
    static volatile gsize quark_volatile = 0;

    if (quark_volatile == 0)
        quark_volatile = g_quark_from_static_string ("rdcp-error");

    return (GQuark)quark_volatile;
}

const char *
rdcp_error_code_to_string(rdcp_error_codes ec)
{
    static char buf[80];

    switch(ec) {
    case RDCP_ERROR_INTERNAL:    return "RDCP_ERROR_INTERNAL";
    case RDCP_ERROR_INVALID_ARG: return "RDCP_ERROR_INVALID_ARG";
    case RDCP_ERROR_DBUS:        return "RDCP_ERROR_DBUS";
    default:
        snprintf(buf, sizeof(buf), "unknown error code (%d)", ec);
        return buf;
    }
}