Subversion Repositories Kolibri OS

Rev

Rev 8030 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. // minimp3 for KolibriOS in native shared COFF library format.
  2.  
  3. // Some functions to allow us building without any external libs
  4.  
  5. // memset - may be optimized
  6. typedef unsigned int size_t;
  7. static inline void*  memset(void *mem, int c, unsigned size) {  
  8.         unsigned int i;
  9.         for (i = 0; i < size; i++ )
  10.                 *((char *)mem+i) = (char) c;
  11.        
  12.         return mem;    
  13. }
  14.  
  15. // memcpy - may be optimized
  16. void* memcpy(void *dest, const void *src, size_t count) {  
  17.         unsigned int i;
  18.         for (i = 0; i < count; i++)
  19.                 *(char *)(dest+i) = *(char *)(src+i);
  20.        
  21.         return 0;
  22. }
  23.  
  24. // For building with mingw compiler
  25. void __chkstk_ms(){
  26.         return;
  27. }
  28.  
  29. // Actual minimp3 related stuff starts here
  30.  
  31. #define MINIMP3_ONLY_MP3                                        // No MP2
  32. //#define MINIMP3_ONLY_SIMD                                     // No SSE2, some platforms might not have it
  33. #define MINIMP3_NO_SIMD
  34. //#define MINIMP3_NONSTANDARD_BUT_LOGICAL
  35. //#define MINIMP3_FLOAT_OUTPUT
  36. #define MINIMP3_IMPLEMENTATION                          // Include the actual decoder
  37. #include "minimp3.h"
  38.  
  39.  
  40. // KolibriOS type EXPORTS header
  41.  
  42. int __stdcall start(){
  43.       return 1;
  44. }
  45.  
  46. int __stdcall version_major(){
  47.       return 1;
  48. }
  49.  
  50. int __stdcall version_minor(){
  51.      return 0;
  52. }
  53.  
  54. typedef struct{
  55.   char *name;
  56.   void *f;
  57. }export_t;
  58.  
  59. char szStart[]          ="START";
  60. char szVersion[]        ="version";
  61. char szVersionM[]       ="version_min";
  62. char szInit[]           ="init";
  63. char szDecode[]         ="decode";
  64.  
  65. __attribute__((externally_visible)) export_t EXPORTS[] __asm__("EXPORTS") =
  66.   {
  67.         { szStart,              start },
  68.         { szVersion,    version_major },
  69.         { szVersionM,   version_minor },         
  70.     { szInit,           mp3dec_init },
  71.     { szDecode,         mp3dec_decode_frame },
  72.  
  73.     { NULL, NULL },
  74.   };
  75.  
  76. // End of file