Changeset 4960:60cdebcb83ef in roaraudio for libroarpulse/error.c


Ignore:
Timestamp:
05/14/11 04:46:29 (13 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

some updates for pulseaudio emulation, converted libroarpulse-simple fully to VS API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroarpulse/error.c

    r4708 r4960  
    4343static const struct { 
    4444 int error; 
     45 int ra_error; 
    4546 const char * name; 
    4647} _roar_pa_errors[] = { 
    47  {PA_OK,                       "OK"                             }, 
    48  {PA_ERR_ACCESS,               "Access denied"                  }, 
    49  {PA_ERR_COMMAND,              "Unknown command"                }, 
    50  {PA_ERR_INVALID,              "Invalid argument"               }, 
    51  {PA_ERR_EXIST,                "Entity exists"                  }, 
    52  {PA_ERR_NOENTITY,             "No such entity"                 }, 
    53  {PA_ERR_CONNECTIONREFUSED,    "Connection refused"             }, 
    54  {PA_ERR_PROTOCOL,             "Protocol error"                 }, 
    55  {PA_ERR_TIMEOUT,              "Timeout"                        }, 
    56  {PA_ERR_AUTHKEY,              "No authorization key"           }, 
    57  {PA_ERR_INTERNAL,             "Internal error"                 }, 
    58  {PA_ERR_CONNECTIONTERMINATED, "Connection terminated"          }, 
    59  {PA_ERR_KILLED,               "Entity killed"                  }, 
    60  {PA_ERR_INVALIDSERVER,        "Invalid server"                 }, 
    61  {PA_ERR_MODINITFAILED,        "Module initalization failed"    }, 
    62  {PA_ERR_BADSTATE,             "Bad state"                      }, 
    63  {PA_ERR_NODATA,               "No data"                        }, 
    64  {PA_ERR_VERSION,              "Incompatible protocol version"  }, 
    65  {PA_ERR_TOOLARGE,             "Too large"                      }, 
    66  {PA_ERR_MAX,                  "MAX"                            }, 
    67  {-1, NULL} 
     48 {PA_OK,                       ROAR_ERROR_NONE,   "OK"                             }, 
     49 {PA_ERR_ACCESS,               ROAR_ERROR_PERM,   "Access denied"                  }, 
     50 {PA_ERR_COMMAND,              ROAR_ERROR_BADRQC, "Unknown command"                }, 
     51 {PA_ERR_INVALID,              ROAR_ERROR_INVAL,  "Invalid argument"               }, 
     52 {PA_ERR_EXIST,                ROAR_ERROR_EXIST,  "Entity exists"                  }, 
     53 {PA_ERR_NOENTITY,             ROAR_ERROR_NOENT,  "No such entity"                 }, 
     54 {PA_ERR_CONNECTIONREFUSED,    ROAR_ERROR_CONNREFUSED, "Connection refused"             }, 
     55 {PA_ERR_PROTOCOL,             ROAR_ERROR_PROTO,  "Protocol error"                 }, 
     56 {PA_ERR_TIMEOUT,              ROAR_ERROR_TIMEDOUT, "Timeout"                        }, 
     57 {PA_ERR_AUTHKEY,              ROAR_ERROR_PERM,   "No authorization key"           }, 
     58 {PA_ERR_INTERNAL,             ROAR_ERROR_UNKNOWN, "Internal error"                 }, 
     59 {PA_ERR_CONNECTIONTERMINATED, ROAR_ERROR_IO,     "Connection terminated"          }, 
     60 {PA_ERR_KILLED,               ROAR_ERROR_IO,     "Entity killed"                  }, 
     61 {PA_ERR_INVALIDSERVER,        ROAR_ERROR_INVAL,  "Invalid server"                 }, 
     62 {PA_ERR_MODINITFAILED,        ROAR_ERROR_BADLIB, "Module initalization failed"    }, 
     63 {PA_ERR_BADSTATE,             ROAR_ERROR_INVAL,  "Bad state"                      }, 
     64 {PA_ERR_NODATA,               ROAR_ERROR_NODATA, "No data"                        }, 
     65 {PA_ERR_VERSION,              ROAR_ERROR_NSVERSION, "Incompatible protocol version"  }, 
     66 {PA_ERR_TOOLARGE,             ROAR_ERROR_RANGE,  "Too large"                      }, 
     67#ifdef PA_ERR_NOTSUPPORTED 
     68 {PA_ERR_NOTSUPPORTED,         ROAR_ERROR_NOTSUP, "Not supported"}, 
     69#endif 
     70#ifdef PA_ERR_UNKNOWN 
     71 {PA_ERR_UNKNOWN,              ROAR_ERROR_UNKNOWN, "Unknown error code"}, 
     72#endif 
     73#ifdef PA_ERR_NOEXTENSION 
     74 {PA_ERR_UNKNOWN,              ROAR_ERROR_NOENT,  "No such extension"}, 
     75#endif 
     76#ifdef PA_ERR_OBSOLETE 
     77 {PA_ERR_OBSOLETE,             ROAR_ERROR_NOSYS,  "Obsolete functionality"}, 
     78#endif 
     79#ifdef PA_ERR_NOTIMPLEMENTED 
     80 {PA_ERR_NOTIMPLEMENTED,       ROAR_ERROR_NOSYS,  "Missing implementation"}, 
     81#endif 
     82#ifdef PA_ERR_FORKED 
     83 {PA_ERR_FORKED,               ROAR_ERROR_INVAL,  "Client forked"}, 
     84#endif 
     85#ifdef PA_ERR_IO 
     86 {PA_ERR_IO,                   ROAR_ERROR_IO,     "Input/Output error"}, 
     87#endif 
     88#ifdef PA_ERR_BUSY 
     89 {PA_ERR_BUSY,                 ROAR_ERROR_BUSY,   "Device or resource busy"}, 
     90#endif 
     91 {PA_ERR_MAX,                  ROAR_ERROR_UNKNOWN, "MAX"                            }, 
     92 {-1, ROAR_ERROR_UNKNOWN, NULL} 
    6893}; 
    6994 
     
    78103} 
    79104 
     105int roar_pa_raerror2paerror(int error) { 
     106 int i; 
     107 
     108 for (i = 0; _roar_pa_errors[i].name != NULL; i++) 
     109  if ( _roar_pa_errors[i].ra_error == error ) 
     110   return _roar_pa_errors[i].error; 
     111 
     112 return PA_ERR_INVALID; 
     113} 
     114 
    80115//ll 
Note: See TracChangeset for help on using the changeset viewer.