1
0

mp3sscdef.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /***************************************************************************\
  2. *
  3. * MPEG Layer3-Audio Decoder
  4. * © 1997-2006 by Fraunhofer IIS
  5. * All Rights Reserved
  6. *
  7. * filename: mp3sscdef.h
  8. * project : ---
  9. * author : Martin Sieler
  10. * date : 1998-02-16
  11. * contents/description: ssc definitions (Structured Status Code)
  12. *
  13. *
  14. \***************************************************************************/
  15. /*
  16. * $Date: 2010/11/17 20:46:04 $
  17. * $Id: mp3sscdef.h,v 1.1 2010/11/17 20:46:04 audiodsp Exp $
  18. */
  19. #ifndef __MP3SSCDEF_H__
  20. #define __MP3SSCDEF_H__
  21. /*------------------------- includes --------------------------------------*/
  22. /*-------------------------- defines --------------------------------------*/
  23. /*-------------------------------------------------------------------------*\
  24. *
  25. * Standard error/return values are 32 bit values layed out as follows:
  26. *
  27. * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  28. * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  29. * +---+-+-+-----------------------+-------------------------------+
  30. * |Sev|C|R| Handler | Code |
  31. * +---+-+-+-----------------------+-------------------------------+
  32. *
  33. * where
  34. *
  35. * Sev - is the severity code
  36. *
  37. * 00 - Success
  38. * 01 - Informational
  39. * 10 - Warning
  40. * 11 - Error
  41. *
  42. * C - is the Customer code flag
  43. *
  44. * R - is a reserved bit
  45. *
  46. * Handler - is the handler code
  47. *
  48. * Code - is the facility's status code
  49. *
  50. \*-------------------------------------------------------------------------*/
  51. /*
  52. * define the Severity codes
  53. */
  54. #define SSC_SEV_SUCCESS 0x00000000L
  55. #define SSC_SEV_INFO 0x40000000L
  56. #define SSC_SEV_WARNING 0x80000000L
  57. #define SSC_SEV_ERROR 0xc0000000L
  58. /*
  59. * define masks to extract the fields
  60. */
  61. #define SSC_MASK_SEVERITY 0xc0000000L
  62. #define SSC_MASK_HANDLER 0x0fff0000L
  63. #define SSC_MASK_CODE 0x0000ffffL
  64. /*
  65. * define MACROS to test an error/return code
  66. */
  67. #define SSC_GETSEV(x) ( (x) & SSC_MASK_SEVERITY )
  68. /* Check, if an SSC indicates success */
  69. #define SSC_SUCCESS(x) (((SSC_GETSEV(x)==SSC_SEV_SUCCESS)||(SSC_GETSEV(x)==SSC_SEV_INFO))?1:0)
  70. /* Check, if an SSC indicates an information */
  71. #define SSC_INFO(x) ((SSC_GETSEV(x)==SSC_SEV_INFO)?1:0)
  72. /* Check, if an SSC indicates a warning */
  73. #define SSC_WARNING(x) ((SSC_GETSEV(x)==SSC_SEV_WARNING)?1:0)
  74. /* Check, if an SSC indicates an error */
  75. #define SSC_ERROR(x) ((SSC_GETSEV(x)==SSC_SEV_ERROR)?1:0)
  76. /*-------------------------------------------------------------------------*\
  77. *
  78. * SSC classes (handler)
  79. *
  80. \*-------------------------------------------------------------------------*/
  81. #define SSC_HANDLER_GEN 0x00000000L
  82. #define SSC_I_GEN (SSC_SEV_INFO | SSC_HANDLER_GEN)
  83. #define SSC_W_GEN (SSC_SEV_WARNING | SSC_HANDLER_GEN)
  84. #define SSC_E_GEN (SSC_SEV_ERROR | SSC_HANDLER_GEN)
  85. /*-------------------------------------------------------------------------*/
  86. #define SSC_HANDLER_IO 0x00010000L
  87. #define SSC_I_IO (SSC_SEV_INFO | SSC_HANDLER_IO)
  88. #define SSC_W_IO (SSC_SEV_WARNING | SSC_HANDLER_IO)
  89. #define SSC_E_IO (SSC_SEV_ERROR | SSC_HANDLER_IO)
  90. /*-------------------------------------------------------------------------*/
  91. #define SSC_HANDLER_MPGA 0x01010000L
  92. #define SSC_I_MPGA (SSC_SEV_INFO | SSC_HANDLER_MPGA)
  93. #define SSC_W_MPGA (SSC_SEV_WARNING | SSC_HANDLER_MPGA)
  94. #define SSC_E_MPGA (SSC_SEV_ERROR | SSC_HANDLER_MPGA)
  95. /*-------------------------------------------------------------------------*\
  96. *
  97. * SSC codes
  98. *
  99. \*-------------------------------------------------------------------------*/
  100. typedef enum
  101. {
  102. SSC_OK = 0x00000000L,
  103. SSC_E_WRONGPARAMETER = (SSC_E_GEN | 1),
  104. SSC_E_OUTOFMEMORY = (SSC_E_GEN | 2),
  105. SSC_E_INVALIDHANDLE = (SSC_E_GEN | 3),
  106. SSC_E_IO_GENERIC = (SSC_W_IO | 1),
  107. SSC_E_IO_OPENFAILED = (SSC_W_IO | 2),
  108. SSC_E_IO_CLOSEFAILED = (SSC_W_IO | 3),
  109. SSC_E_IO_READFAILED = (SSC_W_IO | 4),
  110. SSC_I_MPGA_CRCERROR = (SSC_I_MPGA | 1),
  111. SSC_I_MPGA_NOMAINDATA = (SSC_I_MPGA | 2),
  112. SSC_E_MPGA_GENERIC = (SSC_E_MPGA | 1),
  113. SSC_E_MPGA_WRONGLAYER = (SSC_E_MPGA | 2),
  114. SSC_E_MPGA_BUFFERTOOSMALL = (SSC_E_MPGA | 3),
  115. SSC_W_MPGA_SYNCSEARCHED = (SSC_W_MPGA | 1),
  116. SSC_W_MPGA_SYNCLOST = (SSC_W_MPGA | 2),
  117. SSC_W_MPGA_SYNCNEEDDATA = (SSC_W_MPGA | 3),
  118. SSC_W_MPGA_SYNCEOF = (SSC_W_MPGA | 4)
  119. } SSC;
  120. /*-------------------------------------------------------------------------*/
  121. #endif