#line 2150 "/home/travis/build/felix-lang/felix/src/packages/sdl.fdoc"
  
  //Module        : SDL_mixer_h
  //Timestamp     : 2006/1/8 3:36:0 UTC
  //Timestamp     : 2006/1/8 14:36:0 (local)
  //Raw Header    : /usr/include/SDL/SDL_mixer.h
  //Preprocessor  : gcc -E
  //Input file: sdl.flxcc.i
  //Flxcc Control : sdl.flxcc
  //Felix Version : 1.1.2_rc1
  
  //#define Mix_GetError  SDL_GetError
  //#define Mix_SetError  SDL_SetError
  //#define Mix_FadeInChannel(channel,chunk,loops,ms) Mix_FadeInChannelTimed(channel,chunk,loops,ms,-1)
  //#define Mix_PlayChannel(channel,chunk,loops) Mix_PlayChannelTimed(channel,chunk,loops,-1)
  //#define MIX_EFFECTSMAXSPEED  "MIX_EFFECTSMAXSPEED"
  //#define MIX_CHANNEL_POST  -2
  //#define Mix_LoadWAV(file)     Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1)
  //#define MIX_MAX_VOLUME                128     /* Volume of a chunk */
  //#define MIX_DEFAULT_CHANNELS  2
  //#define MIX_DEFAULT_FORMAT    AUDIO_S16MSB
  //#define MIX_DEFAULT_FORMAT    AUDIO_S16LSB
  //#define MIX_DEFAULT_FREQUENCY 22050
  //#define MIX_CHANNELS  8
  //#define MIX_VERSION(X)                SDL_MIXER_VERSION(X)
  //#define MIX_PATCHLEVEL                SDL_MIXER_PATCHLEVEL
  //#define MIX_MINOR_VERSION     SDL_MIXER_MINOR_VERSION
  //#define MIX_MAJOR_VERSION     SDL_MIXER_MAJOR_VERSION
  //#define SDL_MIXER_VERSION(X)                                          \
  //#define SDL_MIXER_PATCHLEVEL  6
  //#define SDL_MIXER_MINOR_VERSION       2
  //#define SDL_MIXER_MAJOR_VERSION       1
  //#define _SDL_MIXER_H
  
  open module SDL_mixer_h
  {
    requires package "sdl";
    header '#include "SDL_mixer.h"';
  
    //ABSTRACT TYPES
    type Mix_MusicType = 'Mix_MusicType';
    type Mix_Chunk = 'Mix_Chunk';
    type Mix_Fading = 'Mix_Fading';
  
    //C FUNCTION POINTER TYPES
    header '''typedef void (*SDL_mixer_h_cft_3)(void *, Uint8 *, int);''';
    type SDL_mixer_h_cft_3 = 'SDL_mixer_h_cft_3';
    header '''typedef void (*SDL_mixer_h_cft_1)(int, void *, int,  void *);''';
    type SDL_mixer_h_cft_1 = 'SDL_mixer_h_cft_1';
    header '''typedef void (*SDL_mixer_h_cft_2)(int, void *);''';
    type SDL_mixer_h_cft_2 = 'SDL_mixer_h_cft_2';
    header '''typedef void (*SDL_mixer_h_cft_5)(int);''';
    type SDL_mixer_h_cft_5 = 'SDL_mixer_h_cft_5';
    header '''typedef void (*SDL_mixer_h_cft_4)(void);''';
    type SDL_mixer_h_cft_4 = 'SDL_mixer_h_cft_4';
  
    //PURE INCOMPLETE TYPES
    type _struct__Mix_Music = 'struct _Mix_Music'; //local
  
    //STRUCT or UNION TAG ALIASES
    typedef Mix_Music = _struct__Mix_Music;
  
    //TYPE ALIASES
    typedef Mix_EffectDone_t = SDL_mixer_h_cft_2;
    typedef Mix_EffectFunc_t = SDL_mixer_h_cft_1;
  
    //ENUMERATION CONSTANTS
    const MUS_CMD: int = 'MUS_CMD';
    const MIX_FADING_OUT: int = 'MIX_FADING_OUT';
    const MIX_NO_FADING: int = 'MIX_NO_FADING';
    const MIX_FADING_IN: int = 'MIX_FADING_IN';
    const MUS_WAV: int = 'MUS_WAV';
    const MUS_MID: int = 'MUS_MID';
    const MUS_OGG: int = 'MUS_OGG';
    const MUS_NONE: int = 'MUS_NONE';
    const MUS_MOD: int = 'MUS_MOD';
    const MUS_MP3: int = 'MUS_MP3';
  
    //PROCEDURES
    proc Mix_ChannelFinished: SDL_mixer_h_cft_5;
    proc Mix_CloseAudio: 1;
    proc Mix_FreeChunk: &Mix_Chunk;
    proc Mix_FreeMusic: &Mix_Music;
    proc Mix_HookMusic: SDL_mixer_h_cft_3 * address;
    proc Mix_HookMusicFinished: SDL_mixer_h_cft_4;
    proc Mix_Pause: int;
    proc Mix_PauseMusic: 1;
    proc Mix_Resume: int;
    proc Mix_ResumeMusic: 1;
    proc Mix_RewindMusic: 1;
    proc Mix_SetPostMix: SDL_mixer_h_cft_3 * address;
  
    //FUNCTIONS
    fun Mix_AllocateChannels: int -> int;
    fun Mix_ExpireChannel: int * int -> int;
    fun Mix_FadeInChannelTimed: int * &Mix_Chunk * int * int * int -> int;
    fun Mix_FadeInMusic: &Mix_Music * int * int -> int;
    fun Mix_FadeInMusicPos: &Mix_Music * int * int * double -> int;
    fun Mix_FadeOutChannel: int * int -> int;
    fun Mix_FadeOutGroup: int * int -> int;
    fun Mix_FadeOutMusic: int -> int;
    fun Mix_FadingChannel: int -> Mix_Fading;
    fun Mix_FadingMusic: 1 -> Mix_Fading;
    fun Mix_GetChunk: int -> &Mix_Chunk;
    fun Mix_GetMusicHookData: 1 -> address;
    fun Mix_GetMusicType: &Mix_Music -> Mix_MusicType;
    fun Mix_GetSynchroValue: 1 -> int;
    fun Mix_GroupAvailable: int -> int;
    fun Mix_GroupChannel: int * int -> int;
    fun Mix_GroupChannels: int * int * int -> int;
    fun Mix_GroupCount: int -> int;
    fun Mix_GroupNewer: int -> int;
    fun Mix_GroupOldest: int -> int;
    fun Mix_HaltChannel: int -> int;
    fun Mix_HaltGroup: int -> int;
    fun Mix_HaltMusic: 1 -> int;
    fun Mix_Linked_Version: 1 -> &SDL_version;
    fun Mix_LoadMUS: &char -> &Mix_Music;
    fun Mix_LoadWAV_RW: &SDL_RWops * int -> &Mix_Chunk;
    fun Mix_OpenAudio: int * uint16 * int * int -> int;
    fun Mix_Paused: int -> int;
    fun Mix_PausedMusic: 1 -> int;
    fun Mix_PlayChannelTimed: int * &Mix_Chunk * int * int -> int;
    fun Mix_PlayMusic: &Mix_Music * int -> int;
    fun Mix_Playing: int -> int;
    fun Mix_PlayingMusic: 1 -> int;
    fun Mix_QuerySpec: &int * &uint16 * &int -> int;
    fun Mix_QuickLoad_RAW: &uint8 * uint32 -> &Mix_Chunk;
    fun Mix_QuickLoad_WAV: &uint8 -> &Mix_Chunk;
    fun Mix_RegisterEffect: int * SDL_mixer_h_cft_1 * SDL_mixer_h_cft_2 * address -> int;
    fun Mix_ReserveChannels: int -> int;
    fun Mix_SetDistance: int * uint8 -> int;
    fun Mix_SetMusicCMD: &char -> int;
    fun Mix_SetMusicPosition: double -> int;
    fun Mix_SetPanning: int * uint8 * uint8 -> int;
    fun Mix_SetPosition: int * int16 * uint8 -> int;
    fun Mix_SetReverseStereo: int * int -> int;
    fun Mix_SetSynchroValue: int -> int;
    fun Mix_UnregisterAllEffects: int -> int;
    fun Mix_UnregisterEffect: int * SDL_mixer_h_cft_1 -> int;
    fun Mix_Volume: int * int -> int;
    fun Mix_VolumeChunk: &Mix_Chunk * int -> int;
    fun Mix_VolumeMusic: int -> int;
  
    //CALLBACK TYPE WRAPPERS
    //callback type SDL_mixer_h_cft_2, client data at 1
    typedef _fcbat_SDL_mixer_h_cft_2 = int;
    export type (_fcbat_SDL_mixer_h_cft_2) as "_fcbat_SDL_mixer_h_cft_2";
    typedef _fcbt_SDL_mixer_h_cft_2 = int -> void;
    export type (_fcbt_SDL_mixer_h_cft_2) as "_fcbt_SDL_mixer_h_cft_2";
    header '''void _fcbw_SDL_mixer_h_cft_2(int a1, void *a2);''';
  
    const _fcbw_SDL_mixer_h_cft_2: SDL_mixer_h_cft_2 = "_fcbw_SDL_mixer_h_cft_2";
    body '''
    void _fcbw_SDL_mixer_h_cft_2(int a1, void *a2){
      con_t *p  = ((_fcbt_SDL_mixer_h_cft_2)a2)->call(0, a1);
      while(p) p=p->resume();
    }''';
  
    //callback type SDL_mixer_h_cft_3, client data at 0
    typedef _fcbat_SDL_mixer_h_cft_3 = &uint8 * int;
    export type (_fcbat_SDL_mixer_h_cft_3) as "_fcbat_SDL_mixer_h_cft_3";
    typedef _fcbt_SDL_mixer_h_cft_3 = &uint8 * int -> void;
    export type (_fcbt_SDL_mixer_h_cft_3) as "_fcbt_SDL_mixer_h_cft_3";
    header '''void _fcbw_SDL_mixer_h_cft_3(void *a1, Uint8 *a2, int a3);''';
  
    const _fcbw_SDL_mixer_h_cft_3: SDL_mixer_h_cft_3 = "_fcbw_SDL_mixer_h_cft_3";
    body '''
    void _fcbw_SDL_mixer_h_cft_3(void *a1, Uint8 *a2, int a3){
      con_t *p  = ((_fcbt_SDL_mixer_h_cft_3)a1)->call(0, _fcbat_SDL_mixer_h_cft_3(a2, a3));
      while(p) p=p->resume();
    }''';
  
  
    //CALLBACK CLIENT WRAPPERS
    //callback client Mix_HookMusic, client data at 0, callback at 1
    proc wrapper_Mix_HookMusic(a1: _fcbt_SDL_mixer_h_cft_3) {
      Mix_HookMusic(_fcbw_SDL_mixer_h_cft_3, C_hack::cast[address]a1);
    }
    //callback client Mix_RegisterEffect, client data at 2, callback at 3
    fun wrapper_Mix_RegisterEffect(a1: int, a2: SDL_mixer_h_cft_1, a3: _fcbt_SDL_mixer_h_cft_2): int= {
      return Mix_RegisterEffect(a1, a2, _fcbw_SDL_mixer_h_cft_2, C_hack::cast[address]a3);
    }
    //callback client Mix_SetPostMix, client data at 0, callback at 1
    proc wrapper_Mix_SetPostMix(a1: _fcbt_SDL_mixer_h_cft_3) {
      Mix_SetPostMix(_fcbw_SDL_mixer_h_cft_3, C_hack::cast[address]a1);
    }
  }