/* Generated from "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod" by precompile.pike running Pike v8.0 release 1089
 *
 * Do NOT edit this file.
 */

#undef PRECOMPILE_API_VERSION
#define PRECOMPILE_API_VERSION 6

#undef PRECOMPILE_SUB_PIKEVARS
#define PRECOMPILE_SUB_PIKEVARS 1

#undef PRECOMPILE_DYNAMIC_TYPES
#define PRECOMPILE_DYNAMIC_TYPES 1



#undef cmod___CMOD__
#define cmod___CMOD__ 1
#line 1 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#line 1 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#line 1 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#line 3003 "/Users/hww3/devel/pike/lib/modules/Tools.pmod/Standalone.pmod/precompile.pike"







#line 3010 "/Users/hww3/devel/pike/lib/modules/Tools.pmod/Standalone.pmod/precompile.pike"
#line 1 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#line 1 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
/* -*- c -*-
|| This file is part of Pike. For copyright information see COPYRIGHT.
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING
|| for more information.
*/

#include "global.h"
#include "stralloc.h"
#include "pike_macros.h"
#include "program.h"
#include "program_id.h"
#include "operators.h"
#include "fdlib.h"
#include "fd_control.h"
#include "backend.h"
#include "module_support.h"
#include "array.h"
#include "builtin_functions.h"
#include "mapping.h"
#include "pike_types.h"
#include "threads.h"

#include "sdl_config.h"



#ifndef PIKE_UNUSED_ATTRIBUTE
#define PIKE_UNUSED_ATTRIBUTE
#endif
#define CMOD_MAP_PROGRAM_IDS_DEFINED 1
static int ___cmod_map_program_ids(int id) PIKE_UNUSED_ATTRIBUTE;
#ifndef TYPEOF
/* Compat with older Pikes. */
#define TYPEOF(SVAL)	((SVAL).type)
#define SUBTYPEOF(SVAL)	((SVAL).subtype)
#define SET_SVAL_TYPE(SVAL, TYPE)	(TYPEOF(SVAL) = TYPE)
#define SET_SVAL_SUBTYPE(SVAL, TYPE)	(SUBTYPEOF(SVAL) = TYPE)
#define SET_SVAL(SVAL, TYPE, SUBTYPE, FIELD, EXPR) do {	\
    /* Set the type afterwards to avoid a clobbered	\
     * svalue in case EXPR throws. */			\
    (SVAL).u.FIELD = (EXPR);				\
    SET_SVAL_TYPE((SVAL), (TYPE));			\
    SET_SVAL_SUBTYPE((SVAL), (SUBTYPE));		\
  } while(0)
#endif /* !TYPEOF */
#ifndef PIKE_UNUSED
/* Compat with Pike 7.8 and earlier. */
/* NB: Not strictly correct; PIKE_UNUSED was added the
 *     day after set_program_id_to_id(), but good enough.
 */
#ifndef UNUSED
#define UNUSED(X)	X
#endif
#ifndef set_program_id_to_id
/* NB: Recent Pike 7.8 has a #define that conflicts with
 *     the following declaration.
 */
static void set_program_id_to_id(void*UNUSED(id)){}
#endif
#else /* */
PMOD_EXPORT void set_program_id_to_id( int (*to)(int) );
#endif /* !PIKE_UNUSED */


#ifndef DEFAULT_CMOD_STORAGE
#define CMOD_COND_USED
#define DEFAULT_CMOD_STORAGE static
#endif
#ifndef CMOD_COND_USED
# define f_Rect_create_1_fun_num_used 1
#else
#undef f_Rect_create_1_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Rect_program_fun_num_used 1
#else
#undef Rect_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Rect_create_2_fun_num_used 1
#else
#undef f_Rect_create_2_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Rect_cast_fun_num_used 1
#else
#undef f_Rect_cast_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Rect_create_3_fun_num_used 1
#else
#undef f_Rect_create_3_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Rect_f_Rect_create_fun_num_used 1
#else
#undef Rect_f_Rect_create_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Rect_cq__backtickx_fun_num_used 1
#else
#undef f_Rect_cq__backtickx_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Rect_cq__backticky_fun_num_used 1
#else
#undef f_Rect_cq__backticky_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Rect_cq__backtickx_eq_fun_num_used 1
#else
#undef f_Rect_cq__backtickx_eq_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Rect_cq__backticky_eq_fun_num_used 1
#else
#undef f_Rect_cq__backticky_eq_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Rect_cq__backtickw_fun_num_used 1
#else
#undef f_Rect_cq__backtickw_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Rect_cq__backtickh_fun_num_used 1
#else
#undef f_Rect_cq__backtickh_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Rect_cq__backtickw_eq_fun_num_used 1
#else
#undef f_Rect_cq__backtickw_eq_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Rect_cq__backtickh_eq_fun_num_used 1
#else
#undef f_Rect_cq__backtickh_eq_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Keysym_program_fun_num_used 1
#else
#undef Keysym_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_losses_fun_num_used 1
#else
#undef f_PixelFormat_losses_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_masks_fun_num_used 1
#else
#undef f_PixelFormat_masks_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_shifts_fun_num_used 1
#else
#undef f_PixelFormat_shifts_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define PixelFormat_program_fun_num_used 1
#else
#undef PixelFormat_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_map_rgb_1_fun_num_used 1
#else
#undef f_PixelFormat_map_rgb_1_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_map_rgb_2_fun_num_used 1
#else
#undef f_PixelFormat_map_rgb_2_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_get_rgb_fun_num_used 1
#else
#undef f_PixelFormat_get_rgb_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_get_rgba_fun_num_used 1
#else
#undef f_PixelFormat_get_rgba_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define VideoInfo_program_fun_num_used 1
#else
#undef VideoInfo_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Surface_program_fun_num_used 1
#else
#undef Surface_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_get_pixel_fun_num_used 1
#else
#undef f_Surface_get_pixel_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_set_pixel_fun_num_used 1
#else
#undef f_Surface_set_pixel_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_lock_fun_num_used 1
#else
#undef f_Surface_lock_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_cq__backtickh_fun_num_used 1
#else
#undef f_Surface_cq__backtickh_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_cq__backtickw_fun_num_used 1
#else
#undef f_Surface_cq__backtickw_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_unlock_fun_num_used 1
#else
#undef f_Surface_unlock_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_init_fun_num_used 1
#else
#undef f_Surface_init_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_set_image_1_fun_num_used 1
#else
#undef f_Surface_set_image_1_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_set_image_2_fun_num_used 1
#else
#undef f_Surface_set_image_2_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_blit_fun_num_used 1
#else
#undef f_Surface_blit_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_fill_rect_fun_num_used 1
#else
#undef f_Surface_fill_rect_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_fill_fun_num_used 1
#else
#undef f_Surface_fill_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_set_color_key_fun_num_used 1
#else
#undef f_Surface_set_color_key_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_set_alpha_fun_num_used 1
#else
#undef f_Surface_set_alpha_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_set_clip_rect_fun_num_used 1
#else
#undef f_Surface_set_clip_rect_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Joystick_create_fun_num_used 1
#else
#undef f_Joystick_create_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Joystick_index_fun_num_used 1
#else
#undef f_Joystick_index_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Joystick_num_axes_fun_num_used 1
#else
#undef f_Joystick_num_axes_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Joystick_num_balls_fun_num_used 1
#else
#undef f_Joystick_num_balls_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Joystick_num_hats_fun_num_used 1
#else
#undef f_Joystick_num_hats_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Joystick_num_buttons_fun_num_used 1
#else
#undef f_Joystick_num_buttons_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Joystick_get_axis_fun_num_used 1
#else
#undef f_Joystick_get_axis_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Joystick_get_hat_fun_num_used 1
#else
#undef f_Joystick_get_hat_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Joystick_get_ball_fun_num_used 1
#else
#undef f_Joystick_get_ball_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Joystick_get_button_fun_num_used 1
#else
#undef f_Joystick_get_button_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Joystick_name_fun_num_used 1
#else
#undef f_Joystick_name_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Joystick_program_fun_num_used 1
#else
#undef Joystick_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define CDTrack_program_fun_num_used 1
#else
#undef CDTrack_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CD_create_fun_num_used 1
#else
#undef f_CD_create_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CD_track_fun_num_used 1
#else
#undef f_CD_track_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CD_cq__backtickid_fun_num_used 1
#else
#undef f_CD_cq__backtickid_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CD_status_fun_num_used 1
#else
#undef f_CD_status_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CD_play_fun_num_used 1
#else
#undef f_CD_play_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CD_play_tracks_fun_num_used 1
#else
#undef f_CD_play_tracks_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CD_pause_fun_num_used 1
#else
#undef f_CD_pause_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CD_resume_fun_num_used 1
#else
#undef f_CD_resume_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CD_stop_fun_num_used 1
#else
#undef f_CD_stop_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CD_eject_fun_num_used 1
#else
#undef f_CD_eject_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define CD_program_fun_num_used 1
#else
#undef CD_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Music_create_fun_num_used 1
#else
#undef f_Music_create_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Music_pause_fun_num_used 1
#else
#undef f_Music_pause_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Music_halt_fun_num_used 1
#else
#undef f_Music_halt_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Music_resume_fun_num_used 1
#else
#undef f_Music_resume_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Music_rewind_fun_num_used 1
#else
#undef f_Music_rewind_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Music_paused_fun_num_used 1
#else
#undef f_Music_paused_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Music_playing_fun_num_used 1
#else
#undef f_Music_playing_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Music_fading_fun_num_used 1
#else
#undef f_Music_fading_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Music_play_fun_num_used 1
#else
#undef f_Music_play_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Music_fade_in_fun_num_used 1
#else
#undef f_Music_fade_in_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Music_fade_out_fun_num_used 1
#else
#undef f_Music_fade_out_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Music_set_volume_fun_num_used 1
#else
#undef f_Music_set_volume_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Music_volume_fun_num_used 1
#else
#undef f_Music_volume_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Music_program_fun_num_used 1
#else
#undef Music_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_get_fun_num_used 1
#else
#undef f_Event_get_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_wait_fun_num_used 1
#else
#undef f_Event_wait_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_poll_fun_num_used 1
#else
#undef f_Event_poll_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backtickh_fun_num_used 1
#else
#undef f_Event_cq__backtickh_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backtickhat_fun_num_used 1
#else
#undef f_Event_cq__backtickhat_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backtickw_fun_num_used 1
#else
#undef f_Event_cq__backtickw_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backtickx_fun_num_used 1
#else
#undef f_Event_cq__backtickx_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backticky_fun_num_used 1
#else
#undef f_Event_cq__backticky_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Event_program_fun_num_used 1
#else
#undef Event_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_init_fun_num_used 1
#else
#undef f_init_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_get_error_fun_num_used 1
#else
#undef f_get_error_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_init_sub_system_fun_num_used 1
#else
#undef f_init_sub_system_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_quit_sub_system_fun_num_used 1
#else
#undef f_quit_sub_system_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_was_init_fun_num_used 1
#else
#undef f_was_init_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_quit_fun_num_used 1
#else
#undef f_quit_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_enable_unicode_fun_num_used 1
#else
#undef f_enable_unicode_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_get_mod_state_fun_num_used 1
#else
#undef f_get_mod_state_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_get_key_state_fun_num_used 1
#else
#undef f_get_key_state_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_video_mode_ok_fun_num_used 1
#else
#undef f_video_mode_ok_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_flip_fun_num_used 1
#else
#undef f_flip_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_update_rect_fun_num_used 1
#else
#undef f_update_rect_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_set_gamma_fun_num_used 1
#else
#undef f_set_gamma_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_get_video_surface_fun_num_used 1
#else
#undef f_get_video_surface_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_get_video_info_fun_num_used 1
#else
#undef f_get_video_info_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_gl_set_attribute_fun_num_used 1
#else
#undef f_gl_set_attribute_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_gl_get_attribute_fun_num_used 1
#else
#undef f_gl_get_attribute_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_show_cursor_fun_num_used 1
#else
#undef f_show_cursor_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_warp_mouse_fun_num_used 1
#else
#undef f_warp_mouse_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_gl_swap_buffers_fun_num_used 1
#else
#undef f_gl_swap_buffers_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_set_video_mode_fun_num_used 1
#else
#undef f_set_video_mode_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_blit_surface_fun_num_used 1
#else
#undef f_blit_surface_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_video_driver_name_fun_num_used 1
#else
#undef f_video_driver_name_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_set_caption_fun_num_used 1
#else
#undef f_set_caption_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_get_caption_fun_num_used 1
#else
#undef f_get_caption_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_grab_input_fun_num_used 1
#else
#undef f_grab_input_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_iconify_window_fun_num_used 1
#else
#undef f_iconify_window_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_toggle_fullscreen_fun_num_used 1
#else
#undef f_toggle_fullscreen_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_pump_events_fun_num_used 1
#else
#undef f_pump_events_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_num_joysticks_fun_num_used 1
#else
#undef f_num_joysticks_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_joystick_name_fun_num_used 1
#else
#undef f_joystick_name_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_joystick_opened_fun_num_used 1
#else
#undef f_joystick_opened_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_joystick_update_fun_num_used 1
#else
#undef f_joystick_update_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_joystick_event_state_fun_num_used 1
#else
#undef f_joystick_event_state_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_cd_num_drives_fun_num_used 1
#else
#undef f_cd_num_drives_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_cd_name_fun_num_used 1
#else
#undef f_cd_name_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_open_audio_fun_num_used 1
#else
#undef f_open_audio_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_VideoInfo_cq__backtickhw_available_fun_num_used 1
#else
#undef f_VideoInfo_cq__backtickhw_available_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickamask_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickamask_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickbytes_per_pixel_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickbytes_per_pixel_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickrshift_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickrshift_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickbits_per_pixel_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickbits_per_pixel_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickashift_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickashift_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickbshift_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickbshift_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickalpha_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickalpha_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_VideoInfo_cq__backtickformat_fun_num_used 1
#else
#undef f_VideoInfo_cq__backtickformat_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_map_rgba_1_fun_num_used 1
#else
#undef f_PixelFormat_map_rgba_1_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickbmask_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickbmask_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickgmask_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickgmask_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define PixelFormat_f_PixelFormat_map_rgb_fun_num_used 1
#else
#undef PixelFormat_f_PixelFormat_map_rgb_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_VideoInfo_cq__backtickblit_hw_fun_num_used 1
#else
#undef f_VideoInfo_cq__backtickblit_hw_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickrmask_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickrmask_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickaloss_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickaloss_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickgshift_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickgshift_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickgloss_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickgloss_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickrloss_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickrloss_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Keysym_cq__backtickunicode_fun_num_used 1
#else
#undef f_Keysym_cq__backtickunicode_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Keysym_cq__backtickscancode_fun_num_used 1
#else
#undef f_Keysym_cq__backtickscancode_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Keysym_cq__backtickmod_fun_num_used 1
#else
#undef f_Keysym_cq__backtickmod_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickbloss_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickbloss_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Keysym_cq__backticksym_fun_num_used 1
#else
#undef f_Keysym_cq__backticksym_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_cq__backtickcolorkey_fun_num_used 1
#else
#undef f_PixelFormat_cq__backtickcolorkey_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_VideoInfo_cq__backtickblit_hw_a_fun_num_used 1
#else
#undef f_VideoInfo_cq__backtickblit_hw_a_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define PixelFormat_f_PixelFormat_map_rgba_fun_num_used 1
#else
#undef PixelFormat_f_PixelFormat_map_rgba_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_VideoInfo_cq__backtickblit_sw_fun_num_used 1
#else
#undef f_VideoInfo_cq__backtickblit_sw_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_VideoInfo_cq__backtickblit_hw_cc_fun_num_used 1
#else
#undef f_VideoInfo_cq__backtickblit_hw_cc_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_PixelFormat_map_rgba_2_fun_num_used 1
#else
#undef f_PixelFormat_map_rgba_2_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_cq__backtickpitch_fun_num_used 1
#else
#undef f_Surface_cq__backtickpitch_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_cq__backtickformat_fun_num_used 1
#else
#undef f_Surface_cq__backtickformat_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_VideoInfo_cq__backtickblit_sw_a_fun_num_used 1
#else
#undef f_VideoInfo_cq__backtickblit_sw_a_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_display_format_fun_num_used 1
#else
#undef f_Surface_display_format_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CDTrack_cq__backticklength_fun_num_used 1
#else
#undef f_CDTrack_cq__backticklength_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Surface_f_Surface_set_image_fun_num_used 1
#else
#undef Surface_f_Surface_set_image_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_VideoInfo_cq__backtickvideo_mem_fun_num_used 1
#else
#undef f_VideoInfo_cq__backtickvideo_mem_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_VideoInfo_cq__backtickblit_fill_fun_num_used 1
#else
#undef f_VideoInfo_cq__backtickblit_fill_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_VideoInfo_cq__backtickblit_sw_cc_fun_num_used 1
#else
#undef f_VideoInfo_cq__backtickblit_sw_cc_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_VideoInfo_cq__backtickwm_available_fun_num_used 1
#else
#undef f_VideoInfo_cq__backtickwm_available_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_display_format_alpha_fun_num_used 1
#else
#undef f_Surface_display_format_alpha_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_cq__backtickflags_fun_num_used 1
#else
#undef f_Surface_cq__backtickflags_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_cq__backtickclip_rect_fun_num_used 1
#else
#undef f_Surface_cq__backtickclip_rect_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CDTrack_cq__backtickid_fun_num_used 1
#else
#undef f_CDTrack_cq__backtickid_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Surface_convert_surface_fun_num_used 1
#else
#undef f_Surface_convert_surface_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CDTrack_cq__backtickoffset_fun_num_used 1
#else
#undef f_CDTrack_cq__backtickoffset_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backtickyrel_fun_num_used 1
#else
#undef f_Event_cq__backtickyrel_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backticktype_fun_num_used 1
#else
#undef f_Event_cq__backticktype_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backtickwhich_fun_num_used 1
#else
#undef f_Event_cq__backtickwhich_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backtickstate_fun_num_used 1
#else
#undef f_Event_cq__backtickstate_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backtickkeysym_fun_num_used 1
#else
#undef f_Event_cq__backtickkeysym_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backtickxrel_fun_num_used 1
#else
#undef f_Event_cq__backtickxrel_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backtickvalue_fun_num_used 1
#else
#undef f_Event_cq__backtickvalue_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backtickgain_fun_num_used 1
#else
#undef f_Event_cq__backtickgain_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backtickcode_fun_num_used 1
#else
#undef f_Event_cq__backtickcode_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backtickbutton_fun_num_used 1
#else
#undef f_Event_cq__backtickbutton_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backtickball_fun_num_used 1
#else
#undef f_Event_cq__backtickball_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CDTrack_cq__backticktype_fun_num_used 1
#else
#undef f_CDTrack_cq__backticktype_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CD_cq__backtickcurrent_frame_fun_num_used 1
#else
#undef f_CD_cq__backtickcurrent_frame_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CD_cq__backticknumtracks_fun_num_used 1
#else
#undef f_CD_cq__backticknumtracks_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CD_cq__backtickcurrent_track_fun_num_used 1
#else
#undef f_CD_cq__backtickcurrent_track_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Event_cq__backtickaxis_fun_num_used 1
#else
#undef f_Event_cq__backtickaxis_fun_num_used
#endif
#line 27 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#ifdef HAVE_SDL

/*! @module SDL
 *!
 *! SDL or Simple DirectMedia Layer is a cross-platform multimedia
 *! library designed to provide fast access to the graphics
 *! framebuffer, audio device, input and other devices. This module
 *! implements a wrapper for SDL and other relevant libraries like
 *! SDL_mixer. The interface is similar to the C one, but using
 *! generally accepted Pike syntax.
 *!
 *! This means that classes are used when appropriate and that method
 *! names use all lowercase letters with words separated by _. For
 *! example @tt{SDL_SetVideoMode@} is named @[SDL.set_video_mode]. Also note
 *! that unless otherwise noted, errors result in an error being
 *! thrown rather than returning @expr{-1@} or @expr{0@}, as commonly
 *! done in SDL methods.
 */


/* To be able to access image functionality */
#include  "modules/Image/image.h"

#ifdef DYNAMIC_MODULE
struct program *image_program;
struct program *image_color_program;
#else
extern struct program *image_program;
extern struct program *image_color_program;
#endif

static struct object *image_make_rgb_color(INT32 r,INT32 g,INT32 b)
{
struct color_struct *cs;
struct object *color;
if (r<0) r=0; else if (r>COLORMAX) r=COLORMAX;
if (g<0) g=0; else if (g>COLORMAX) g=COLORMAX;
if (b<0) b=0; else if (b>COLORMAX) b=COLORMAX;

color = clone_object(image_color_program,0);

cs= get_storage(color, image_color_program);

cs->rgb.r=(COLORTYPE)r;
cs->rgb.g=(COLORTYPE)g;
cs->rgb.b=(COLORTYPE)b;
RGB_TO_RGBL(cs->rgbl,cs->rgb);
return color;
}


/* SDL needs this defined in it its own way */
#undef DECLSPEC
#ifdef HAVE_SDL_SDL_H
# include <SDL/SDL.h>
#else
# include <SDL.h>
#endif

#ifdef HAVE_SDL_MIXER
# ifdef HAVE_SDL_SDL_MIXER_H
#  include <SDL/SDL_mixer.h>
# elif defined(HAVE_SDL_MIXER_H)
#  include <SDL_mixer.h>
# endif
#endif

#include "constants.h"

#define THIS_OBJ Pike_interpreter.frame_pointer->current_object
#define RET_THIS() do { pop_n_elems(args); ref_push_object(THIS_OBJ); return; } while(0)

#define CHECK_CLASS(o, name, arg)\
  if(o->prog != PIKE_CONCAT(name, _program)) { \
    Pike_error("Invalid class for argument %d\n", arg); \
  }

/* Subsystem init (or rather quit) generations.
 * This is needed to detect whether a subsystem has been exited
 * since an object was created.
 */
static int timer_generation;
static int audio_generation;
static int video_generation;
static int cdrom_generation;
static int joystick_generation;

/*! @decl void init(int flags)
 *!
 *! Initializes SDL.  This should be called before all other SDL
 *! functions.
 *!
 *! @param flags
 *!  The flags parameter specifies what part(s) of SDL to
 *!  initialize. It can be one of many of the following ORed together.
 *!
 *! @dl
 *!   @item SDL.INIT_TIMER
 *!    Initializes the timer subsystem.
 *!
 *!   @item SDL.INIT_AUDIO
 *!    Initializes the audio subsystem.
 *!
 *!   @item SDL.INIT_VIDEO
 *!    Initializes the video subsystem.
 *!
 *!   @item SDL.INIT_CDROM
 *!    Initializes the cdrom subsystem.
 *!
 *!   @item SDL.INIT_JOYSTICK
 *!    Initializes the joystick subsystem.
 *!
 *!   @item SDL.INIT_EVERYTHING
 *!    Initialize all of the above.
 *!
 *!   @item SDL.INIT_NOPARACHUTE
 *!    Prevents SDL from catching fatal signals.
 *!
 *!   @item SDL.INIT_EVENTTHREAD
 *!    Run event polling in a separate thread. Not always supported.
 *! @enddl
 *!
 *! @seealso
 *!   @[SDL.quit()], @[SDL.init_sub_system()], @[SDL.quit_sub_system()]
 *!
 */
#define f_init_defined

#ifdef f_init_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_init_fun_num = 0;

#endif /* f_init_fun_num_used */
DEFAULT_CMOD_STORAGE void f_init(INT32 args) {
#line 153 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE flags;
#line 153 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("init",args,1);
#line 153 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("init",1,"int");
#line 153 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
flags=Pike_sp[0-1].u.integer;
#line 153 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
if( SDL_Init(flags) == -1) {
Pike_error("SDL Initialization failed: %s\n", SDL_GetError());
}
}

}
/*! @decl void|string get_error()
 *!
 *! Get the last internal SDL error.
 *! @returns
 *!   The error string, or zero if there was no error.
 */
#define f_get_error_defined

#ifdef f_get_error_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_get_error_fun_num = 0;

#endif /* f_get_error_fun_num_used */
DEFAULT_CMOD_STORAGE void f_get_error(INT32 args) {
#line 165 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("get_error",args,0);
#line 165 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
const char *err = SDL_GetError();
pop_n_elems(args);
if(err != NULL) {
push_text(err);
} else {
push_int(0);
}
}

}
/*! @decl void init_sub_system(int flags)
 *!
 *! After SDL has been initialized with @[SDL.init()] you may initialize
 *! uninitialized subsystems with this method.
 *!
 *! @param flags
 *!  The same as what is used in @[SDL.init()].
 *!
 *! @seealso
 *!  @[SDL.init()],  @[SDL.quit()], @[SDL.quit_sub_system()]
 */
#define f_init_sub_system_defined

#ifdef f_init_sub_system_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_init_sub_system_fun_num = 0;

#endif /* f_init_sub_system_fun_num_used */
DEFAULT_CMOD_STORAGE void f_init_sub_system(INT32 args) {
#line 186 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE flags;
#line 186 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("init_sub_system",args,1);
#line 186 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("init_sub_system",1,"int");
#line 186 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
flags=Pike_sp[0-1].u.integer;
#line 186 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_InitSubSystem(flags)); pop_stack(); push_int(ret_); return; }while(0);
#line 188 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl void quit_sub_system(int flags)
 *!
 *! After an SDL subsystem has been initialized with @[SDL.init()] or
 *! @[SDL.init_sub_system()], it may be shut down with this method.
 *!
 *! @param  flags
 *!   A bitwise OR'd combination of the subsystems
 *!   you wish to shut down (see @[SDL.init()] for a list of subsystem flags).
 *!
 *! @seealso
 *!  @[SDL.init()], @[SDL.init_sub_system()], @[SDL.quit()]
 */
#define f_quit_sub_system_defined

#ifdef f_quit_sub_system_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_quit_sub_system_fun_num = 0;

#endif /* f_quit_sub_system_fun_num_used */
DEFAULT_CMOD_STORAGE void f_quit_sub_system(INT32 args) {
#line 202 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE flags;
#line 202 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("quit_sub_system",args,1);
#line 202 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("quit_sub_system",1,"int");
#line 202 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
flags=Pike_sp[0-1].u.integer;
#line 202 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
SDL_QuitSubSystem(flags);
if (flags & SDL_INIT_TIMER) timer_generation++;
if (flags & SDL_INIT_AUDIO) audio_generation++;
if (flags & SDL_INIT_VIDEO) video_generation++;
if (flags & SDL_INIT_CDROM) cdrom_generation++;
if (flags & SDL_INIT_JOYSTICK) joystick_generation++;
}

}
/*! @decl int was_init(int flags)
 *!
 *! This method allows you to see which SDL subsytems have been
 *! initialized.
 *!
 *! @param  flags
 *!   A bitwise OR'd combination of the subsystems
 *!   you wish to check (see @[SDL.init()] for a list of subsystem flags).
 *!
 *! @returns
 *!  A bitwised OR'd combination of the initialized subsystems
 *!
 *! @seealso
 *!  @[SDL.init()], @[SDL.init_sub_system()]
 *!
 */
#define f_was_init_defined

#ifdef f_was_init_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_was_init_fun_num = 0;

#endif /* f_was_init_fun_num_used */
DEFAULT_CMOD_STORAGE void f_was_init(INT32 args) {
#line 227 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE flags;
#line 227 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("was_init",args,1);
#line 227 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("was_init",1,"int");
#line 227 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
flags=Pike_sp[0-1].u.integer;
#line 229 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_WasInit(flags)); pop_stack(); push_int(ret_); return; }while(0);
#line 231 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl void quit()
 *!
 *! Shuts down all SDL subsystems and frees the resources allocated to
 *! them. This should always be called before you exit.
 *!
 *! @note
 *! You can use the @[atexit()] method to ensure that this method is always
 *! called when Pike exits normally.
 *!
 *! @seealso
 *!  @[SDL.init()],  @[SDL.init_sub_system()], @[SDL.quit_sub_system()]
 */
#define f_quit_defined

#ifdef f_quit_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_quit_fun_num = 0;

#endif /* f_quit_fun_num_used */
DEFAULT_CMOD_STORAGE void f_quit(INT32 args) {
#line 245 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("quit",args,0);
#line 245 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
SDL_Quit();
timer_generation++;
audio_generation++;
video_generation++;
cdrom_generation++;
joystick_generation++;
}


}
/*! @decl int enable_unicode(int enable)
 *!
 *! Enables/Disables UNICODE keyboard translation.
 *!
 *! If you wish to translate a keysym to its printable
 *! representation, you need to enable UNICODE translation using this
 *! function and then look in the @b{unicode@} member of the
 *! @[SDL.Keysym] class. This value will be zero for keysyms that do
 *! not have a printable representation.  UNICODE translation is
 *! disabled by default as the conversion can cause a slight
 *! overhead.
 *!
 *! @param enable
 *!   A value of @expr{1@} enables Unicode translation, @expr{0@} disables
 *!   it and @expr{-1@} leaves it unchanged (useful for querying the current
 *!   translation mode).
 *!
 *! @returns
 *!   The previous translation mode (@expr{1@} enabled, @expr{0@} disabled).
 *!   If @b{enable@} is @expr{-1@}, the return value is the current translation
 *!   mode.
 *!
 *! @seealso
 *!
 *!   @[SDL.Keysym]
 */
#define f_enable_unicode_defined

#ifdef f_enable_unicode_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_enable_unicode_fun_num = 0;

#endif /* f_enable_unicode_fun_num_used */
DEFAULT_CMOD_STORAGE void f_enable_unicode(INT32 args) {
#line 281 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE enable;
#line 281 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("enable_unicode",args,1);
#line 281 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("enable_unicode",1,"int");
#line 281 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
enable=Pike_sp[0-1].u.integer;
#line 283 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_EnableUNICODE(enable)); pop_stack(); push_int(ret_); return; }while(0);
#line 285 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}


}
/*! @decl int get_mod_state()
 *!
 *! Returns the current state of the modifier keys (CTRL, ALT, etc.).
 *!
 *! @returns
 *! The return value can be an OR'd combination of the following:
 *! SDL.KMOD_NONE, SDL.KMOD_LSHIFT, SDL.KMOD_RSHIFT, SDL.KMOD_LCTRL,
 *! SDL.KMOD_RCTRL, SDL.KMOD_LALT, SDL.KMOD_RALT, SDL.KMOD_LMETA,
 *! SDL.KMOD_RMETA, SDL.KMOD_NUM, SDL.KMOD_CAPS, and
 *! SDL.KMOD_MODE.
 *!
 *! For convenience, the following are also defined:
 *! SDL.KMOD_CTRL, SDL.KMOD_SHIFT, SDL.KMOD_ALT and SDL.KMOD_META
 *!
 *! @seealso
 *!   @[SDL.get_key_state()], @[SDL.pump_events()]
 */
#define f_get_mod_state_defined

#ifdef f_get_mod_state_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_get_mod_state_fun_num = 0;

#endif /* f_get_mod_state_fun_num_used */
DEFAULT_CMOD_STORAGE void f_get_mod_state(INT32 args) {
#line 305 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("get_mod_state",args,0);
#line 307 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_GetModState());  push_int(ret_); return; }while(0);
#line 309 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl string get_key_state()
 *!
 *! Gets a snapshot of the current keyboard state.
 *!
 *! @returns
 *!   The current state is returned as a string.
 *!
 *!   The string is indexed by the @tt{SDL.K_*@} symbols.
 *!   A value of @expr{1@} means the key is pressed and
 *!   a value of @expr{0@} means it's not.
 *!
 *! @note
 *!  Call @[SDL.pump_events()] to update the state array.
 *!
 *! @seealso
 *!   @[SDL.get_mod_state()], @[SDL.pump_events()]
 *!
 *! @example
 *!   @code
 *!     // Test if the 'Escape' key is pressed.
 *!     SDL.pump_events();
 *!     string ks = SDL.get_key_state();
 *!     if ( ks[SDL.K_ESCAPE] )
 *!     {
 *!       // handle key press...
 *!   @endcode
 */
#define f_get_key_state_defined

#ifdef f_get_key_state_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_get_key_state_fun_num = 0;

#endif /* f_get_key_state_fun_num_used */
DEFAULT_CMOD_STORAGE void f_get_key_state(INT32 args) {
#line 338 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("get_key_state",args,0);
#line 340 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
int numkeys;
unsigned char *state = SDL_GetKeyState(&numkeys);
push_string(make_shared_binary_string((char*)state, numkeys));
}

}
/*! @class Rect
 *!
 *! Used in SDL to define a rectangular area. It is sometimes also used
 *! to specify only points or sizes (i.e only one of the position and
 *! dimension is used).
 */

#undef class_Rect_defined
#define class_Rect_defined
DEFAULT_CMOD_STORAGE struct program *Rect_program=NULL;

#ifdef Rect_program_fun_num_used
DEFAULT_CMOD_STORAGE int Rect_program_fun_num=-1;
#endif /* Rect_program_fun_num_used */

#undef var_rect_Rect_defined
#define var_rect_Rect_defined

#undef THIS
#define THIS ((struct Rect_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_RECT
#define THIS_RECT ((struct Rect_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_RECT
#define OBJ2_RECT(o) ((struct Rect_struct *)(o->storage+Rect_storage_offset))

#undef GET_RECT_STORAGE
#define GET_RECT_STORAGE(o) ((struct Rect_struct *)(o->storage+Rect_storage_offset)
static ptrdiff_t Rect_storage_offset;
struct Rect_struct {

#ifdef var_rect_Rect_defined
#line 353 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
SDL_Rect rect;
#endif /* var_rect_Rect_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Rect_struct *Rect_gdb_dummy_ptr;
#endif

#undef internal_init_Rect_defined
#define internal_init_Rect_defined

#undef Rect_event_handler_defined
#define Rect_event_handler_defined
static void init_Rect_struct(void)
#line 355 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
THIS->rect.x = THIS->rect.y = 0;
THIS->rect.w = THIS->rect.h = 0;
}
#define CHECK_I16_ARG(fun, n, x)	do {			\
    if ((x) < -32768 || (x) > 32767)				\
    SIMPLE_BAD_ARG_ERROR((fun), (n), "int(-32768..32767)");	\
} while(0)
#define CHECK_U16_ARG(fun, n, x)	do {			\
    if ((x) < 0 || (x) > 65535)					\
    SIMPLE_BAD_ARG_ERROR((fun), (n), "int(0..65535)");		\
} while(0)

/*! @decl void create()
   *! @decl void create(int(-32768..32767) x, int(-32768..32767) y)
   *! @decl void create(int(-32768..32767) x, int(-32768..32767) y, @
   *!                   int(0..65535) w, int(0..65535) h)
   *!
   *!   Create a new @[Rect].
   *!
   *! @param x
   *! @param y
   *!   Optional initial values for @[Rect()->x] and @[Rect()->y].
   *!
   *! @param w
   *! @param h
   *!   Optional initial values for @[Rect()->w] and @[Rect()->h].
   */
#define f_Rect_create_1_defined

#ifdef f_Rect_create_1_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Rect_create_1_fun_num = 0;

#endif /* f_Rect_create_1_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Rect_create_1(INT32 args) {
#line 383 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("create",args,0);
#line 383 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{ }
}
#define f_Rect_create_2_defined

#ifdef f_Rect_create_2_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Rect_create_2_fun_num = 0;

#endif /* f_Rect_create_2_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Rect_create_2(INT32 args) {
#line 384 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE x;
#line 384 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE y;
#line 384 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 2) wrong_number_of_args_error("create",args,2);
#line 384 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("create",1,"int(-32768..32767)");
#line 384 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
x=Pike_sp[0-2].u.integer;
#line 384 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("create",2,"int(-32768..32767)");
#line 384 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
y=Pike_sp[1-2].u.integer;
#line 384 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_I16_ARG("create", 1, x);
CHECK_I16_ARG("create", 2, y);
THIS->rect.x = x;
THIS->rect.y = y;
}
}
#define f_Rect_create_3_defined

#ifdef f_Rect_create_3_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Rect_create_3_fun_num = 0;

#endif /* f_Rect_create_3_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Rect_create_3(INT32 args) {
#line 390 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE x;
#line 390 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE y;
INT_TYPE w;
#line 391 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE h;
#line 390 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 4) wrong_number_of_args_error("create",args,4);
#line 390 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("create",1,"int(-32768..32767)");
#line 390 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
x=Pike_sp[0-4].u.integer;
#line 390 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("create",2,"int(-32768..32767)");
#line 390 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
y=Pike_sp[1-4].u.integer;
if(TYPEOF(Pike_sp[2-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("create",3,"int(0..65535)");
#line 391 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
w=Pike_sp[2-4].u.integer;
#line 391 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[3-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("create",4,"int(0..65535)");
#line 391 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
h=Pike_sp[3-4].u.integer;
#line 391 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_I16_ARG("create", 1, x);
CHECK_I16_ARG("create", 2, y);
CHECK_U16_ARG("create", 3, w);
CHECK_U16_ARG("create", 4, h);
THIS->rect.x = x;
THIS->rect.y = y;
THIS->rect.w = w;
THIS->rect.h = h;
}

}

#if defined(f_Rect_create_1_defined) || defined(f_Rect_create_2_defined) || defined(f_Rect_create_3_defined)
#define f_Rect_create_defined

#ifdef Rect_f_Rect_create_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t Rect_f_Rect_create_fun_num = 0;

#endif /* Rect_f_Rect_create_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Rect_create(INT32 args) {
  switch(args) {
   case 0:

#ifdef f_Rect_create_1_defined
    f_Rect_create_1(args);
    return;

#endif /* f_Rect_create_1_defined */
    break;
   case 2:

#ifdef f_Rect_create_2_defined
    f_Rect_create_2(args);
    return;

#endif /* f_Rect_create_2_defined */
    break;
   case 4:

#ifdef f_Rect_create_3_defined
    f_Rect_create_3(args);
    return;

#endif /* f_Rect_create_3_defined */
    break;
   default:
    wrong_number_of_args_error("create",args,0);
  }
}

#endif /* f_Rect_create_1_defined, f_Rect_create_2_defined, f_Rect_create_3_defined */
/*! @decl int(-32768..32767) x
   *! @decl int(-32768..32767) y
   *!   Position of the upper-left corner of the rectangle.
   *!   Internally these are 16 bit signed integers.
   *!   A runtime error will be generated when integer values are used
   *!   that are too big.
   */
#define f_Rect_cq__backtickx_defined

#ifdef f_Rect_cq__backtickx_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Rect_cq__backtickx_fun_num = 0;

#endif /* f_Rect_cq__backtickx_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Rect_cq__backtickx(INT32 args) {
#line 409 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`x",args,0);
{
push_int(THIS->rect.x);
}
}
#define f_Rect_cq__backticky_defined

#ifdef f_Rect_cq__backticky_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Rect_cq__backticky_fun_num = 0;

#endif /* f_Rect_cq__backticky_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Rect_cq__backticky(INT32 args) {
#line 413 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`y",args,0);
{
push_int(THIS->rect.y);
}
}
#define f_Rect_cq__backtickx_eq_defined

#ifdef f_Rect_cq__backtickx_eq_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Rect_cq__backtickx_eq_fun_num = 0;

#endif /* f_Rect_cq__backtickx_eq_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Rect_cq__backtickx_eq(INT32 args) {
#line 417 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE value;
#line 417 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("`x=",args,1);
#line 417 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("`x=",1,"int(-32768..32767)");
#line 417 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
value=Pike_sp[0-1].u.integer;
{
CHECK_I16_ARG("`x=", 1, value);
THIS->rect.x = value;
}
}
#define f_Rect_cq__backticky_eq_defined

#ifdef f_Rect_cq__backticky_eq_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Rect_cq__backticky_eq_fun_num = 0;

#endif /* f_Rect_cq__backticky_eq_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Rect_cq__backticky_eq(INT32 args) {
#line 422 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE value;
#line 422 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("`y=",args,1);
#line 422 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("`y=",1,"int(-32768..32767)");
#line 422 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
value=Pike_sp[0-1].u.integer;
{
CHECK_I16_ARG("`y=", 1, value);
THIS->rect.y = value;
}

}
/*! @decl int(0..65535) w
   *! @decl int(0..65535) h
   *!   The width and height of the rectangle. Internally these are 16 bit unsigned
   *!   integers. A runtime error will be generated when integer values are used
   *!   that are too big.
   */
#define f_Rect_cq__backtickw_defined

#ifdef f_Rect_cq__backtickw_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Rect_cq__backtickw_fun_num = 0;

#endif /* f_Rect_cq__backtickw_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Rect_cq__backtickw(INT32 args) {
#line 434 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`w",args,0);
{
push_int(THIS->rect.w);
}
}
#define f_Rect_cq__backtickh_defined

#ifdef f_Rect_cq__backtickh_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Rect_cq__backtickh_fun_num = 0;

#endif /* f_Rect_cq__backtickh_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Rect_cq__backtickh(INT32 args) {
#line 438 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`h",args,0);
{
push_int(THIS->rect.h);
}

}
#define f_Rect_cq__backtickw_eq_defined

#ifdef f_Rect_cq__backtickw_eq_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Rect_cq__backtickw_eq_fun_num = 0;

#endif /* f_Rect_cq__backtickw_eq_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Rect_cq__backtickw_eq(INT32 args) {
#line 443 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE value;
#line 443 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("`w=",args,1);
#line 443 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("`w=",1,"int(0..65535)");
#line 443 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
value=Pike_sp[0-1].u.integer;
{
CHECK_U16_ARG("`w=", 1, value);
THIS->rect.w = value;
}
}
#define f_Rect_cq__backtickh_eq_defined

#ifdef f_Rect_cq__backtickh_eq_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Rect_cq__backtickh_eq_fun_num = 0;

#endif /* f_Rect_cq__backtickh_eq_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Rect_cq__backtickh_eq(INT32 args) {
#line 448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE value;
#line 448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("`h=",args,1);
#line 448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("`h=",1,"int(0..65535)");
#line 448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
value=Pike_sp[0-1].u.integer;
{
CHECK_U16_ARG("`h=", 1, value);
THIS->rect.h = value;
}

}
/*! @decl array|mapping cast(string type)
   *!
   *! It is possible to cast a Rect object to an @tt{array@} or
   *! to a @tt{mapping@}. The array will have the values in the
   *! order x, y, w, h and the mapping will have the values
   *! associated with the corresponding names.
   */
#define f_Rect_cast_defined

#ifdef f_Rect_cast_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Rect_cast_fun_num = 0;

#endif /* f_Rect_cast_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Rect_cast(INT32 args) {
#line 461 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct pike_string * type;
#line 461 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("cast",args,1);
#line 461 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_STRING) SIMPLE_ARG_TYPE_ERROR("cast",1,"string");
#line 461 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(type=Pike_sp[0-1].u.string);
#line 463 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
pop_stack(); /* type as at least one more reference. */
if( type == literal_array_string )
{
push_int(THIS->rect.x);
push_int(THIS->rect.y);
push_int(THIS->rect.w);
push_int(THIS->rect.h);
f_aggregate(4);
} else if( type == literal_mapping_string ) {
push_text("x");
push_int(THIS->rect.x);
push_text("y");
push_int(THIS->rect.y);
push_text("w");
push_int(THIS->rect.w);
push_text("h");
push_int(THIS->rect.h);
f_aggregate_mapping(8);
}
else
push_undefined();
}
}

#ifdef Rect_event_handler_defined
static void Rect_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Rect_defined
  case PROG_EVENT_INIT: init_Rect_struct(); break;

#endif /* internal_init_Rect_defined */
  default: break; 
  }
}

#endif /* Rect_event_handler_defined */
/*! @endclass Rect */

/*! @class Keysym
 *!
 *! The Keysym class is used to report key presses and releases. It's
 *! available from the @[SDL.Event] class for keyboard events.
 */

#undef class_Keysym_defined
#define class_Keysym_defined
DEFAULT_CMOD_STORAGE struct program *Keysym_program=NULL;

#ifdef Keysym_program_fun_num_used
DEFAULT_CMOD_STORAGE int Keysym_program_fun_num=-1;
#endif /* Keysym_program_fun_num_used */

#undef var_keysym_Keysym_defined
#define var_keysym_Keysym_defined

#undef THIS
#define THIS ((struct Keysym_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_KEYSYM
#define THIS_KEYSYM ((struct Keysym_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_KEYSYM
#define OBJ2_KEYSYM(o) ((struct Keysym_struct *)(o->storage+Keysym_storage_offset))

#undef GET_KEYSYM_STORAGE
#define GET_KEYSYM_STORAGE(o) ((struct Keysym_struct *)(o->storage+Keysym_storage_offset)
static ptrdiff_t Keysym_storage_offset;
struct Keysym_struct {

#ifdef var_keysym_Keysym_defined
#line 495 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
SDL_keysym keysym;
#endif /* var_keysym_Keysym_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Keysym_struct *Keysym_gdb_dummy_ptr;
#endif
/*! @decl int mod
   *!  Current key modifiers
   *!
   *!  @[mod] stores the current state of the keyboard modifiers as
   *!  explained in @[SDL.get_mod_state()].
   */
#define f_Keysym_cq__backtickmod_defined

#ifdef f_Keysym_cq__backtickmod_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Keysym_cq__backtickmod_fun_num = 0;

#endif /* f_Keysym_cq__backtickmod_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Keysym_cq__backtickmod(INT32 args) {
#line 503 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`mod",args,0);
{
push_int(THIS->keysym.mod);
}

}
/*! @decl int scancode
   *!  Hardware specific scancode
   *!
   *!  The @[scancode] field should generally be left alone - it is the
   *!  hardware dependent scancode returned by the keyboard.
   *!
   */
#define f_Keysym_cq__backtickscancode_defined

#ifdef f_Keysym_cq__backtickscancode_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Keysym_cq__backtickscancode_fun_num = 0;

#endif /* f_Keysym_cq__backtickscancode_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Keysym_cq__backtickscancode(INT32 args) {
#line 515 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`scancode",args,0);
{
push_int(THIS->keysym.scancode);
}

}
/*! @decl int sym
   *!  SDL virtual keysym
   *!
   *!  The @[sym] field is extremely useful.
   *!  It is the SDL-defined value of the key.
   *!  This field is very useful when you are checking for certain key presses.
   *!
   */
#define f_Keysym_cq__backticksym_defined

#ifdef f_Keysym_cq__backticksym_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Keysym_cq__backticksym_fun_num = 0;

#endif /* f_Keysym_cq__backticksym_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Keysym_cq__backticksym(INT32 args) {
#line 528 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`sym",args,0);
{
push_int(THIS->keysym.sym);
}

}
/*! @decl int unicode
   *!
   *!  Translated character
   *!
   *!  The @[unicode] field is only used
   *!  when UNICODE translation has beed enabled with @[SDL.enable_unicode()].
   *!  If @[unicode] is non-zero then this the UNICODE character corresponding
   *!  to the keypress.
   *!
   *! @note
   *!  UNICODE translation does have a slight overhead so don't
   *!  enable it unless its needed.
   */
#define f_Keysym_cq__backtickunicode_defined

#ifdef f_Keysym_cq__backtickunicode_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Keysym_cq__backtickunicode_fun_num = 0;

#endif /* f_Keysym_cq__backtickunicode_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Keysym_cq__backtickunicode(INT32 args) {
#line 546 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`unicode",args,0);
{
push_int(THIS->keysym.unicode);
}
}
/*! @endclass Keysym */

#line 554 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#define CHECK_INIT() if(THIS->fmt == NULL) { Pike_error("PixelFormat unitialized!\n"); }

#if !defined(SDL_ALPHA_OPAQUE) || !SDL_ALPHA_OPAQUE
/* SDL 1.1.4 and earlier had inverted alpha.
 * This was changed in 1.1.5, when also
 * SDL_ALPHA_{OPAQUE,TRANSPARENT} were added.
 */
#define CONVERT_ALPHA(X)	(255-(X))
#else
#define CONVERT_ALPHA(X)	(X)
#endif

/*! @class PixelFormat
 *!
 *! This describes the format of the pixel data stored at the pixels field
 *! of a @[SDL.Surface]. Every surface stores a @[PixelFormat] in the format
 *! field.
 */

#undef class_PixelFormat_defined
#define class_PixelFormat_defined
DEFAULT_CMOD_STORAGE struct program *PixelFormat_program=NULL;

#ifdef PixelFormat_program_fun_num_used
DEFAULT_CMOD_STORAGE int PixelFormat_program_fun_num=-1;
#endif /* PixelFormat_program_fun_num_used */
#line 573 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
/* THIS->fmt is never freed by us since the it's always a pointer to that
     of a Surface class */
/* FIXME: What if the Surface is freed?
   *        Ought to use parent pointer!
   */

#undef var_fmt_PixelFormat_defined
#define var_fmt_PixelFormat_defined

#undef THIS
#define THIS ((struct PixelFormat_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_PIXELFORMAT
#define THIS_PIXELFORMAT ((struct PixelFormat_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_PIXELFORMAT
#define OBJ2_PIXELFORMAT(o) ((struct PixelFormat_struct *)(o->storage+PixelFormat_storage_offset))

#undef GET_PIXELFORMAT_STORAGE
#define GET_PIXELFORMAT_STORAGE(o) ((struct PixelFormat_struct *)(o->storage+PixelFormat_storage_offset)
static ptrdiff_t PixelFormat_storage_offset;
struct PixelFormat_struct {

#ifdef var_fmt_PixelFormat_defined
#line 578 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
SDL_PixelFormat *fmt;
#endif /* var_fmt_PixelFormat_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct PixelFormat_struct *PixelFormat_gdb_dummy_ptr;
#endif

#undef internal_init_PixelFormat_defined
#define internal_init_PixelFormat_defined

#undef PixelFormat_event_handler_defined
#define PixelFormat_event_handler_defined
static void init_PixelFormat_struct(void)
#line 580 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
THIS->fmt = NULL;
}

/*! @decl int rloss
   *! @decl int gloss
   *! @decl int bloss
   *! @decl int aloss
   *!   Precision loss of each color component.
   */
#define f_PixelFormat_cq__backtickrloss_defined

#ifdef f_PixelFormat_cq__backtickrloss_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickrloss_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickrloss_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickrloss(INT32 args) {
#line 590 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`rloss",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->fmt->Rloss);
}
}
#define f_PixelFormat_cq__backtickgloss_defined

#ifdef f_PixelFormat_cq__backtickgloss_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickgloss_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickgloss_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickgloss(INT32 args) {
#line 595 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`gloss",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->fmt->Gloss);
}
}
#define f_PixelFormat_cq__backtickbloss_defined

#ifdef f_PixelFormat_cq__backtickbloss_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickbloss_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickbloss_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickbloss(INT32 args) {
#line 600 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`bloss",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->fmt->Bloss);
}
}
#define f_PixelFormat_cq__backtickaloss_defined

#ifdef f_PixelFormat_cq__backtickaloss_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickaloss_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickaloss_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickaloss(INT32 args) {
#line 605 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`aloss",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->fmt->Aloss);
}

}
/*! @decl int rmask
   *! @decl int gmask
   *! @decl int bmask
   *! @decl int amask
   *!   Binary mask used to retrieve individual color values.
   */
#define f_PixelFormat_cq__backtickrmask_defined

#ifdef f_PixelFormat_cq__backtickrmask_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickrmask_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickrmask_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickrmask(INT32 args) {
#line 617 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`rmask",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->fmt->Rmask);
}
}
#define f_PixelFormat_cq__backtickgmask_defined

#ifdef f_PixelFormat_cq__backtickgmask_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickgmask_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickgmask_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickgmask(INT32 args) {
#line 622 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`gmask",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->fmt->Gmask);
}
}
#define f_PixelFormat_cq__backtickbmask_defined

#ifdef f_PixelFormat_cq__backtickbmask_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickbmask_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickbmask_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickbmask(INT32 args) {
#line 627 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`bmask",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->fmt->Bmask);
}
}
#define f_PixelFormat_cq__backtickamask_defined

#ifdef f_PixelFormat_cq__backtickamask_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickamask_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickamask_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickamask(INT32 args) {
#line 632 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`amask",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->fmt->Amask);
}

}
/*! @decl int rshift
   *! @decl int gshift
   *! @decl int bshift
   *! @decl int ashift
   *!  Binary left shift of each color component in the pixel value.
   */
#define f_PixelFormat_cq__backtickrshift_defined

#ifdef f_PixelFormat_cq__backtickrshift_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickrshift_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickrshift_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickrshift(INT32 args) {
#line 644 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`rshift",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->fmt->Rshift);
}
}
#define f_PixelFormat_cq__backtickgshift_defined

#ifdef f_PixelFormat_cq__backtickgshift_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickgshift_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickgshift_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickgshift(INT32 args) {
#line 649 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`gshift",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->fmt->Gshift);
}
}
#define f_PixelFormat_cq__backtickbshift_defined

#ifdef f_PixelFormat_cq__backtickbshift_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickbshift_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickbshift_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickbshift(INT32 args) {
#line 654 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`bshift",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->fmt->Bshift);
}
}
#define f_PixelFormat_cq__backtickashift_defined

#ifdef f_PixelFormat_cq__backtickashift_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickashift_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickashift_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickashift(INT32 args) {
#line 659 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`ashift",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->fmt->Ashift);
}

}
/*! @decl int alpha
   *!  Overall surface alpha value.
   */
#define f_PixelFormat_cq__backtickalpha_defined

#ifdef f_PixelFormat_cq__backtickalpha_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickalpha_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickalpha_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickalpha(INT32 args) {
#line 668 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`alpha",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(CONVERT_ALPHA(THIS->fmt->alpha));
}

}
/*! @decl int colorkey
   *!  Pixel value of transparent pixels.
   */
#define f_PixelFormat_cq__backtickcolorkey_defined

#ifdef f_PixelFormat_cq__backtickcolorkey_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickcolorkey_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickcolorkey_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickcolorkey(INT32 args) {
#line 677 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`colorkey",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->fmt->colorkey);
}

}
/*! @decl int bits_per_pixel
   *!   The number of bits used to represent each pixel in a
   *!   surface. Usually 8, 16, 24 or 32.
   */
#define f_PixelFormat_cq__backtickbits_per_pixel_defined

#ifdef f_PixelFormat_cq__backtickbits_per_pixel_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickbits_per_pixel_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickbits_per_pixel_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickbits_per_pixel(INT32 args) {
#line 687 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`bits_per_pixel",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->fmt->BitsPerPixel);
}

}
/*! @decl int bytes_per_pixel
   *!   The number of bytes used to represent each pixel in a
   *!   surface. Usually one to four.
   */
#define f_PixelFormat_cq__backtickbytes_per_pixel_defined

#ifdef f_PixelFormat_cq__backtickbytes_per_pixel_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_cq__backtickbytes_per_pixel_fun_num = 0;

#endif /* f_PixelFormat_cq__backtickbytes_per_pixel_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_cq__backtickbytes_per_pixel(INT32 args) {
#line 697 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`bytes_per_pixel",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->fmt->BytesPerPixel);
}

}
/*! @decl array(int) losses()
   *!  Convenience method returning the RGBA precision loss as an array.
   */
#define f_PixelFormat_losses_defined

#ifdef f_PixelFormat_losses_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_losses_fun_num = 0;

#endif /* f_PixelFormat_losses_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_losses(INT32 args) {
#line 706 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("losses",args,0);
#line 706 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
push_int(THIS->fmt->Rloss);
push_int(THIS->fmt->Gloss);
push_int(THIS->fmt->Bloss);
push_int(THIS->fmt->Aloss);
f_aggregate(4);
}

}
/*! @decl array(int) masks()
   *!  Convenience method returning the RGBA masks as an array.
   */
#define f_PixelFormat_masks_defined

#ifdef f_PixelFormat_masks_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_masks_fun_num = 0;

#endif /* f_PixelFormat_masks_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_masks(INT32 args) {
#line 717 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("masks",args,0);
#line 717 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
push_int(THIS->fmt->Rmask);
push_int(THIS->fmt->Gmask);
push_int(THIS->fmt->Bmask);
push_int(THIS->fmt->Amask);
f_aggregate(4);
}

}
/*! @decl array(int) shifts()
   *!  Convenience method returning the RGBA shifts as an array.
   */
#define f_PixelFormat_shifts_defined

#ifdef f_PixelFormat_shifts_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_shifts_fun_num = 0;

#endif /* f_PixelFormat_shifts_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_shifts(INT32 args) {
#line 728 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("shifts",args,0);
#line 728 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
push_int(THIS->fmt->Rshift);
push_int(THIS->fmt->Gshift);
push_int(THIS->fmt->Bshift);
push_int(THIS->fmt->Ashift);
f_aggregate(4);
}

}
/*! @decl int map_rgb(int r, int g, int b)
   *! @decl int map_rgb(Image.Color.Color color)
   *!
   *! Maps the RGB color value to the specified pixel format and
   *! returns the pixel value as an integer.
   *!
   *! If the format has a palette (8-bit) the index of the closest
   *! matching color in the palette will be returned.
   *!
   *! If the pixel format has an alpha component it will be
   *! returned as all 1 bits (fully opaque).
   *!
   *! @param r
   *! @param g
   *! @param b
   *!
   *! The red, green and blue components specified as an integer
   *! between 0 and 255.
   *!
   *! @param color
   *! The color as represented by an @[Image.Color.Color] object.
   *! @returns
   *! A pixel value best approximating the given RGB color value for a
   *! given pixel format.
   *!
   *! @seealso
   *!   @[map_rgba()], @[get_rgb()], @[get_rgba()]
   */
#define f_PixelFormat_map_rgb_1_defined

#ifdef f_PixelFormat_map_rgb_1_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_map_rgb_1_fun_num = 0;

#endif /* f_PixelFormat_map_rgb_1_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_map_rgb_1(INT32 args) {
#line 764 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE r;
#line 764 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE g;
#line 764 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE b;
#line 764 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 3) wrong_number_of_args_error("map_rgb",args,3);
#line 764 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-3]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("map_rgb",1,"int");
#line 764 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
r=Pike_sp[0-3].u.integer;
#line 764 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-3]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("map_rgb",2,"int");
#line 764 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
g=Pike_sp[1-3].u.integer;
#line 764 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[2-3]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("map_rgb",3,"int");
#line 764 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
b=Pike_sp[2-3].u.integer;
#line 764 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_MapRGB(THIS->fmt, r, g, b)); pop_n_elems(3); push_int(ret_); return; }while(0);
#line 766 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
#define f_PixelFormat_map_rgb_2_defined

#ifdef f_PixelFormat_map_rgb_2_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_map_rgb_2_fun_num = 0;

#endif /* f_PixelFormat_map_rgb_2_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_map_rgb_2(INT32 args) {
#line 768 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * color;
#line 768 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("map_rgb",args,1);
#line 768 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("map_rgb",1,"object");
#line 768 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(color=Pike_sp[0-1].u.object);
#line 768 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
struct color_struct *cs;
CHECK_CLASS(color, image_color, 1);
cs = ((struct color_struct *)(color->storage));
do { INT_TYPE ret_=(SDL_MapRGB(THIS->fmt, cs->rgb.r, cs->rgb.g, cs->rgb.b)); pop_stack(); push_int(ret_); return; }while(0);
#line 773 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}

#if defined(f_PixelFormat_map_rgb_1_defined) || defined(f_PixelFormat_map_rgb_2_defined)
#define f_PixelFormat_map_rgb_defined

#ifdef PixelFormat_f_PixelFormat_map_rgb_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t PixelFormat_f_PixelFormat_map_rgb_fun_num = 0;

#endif /* PixelFormat_f_PixelFormat_map_rgb_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_map_rgb(INT32 args) {
  switch(args) {
   case 1:

#ifdef f_PixelFormat_map_rgb_2_defined
    f_PixelFormat_map_rgb_2(args);
    return;

#endif /* f_PixelFormat_map_rgb_2_defined */
    break;
   case 3:

#ifdef f_PixelFormat_map_rgb_1_defined
    f_PixelFormat_map_rgb_1(args);
    return;

#endif /* f_PixelFormat_map_rgb_1_defined */
    break;
   default:
    wrong_number_of_args_error("map_rgb",args,1);
  }
}

#endif /* f_PixelFormat_map_rgb_1_defined, f_PixelFormat_map_rgb_2_defined */
/*! @decl int map_rgba(int r, int g, int b, int a)
   *! @decl int map_rgba(Image.Color.Color color, int a)
   *!
   *! Maps the RGBA color value to the specified pixel format and
   *! returns the pixel value as an integer.
   *!
   *! If the format has a palette (8-bit) the index of the closest
   *! matching color in the palette will be returned.
   *!
   *! If the pixel format has an alpha component it will be
   *! returned as all 1 bits (fully opaque).
   *!
   *! @param r
   *! @param g
   *! @param b
   *! @param a
   *!
   *! The red, green and blue components specified as an integer
   *! between 0 and 255.
   *!
   *! @param color
   *! The color as represented by an @[Image.Color.Color] object.
   *!
   *! @returns
   *! A pixel value best approximating the given RGB color value for a
   *! given pixel format.
   *!
   *! @seealso
   *!   @[map_rgb()], @[get_rgb()], @[get_rgba()]
   */
#define f_PixelFormat_map_rgba_1_defined

#ifdef f_PixelFormat_map_rgba_1_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_map_rgba_1_fun_num = 0;

#endif /* f_PixelFormat_map_rgba_1_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_map_rgba_1(INT32 args) {
#line 805 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE r;
#line 805 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE g;
#line 805 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE b;
#line 805 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE a;
#line 805 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 4) wrong_number_of_args_error("map_rgba",args,4);
#line 805 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("map_rgba",1,"int");
#line 805 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
r=Pike_sp[0-4].u.integer;
#line 805 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("map_rgba",2,"int");
#line 805 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
g=Pike_sp[1-4].u.integer;
#line 805 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[2-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("map_rgba",3,"int");
#line 805 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
b=Pike_sp[2-4].u.integer;
#line 805 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[3-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("map_rgba",4,"int");
#line 805 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
a=Pike_sp[3-4].u.integer;
#line 805 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_MapRGBA(THIS->fmt, r, g, b, CONVERT_ALPHA(a))); pop_n_elems(4); push_int(ret_); return; }while(0);
#line 807 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
#define f_PixelFormat_map_rgba_2_defined

#ifdef f_PixelFormat_map_rgba_2_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_map_rgba_2_fun_num = 0;

#endif /* f_PixelFormat_map_rgba_2_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_map_rgba_2(INT32 args) {
#line 809 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * color;
#line 809 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE a;
#line 809 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 2) wrong_number_of_args_error("map_rgba",args,2);
#line 809 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-2]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("map_rgba",1,"object");
#line 809 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(color=Pike_sp[0-2].u.object);
#line 809 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("map_rgba",2,"int");
#line 809 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
a=Pike_sp[1-2].u.integer;
#line 809 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
struct color_struct *cs;
CHECK_CLASS(color, image_color, 1);
cs = ((struct color_struct *)(color->storage));
do { INT_TYPE ret_=(SDL_MapRGBA(THIS->fmt, cs->rgb.r, cs->rgb.g, cs->rgb.b,
CONVERT_ALPHA(a))); pop_n_elems(2); push_int(ret_); return; }while(0);
#line 815 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}

#if defined(f_PixelFormat_map_rgba_1_defined) || defined(f_PixelFormat_map_rgba_2_defined)
#define f_PixelFormat_map_rgba_defined

#ifdef PixelFormat_f_PixelFormat_map_rgba_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t PixelFormat_f_PixelFormat_map_rgba_fun_num = 0;

#endif /* PixelFormat_f_PixelFormat_map_rgba_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_map_rgba(INT32 args) {
  switch(args) {
   case 2:

#ifdef f_PixelFormat_map_rgba_2_defined
    f_PixelFormat_map_rgba_2(args);
    return;

#endif /* f_PixelFormat_map_rgba_2_defined */
    break;
   case 4:

#ifdef f_PixelFormat_map_rgba_1_defined
    f_PixelFormat_map_rgba_1(args);
    return;

#endif /* f_PixelFormat_map_rgba_1_defined */
    break;
   default:
    wrong_number_of_args_error("map_rgba",args,2);
  }
}

#endif /* f_PixelFormat_map_rgba_1_defined, f_PixelFormat_map_rgba_2_defined */
/*! @decl Image.Color.Color get_rgb(int pixel)
   *!
   *! Get RGB component values from a pixel stored in this pixel format.
   *!
   *! @param pixel
   *!   A pixel retrieved from a surface with this pixel format or a color
   *!   previously mapped with @[map_rgb()] or @[map_rgba()].
   *! @returns
   *!  A @[Image.Color.Color] object with the RGB components of the pixel.
   *!
   *! @seealso
   *!   @[map_rgb()], @[map_rgba()], @[get_rgba()]
   */
#define f_PixelFormat_get_rgb_defined

#ifdef f_PixelFormat_get_rgb_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_get_rgb_fun_num = 0;

#endif /* f_PixelFormat_get_rgb_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_get_rgb(INT32 args) {
#line 830 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE pixel;
#line 830 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("get_rgb",args,1);
#line 830 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("get_rgb",1,"int");
#line 830 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
pixel=Pike_sp[0-1].u.integer;
#line 830 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
Uint8 r, g, b;
SDL_GetRGB((Uint32)pixel, THIS->fmt, &r, &g, &b);
do { struct object * ret_=(image_make_rgb_color(r, g, b)); pop_stack(); push_object(ret_); return; }while(0);
#line 834 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl mapping(string:Image.Color.Color|int) get_rgba(int pixel)
   *!
   *! Get RGB component values from a pixel stored in this pixel format.
   *!
   *! @param pixel
   *!   A pixel retrieved from a surface with this pixel format or a color
   *!   previously mapped with @[map_rgb()] or @[map_rgba()].
   *!
   *! @returns
   *!   A mapping containing the RGBA components of the pixel:
   *!   @mapping
   *!     @member Image.Color.Color "color"
   *!       The RGB color value of the pixel.
   *!     @member int "alpha"
   *!       The alpha value of the pixel in the range 0-255.
   *!   @endmapping
   *!
   *! @seealso
   *!   @[map_rgb()], @[map_rgba()], @[get_rgb()]
   */
#define f_PixelFormat_get_rgba_defined

#ifdef f_PixelFormat_get_rgba_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_PixelFormat_get_rgba_fun_num = 0;

#endif /* f_PixelFormat_get_rgba_fun_num_used */
DEFAULT_CMOD_STORAGE void f_PixelFormat_get_rgba(INT32 args) {
#line 856 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE pixel;
#line 856 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("get_rgba",args,1);
#line 856 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("get_rgba",1,"int");
#line 856 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
pixel=Pike_sp[0-1].u.integer;
#line 856 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
Uint8 r, g, b, a;
SDL_GetRGBA((Uint32)pixel, THIS->fmt, &r, &g, &b, &a);
pop_n_elems(args);
push_text("color");
push_object(image_make_rgb_color(r, g, b));
push_text("alpha");
push_int(CONVERT_ALPHA(a));
f_aggregate_mapping(4);
}
}

#ifdef PixelFormat_event_handler_defined
static void PixelFormat_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_PixelFormat_defined
  case PROG_EVENT_INIT: init_PixelFormat_struct(); break;

#endif /* internal_init_PixelFormat_defined */
  default: break; 
  }
}

#endif /* PixelFormat_event_handler_defined */
/*! @endclass PixelFormat */
#line 868 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#undef CHECK_INIT


#define CHECK_INIT() if((THIS->generation != video_generation) || (THIS->vidinfo == NULL)) { Pike_error("VideoInfo unitialized!\n"); }

/*! @class VideoInfo
 *!
 *! This (read-only) class is returned by @[SDL.get_video_info()]. It
 *! contains information on either the 'best' available mode (if
 *! called before @[SDL.set_video_mode()]) or the current video mode.
 *!
 */

#undef class_VideoInfo_defined
#define class_VideoInfo_defined
DEFAULT_CMOD_STORAGE struct program *VideoInfo_program=NULL;

#ifdef VideoInfo_program_fun_num_used
DEFAULT_CMOD_STORAGE int VideoInfo_program_fun_num=-1;
#endif /* VideoInfo_program_fun_num_used */
#line 881 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
/* THIS->vidinfo is never freed by us since SDL manages that */

#undef var_vidinfo_VideoInfo_defined
#define var_vidinfo_VideoInfo_defined

#undef var_generation_VideoInfo_defined
#define var_generation_VideoInfo_defined

#undef THIS
#define THIS ((struct VideoInfo_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_VIDEOINFO
#define THIS_VIDEOINFO ((struct VideoInfo_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_VIDEOINFO
#define OBJ2_VIDEOINFO(o) ((struct VideoInfo_struct *)(o->storage+VideoInfo_storage_offset))

#undef GET_VIDEOINFO_STORAGE
#define GET_VIDEOINFO_STORAGE(o) ((struct VideoInfo_struct *)(o->storage+VideoInfo_storage_offset)
static ptrdiff_t VideoInfo_storage_offset;
struct VideoInfo_struct {

#ifdef var_vidinfo_VideoInfo_defined
#line 882 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
const SDL_VideoInfo *vidinfo;
#endif /* var_vidinfo_VideoInfo_defined */

#ifdef var_generation_VideoInfo_defined
#line 883 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
int generation;
#endif /* var_generation_VideoInfo_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct VideoInfo_struct *VideoInfo_gdb_dummy_ptr;
#endif

#undef internal_init_VideoInfo_defined
#define internal_init_VideoInfo_defined

#undef VideoInfo_event_handler_defined
#define VideoInfo_event_handler_defined
static void init_VideoInfo_struct(void)
#line 885 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
THIS->vidinfo = NULL;
THIS->generation = video_generation;
}

/*! @decl int blit_fill
   *!   Are color fills accelerated?
   */
#define f_VideoInfo_cq__backtickblit_fill_defined

#ifdef f_VideoInfo_cq__backtickblit_fill_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_VideoInfo_cq__backtickblit_fill_fun_num = 0;

#endif /* f_VideoInfo_cq__backtickblit_fill_fun_num_used */
DEFAULT_CMOD_STORAGE void f_VideoInfo_cq__backtickblit_fill(INT32 args) {
#line 893 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`blit_fill",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->vidinfo->blit_fill);
}
}
/*! @decl int blit_hw
   *!   Are hardware to hardware blits accelerated?
   */
#define f_VideoInfo_cq__backtickblit_hw_defined

#ifdef f_VideoInfo_cq__backtickblit_hw_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_VideoInfo_cq__backtickblit_hw_fun_num = 0;

#endif /* f_VideoInfo_cq__backtickblit_hw_fun_num_used */
DEFAULT_CMOD_STORAGE void f_VideoInfo_cq__backtickblit_hw(INT32 args) {
#line 901 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`blit_hw",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->vidinfo->blit_hw);
}
}
/*! @decl int blit_hw_a
   *!   Are hardware to hardware alpha blits accelerated?
   */
#define f_VideoInfo_cq__backtickblit_hw_a_defined

#ifdef f_VideoInfo_cq__backtickblit_hw_a_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_VideoInfo_cq__backtickblit_hw_a_fun_num = 0;

#endif /* f_VideoInfo_cq__backtickblit_hw_a_fun_num_used */
DEFAULT_CMOD_STORAGE void f_VideoInfo_cq__backtickblit_hw_a(INT32 args) {
#line 909 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`blit_hw_a",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->vidinfo->blit_hw_A);
}
}
/*! @decl int blit_hw_cc
   *!   Are hardware to hardware colorkey blits accelerated?
   */
#define f_VideoInfo_cq__backtickblit_hw_cc_defined

#ifdef f_VideoInfo_cq__backtickblit_hw_cc_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_VideoInfo_cq__backtickblit_hw_cc_fun_num = 0;

#endif /* f_VideoInfo_cq__backtickblit_hw_cc_fun_num_used */
DEFAULT_CMOD_STORAGE void f_VideoInfo_cq__backtickblit_hw_cc(INT32 args) {
#line 917 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`blit_hw_cc",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->vidinfo->blit_hw_CC);
}
}
/*! @decl int blit_sw
   *!   Are software to hardware blits accelerated?
   */
#define f_VideoInfo_cq__backtickblit_sw_defined

#ifdef f_VideoInfo_cq__backtickblit_sw_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_VideoInfo_cq__backtickblit_sw_fun_num = 0;

#endif /* f_VideoInfo_cq__backtickblit_sw_fun_num_used */
DEFAULT_CMOD_STORAGE void f_VideoInfo_cq__backtickblit_sw(INT32 args) {
#line 925 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`blit_sw",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->vidinfo->blit_sw);
}
}
/*! @decl int blit_sw_a
   *!   Are software to hardware alpha blits accelerated?
   */
#define f_VideoInfo_cq__backtickblit_sw_a_defined

#ifdef f_VideoInfo_cq__backtickblit_sw_a_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_VideoInfo_cq__backtickblit_sw_a_fun_num = 0;

#endif /* f_VideoInfo_cq__backtickblit_sw_a_fun_num_used */
DEFAULT_CMOD_STORAGE void f_VideoInfo_cq__backtickblit_sw_a(INT32 args) {
#line 933 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`blit_sw_a",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->vidinfo->blit_sw_A);
}
}
/*! @decl int blit_sw_cc
   *!   Are software to hardware colorkey blits accelerated?
   */
#define f_VideoInfo_cq__backtickblit_sw_cc_defined

#ifdef f_VideoInfo_cq__backtickblit_sw_cc_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_VideoInfo_cq__backtickblit_sw_cc_fun_num = 0;

#endif /* f_VideoInfo_cq__backtickblit_sw_cc_fun_num_used */
DEFAULT_CMOD_STORAGE void f_VideoInfo_cq__backtickblit_sw_cc(INT32 args) {
#line 941 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`blit_sw_cc",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->vidinfo->blit_sw_CC);
}
}
/*! @decl int hw_available
   *!   Is it possible to create hardware surfaces?
   */
#define f_VideoInfo_cq__backtickhw_available_defined

#ifdef f_VideoInfo_cq__backtickhw_available_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_VideoInfo_cq__backtickhw_available_fun_num = 0;

#endif /* f_VideoInfo_cq__backtickhw_available_fun_num_used */
DEFAULT_CMOD_STORAGE void f_VideoInfo_cq__backtickhw_available(INT32 args) {
#line 949 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`hw_available",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->vidinfo->hw_available);
}
}
/*! @decl int video_mem
   *!   Total amount of video memory in KB.
   */
#define f_VideoInfo_cq__backtickvideo_mem_defined

#ifdef f_VideoInfo_cq__backtickvideo_mem_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_VideoInfo_cq__backtickvideo_mem_fun_num = 0;

#endif /* f_VideoInfo_cq__backtickvideo_mem_fun_num_used */
DEFAULT_CMOD_STORAGE void f_VideoInfo_cq__backtickvideo_mem(INT32 args) {
#line 957 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`video_mem",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->vidinfo->video_mem);
}
}
/*! @decl int wm_available
   *!   Is there a window manager available
   */
#define f_VideoInfo_cq__backtickwm_available_defined

#ifdef f_VideoInfo_cq__backtickwm_available_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_VideoInfo_cq__backtickwm_available_fun_num = 0;

#endif /* f_VideoInfo_cq__backtickwm_available_fun_num_used */
DEFAULT_CMOD_STORAGE void f_VideoInfo_cq__backtickwm_available(INT32 args) {
#line 965 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`wm_available",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->vidinfo->wm_available);
}
}
/*! @decl SDL.PixelFormat format
   *!   Pixel format of the video device.
   */
#define f_VideoInfo_cq__backtickformat_defined

#ifdef f_VideoInfo_cq__backtickformat_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_VideoInfo_cq__backtickformat_fun_num = 0;

#endif /* f_VideoInfo_cq__backtickformat_fun_num_used */
DEFAULT_CMOD_STORAGE void f_VideoInfo_cq__backtickformat(INT32 args) {
#line 973 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`format",args,0);
{
struct object *fmt;
CHECK_INIT(); /* Make sure this is inited */
fmt = clone_object(PixelFormat_program, 0);
OBJ2_PIXELFORMAT(fmt)->fmt = THIS->vidinfo->vfmt;
push_object(fmt);
}
}

#ifdef VideoInfo_event_handler_defined
static void VideoInfo_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_VideoInfo_defined
  case PROG_EVENT_INIT: init_VideoInfo_struct(); break;

#endif /* internal_init_VideoInfo_defined */
  default: break; 
  }
}

#endif /* VideoInfo_event_handler_defined */
/*! @endclass VideoInfo */
#line 983 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#undef CHECK_INIT

#define CHECK_INIT() if((THIS->generation != video_generation) || (THIS->_s == NULL)) { Pike_error("Surface unitialized!\n"); }
/*! @class Surface
 *!
 *! Surface's represent areas of "graphical" memory, memory that can
 *! be drawn to.  The video framebuffer is returned as a
 *! @[SDL.Surface] by @[SDL.set_video_mode()] and
 *! @[SDL.get_video_surface()].
 */

#undef class_Surface_defined
#define class_Surface_defined
DEFAULT_CMOD_STORAGE struct program *Surface_program=NULL;

#ifdef Surface_program_fun_num_used
DEFAULT_CMOD_STORAGE int Surface_program_fun_num=-1;
#endif /* Surface_program_fun_num_used */

#undef var_cq__s_Surface_defined
#define var_cq__s_Surface_defined

#undef var_void_Surface_defined
#define var_void_Surface_defined

#undef var_generation_Surface_defined
#define var_generation_Surface_defined

#undef THIS
#define THIS ((struct Surface_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_SURFACE
#define THIS_SURFACE ((struct Surface_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_SURFACE
#define OBJ2_SURFACE(o) ((struct Surface_struct *)(o->storage+Surface_storage_offset))

#undef GET_SURFACE_STORAGE
#define GET_SURFACE_STORAGE(o) ((struct Surface_struct *)(o->storage+Surface_storage_offset)
static ptrdiff_t Surface_storage_offset;
struct Surface_struct {

#ifdef var_cq__s_Surface_defined
#line 994 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
SDL_Surface *_s;
#endif /* var_cq__s_Surface_defined */

#ifdef var_void_Surface_defined
#line 995 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
void (*fast_set_pixel)(Uint16 x, Uint16 y, Uint32 pixel);
#endif /* var_void_Surface_defined */

#ifdef var_generation_Surface_defined
#line 996 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
int generation;
#endif /* var_generation_Surface_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Surface_struct *Surface_gdb_dummy_ptr;
#endif
#line 998 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
static void fast_set_pixel1(Uint16 x, Uint16 y, Uint32 pixel) {
SDL_Surface *screen = THIS->_s;
*((Uint8 *)screen->pixels + y * screen->pitch + x) = pixel;
}
static void fast_set_pixel2(Uint16 x, Uint16 y, Uint32 pixel) {
SDL_Surface *screen = THIS->_s;
*((Uint16 *)screen->pixels + y * (screen->pitch>>1) + x) = pixel;
}
static void fast_set_pixel3(Uint16 x, Uint16 y, Uint32 pixel) {
SDL_Surface *screen = THIS->_s;
Uint8 *pix = (Uint8 *)screen->pixels + y * screen->pitch + x * 3;
if(SDL_BYTEORDER == SDL_BIG_ENDIAN) {
pix[2] = pixel & 0xff;
pix[1] = (pixel >> 8) & 0xff;
pix[0] = (pixel >> 16) & 0xff;
} else {
pix[0] = pixel;
pix[1] = (pixel >> 8) & 0xff;
pix[2] = (pixel >> 16) & 0xff;
}
}
static void fast_set_pixel4(Uint16 x, Uint16 y, Uint32 pixel) {
SDL_Surface *screen = THIS->_s;
*((Uint32 *)screen->pixels + y * (screen->pitch>>2) + x) = pixel;
}
static void (*get_fast_set_pixel(int bpp))(Uint16 x, Uint16 y, Uint32 pixel)
{
switch(bpp) {
case 1: return &fast_set_pixel1;
case 2: return &fast_set_pixel2;
case 3: return &fast_set_pixel3;
case 4: return &fast_set_pixel4;
}
return NULL;
}

/*! @decl int get_pixel(int x, int y)
   *! Get the value of the specified pixel. The surface needs to be
   *! locked before this method can be used.
   *! @param x
   *! @param y
   *!  Pixel coordinate to get.
   *! @returns
   *!   The value of the specified pixel.
   *! @seealso
   *!  @[set_pixel()], @[unlock()], @[lock()]
   */
#define f_Surface_get_pixel_defined

#ifdef f_Surface_get_pixel_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_get_pixel_fun_num = 0;

#endif /* f_Surface_get_pixel_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_get_pixel(INT32 args) {
#line 1045 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE x;
#line 1045 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE y;
#line 1045 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 2) wrong_number_of_args_error("get_pixel",args,2);
#line 1045 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("get_pixel",1,"int");
#line 1045 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
x=Pike_sp[0-2].u.integer;
#line 1045 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("get_pixel",2,"int");
#line 1045 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
y=Pike_sp[1-2].u.integer;
{
CHECK_INIT();
if(THIS->fast_set_pixel) {
SDL_Surface *surface = THIS->_s;
int bpp = surface->format->BytesPerPixel;
Uint8 *p;
if(x < 0 || y < 0 || x > surface->w || y > surface->h) {
Pike_error("Pixel out of bounds!\n");
}
p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp;

switch(bpp) {
case 1: do { INT_TYPE ret_=(*p); pop_n_elems(2); push_int(ret_); return; }while(0);
#line 1059 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
case 2: do { INT_TYPE ret_=(*(Uint16 *)p); pop_n_elems(2); push_int(ret_); return; }while(0);
#line 1060 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
case 3:
if(SDL_BYTEORDER == SDL_BIG_ENDIAN) {
do { INT_TYPE ret_=(p[0] << 16 | p[1] << 8 | p[2]); pop_n_elems(2); push_int(ret_); return; }while(0);
#line 1063 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
} else {
do { INT_TYPE ret_=(p[0] | p[1] << 8 | p[2] << 16); pop_n_elems(2); push_int(ret_); return; }while(0);
#line 1065 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}
case 4: do { INT_TYPE ret_=(*(Uint32 *)p); pop_n_elems(2); push_int(ret_); return; }while(0);
#line 1067 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
default: do { INT_TYPE ret_=(0); pop_n_elems(2); push_int(ret_); return; }while(0);/* shouldn't happen, but avoids warnings */
}
} else {
Pike_error("Surface must be locked before you can set or get pixels.\n");
}
}

}
/*! @decl int set_pixel(int x, int y, int pixel)
   *! Set the value of the specified pixel. The surface needs to be
   *! locked before this method can be used.
   *! @param x
   *! @param y
   *!  Pixel coordinate to modify.
   *! @param pixel
   *!  Pixel value to set to the specified pixel.
   *! @returns
   *!   A reference to the surface itself.
   *! @seealso
   *!  @[get_pixel()], @[unlock()], @[lock()]
   */
#define f_Surface_set_pixel_defined

#ifdef f_Surface_set_pixel_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_set_pixel_fun_num = 0;

#endif /* f_Surface_set_pixel_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_set_pixel(INT32 args) {
#line 1087 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE x;
#line 1087 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE y;
#line 1087 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE pixel;
#line 1087 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 3) wrong_number_of_args_error("set_pixel",args,3);
#line 1087 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-3]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("set_pixel",1,"int");
#line 1087 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
x=Pike_sp[0-3].u.integer;
#line 1087 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-3]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("set_pixel",2,"int");
#line 1087 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
y=Pike_sp[1-3].u.integer;
#line 1087 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[2-3]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("set_pixel",3,"int");
#line 1087 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
pixel=Pike_sp[2-3].u.integer;
#line 1087 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT();
if(THIS->fast_set_pixel) {
if(x < 0 || y < 0 || x > THIS->_s->w || y > THIS->_s->h) {
Pike_error("Pixel out of bounds!\n");
}
THIS->fast_set_pixel(x, y, pixel);
RET_THIS();
}
Pike_error("Surface must be locked before you can set or get pixels.\n");
}

}

#undef internal_init_Surface_defined
#define internal_init_Surface_defined

#undef Surface_event_handler_defined
#define Surface_event_handler_defined
static void init_Surface_struct(void)
#line 1099 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
THIS->_s = NULL;
THIS->fast_set_pixel = NULL;
THIS->generation = video_generation;
}


#undef internal_exit_Surface_defined
#define internal_exit_Surface_defined

#undef Surface_event_handler_defined
#define Surface_event_handler_defined
static void exit_Surface_struct(void)
#line 1107 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
if((THIS->generation == video_generation) && THIS->_s) {
SDL_FreeSurface(THIS->_s);
THIS->_s = NULL;
}
THIS->fast_set_pixel = NULL;
}

/*! @decl int flags
   *!   The following are supported in the flags field.
   *!   @dl
   *!     @item SDL.SWSURFACE
   *!       Surface is stored in system memory
   *!     @item SDL.HWSURFACE
   *!       Surface is stored in video memory
   *!     @item SDL.ASYNCBLIT
   *!       Surface uses asynchronous blits if possible.
   *!     @item SDL.ANYFORMAT
   *!       Allows any pixel-format (Display  surface).
   *!     @item SDL.HWPALETTE
   *!       Surface has exclusive palette.
   *!     @item SDL.DOUBLEBUF
   *!       Surface is double buffered (Display surface).
   *!     @item SDL.FULLSCREEN
   *!       Surface is full screen (Display  Sur face).
   *!     @item SDL.OPENGL
   *!       Surface has an OpenGL context (Display Surface).
   *!     @item SDL.OPENGLBLIT
   *!       Surface supports OpenGL blitting (Display Surface).
   *!     @item SDL.RESIZABLE
   *!       Surface is resizable (Display Surface).
   *!     @item SDL.HWACCEL
   *!       Surface blit uses hardware acceleration.
   *!     @item SDL.SRCCOLORKEY
   *!       Surface use colorkey blitting.
   *!     @item SDL.RLEACCEL
   *!       Colorkey  blitting is accelerated with RLE.
   *!     @item SDL.SRCALPHA
   *!       Surface blit uses alpha blending.
   *!     @item SDL.PREALLOC
   *!       Surface uses preallocated memory.
   *!   @enddl
   */
#define f_Surface_cq__backtickflags_defined

#ifdef f_Surface_cq__backtickflags_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_cq__backtickflags_fun_num = 0;

#endif /* f_Surface_cq__backtickflags_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_cq__backtickflags(INT32 args) {
#line 1150 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`flags",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->_s->flags);
}

}
/*! @decl int w
   *! @decl int h
   *!   The width and height of the surface in pixels.
   */
#define f_Surface_cq__backtickh_defined

#ifdef f_Surface_cq__backtickh_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_cq__backtickh_fun_num = 0;

#endif /* f_Surface_cq__backtickh_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_cq__backtickh(INT32 args) {
#line 1160 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`h",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->_s->h);
}
}
#define f_Surface_cq__backtickw_defined

#ifdef f_Surface_cq__backtickw_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_cq__backtickw_fun_num = 0;

#endif /* f_Surface_cq__backtickw_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_cq__backtickw(INT32 args) {
#line 1165 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`w",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->_s->w);
}

}
#line 1171 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#if 0
 #define f_Surface_cq__backtickpitch_defined

#ifdef f_Surface_cq__backtickpitch_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_cq__backtickpitch_fun_num = 0;

#endif /* f_Surface_cq__backtickpitch_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_cq__backtickpitch(INT32 args) {
#line 1172 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`pitch",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->_s->pitch);
}
}
#line 1177 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#endif

/*! @decl SDL.Rect clip_rect
   *!  This is the clipping rectangle as set by @[set_clip_rect()].
   */
#define f_Surface_cq__backtickclip_rect_defined

#ifdef f_Surface_cq__backtickclip_rect_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_cq__backtickclip_rect_fun_num = 0;

#endif /* f_Surface_cq__backtickclip_rect_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_cq__backtickclip_rect(INT32 args) {
#line 1182 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`clip_rect",args,0);
{
struct object *rect;
CHECK_INIT(); /* Make sure this is inited */
rect = clone_object( Rect_program, 0 );
OBJ2_RECT(rect)->rect = THIS->_s->clip_rect;
push_object(rect);
}
}
/*! @decl SDL.PixelFormat format
   *!   The pixel format of this surface.
   */
#define f_Surface_cq__backtickformat_defined

#ifdef f_Surface_cq__backtickformat_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_cq__backtickformat_fun_num = 0;

#endif /* f_Surface_cq__backtickformat_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_cq__backtickformat(INT32 args) {
#line 1193 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`format",args,0);
{
struct object *fmt;
CHECK_INIT(); /* Make sure this is inited */
fmt = clone_object( PixelFormat_program, 0 );
OBJ2_PIXELFORMAT(fmt)->fmt = THIS->_s->format;
push_object(fmt);
}


}
/*! @decl int lock()
   *!
   *! This methods locks the surface to allow direct access to the pixels
   *! using the @[get_pixel()] and @[set_pixel()] methods.
   *!
   *! @note
   *!   Note that although all surfaces in SDL don't require locking,
   *!   you still need to call this method to enable the set/get pixel
   *!   methods. You should unlock the surface when you're doing modifying it.
   *!
   *! @note
   *!   Calling this method multiple times means that you need to call
   *!   unlock an equal number of times for the surface to become unlocked.
   *! @returns
   *!   1 for success or 0 if the surface couldn't be locked.
   *! @seealso
   *!  @[unlock()], @[set_pixel()], @[get_pixel()]
   */
#define f_Surface_lock_defined

#ifdef f_Surface_lock_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_lock_fun_num = 0;

#endif /* f_Surface_lock_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_lock(INT32 args) {
#line 1221 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("lock",args,0);
#line 1221 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
int locked = 1;
CHECK_INIT();
if ( SDL_MUSTLOCK(THIS->_s) ) {
locked = SDL_LockSurface(THIS->_s) != -1;
}
if(locked) {
THIS->fast_set_pixel = get_fast_set_pixel(THIS->_s->format->BytesPerPixel);
}
do { INT_TYPE ret_=(locked);  push_int(ret_); return; }while(0);
#line 1231 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl void unlock()
   *!
   *! Surfaces that were previously locked using @[lock()] must be
   *! unlocked with @[unlock()].
   *!
   *! Surfaces should be unlocked as soon as possible.
   *!
   *! @seealso
   *!  @[lock()]
   */
#define f_Surface_unlock_defined

#ifdef f_Surface_unlock_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_unlock_fun_num = 0;

#endif /* f_Surface_unlock_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_unlock(INT32 args) {
#line 1243 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("unlock",args,0);
#line 1243 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT();
THIS->fast_set_pixel = NULL;
if ( SDL_MUSTLOCK(THIS->_s) ) {
SDL_UnlockSurface(THIS->_s);
}
}

}
/*! @decl SDL.Surface init(int flags, int width, int height, int depth, @
   *!                        int Rmask, int Gmask, int Bmask, int Amask)
   *!
   *! This (re)initializes this surface using the specified
   *! parameters.
   *!
   *! Any previously allocated data will be freed.
   *!
   *! @param depth
   *! @param Rmask
   *! @param Gmask
   *! @param Bmask
   *! @param Amask
   *!   If @[depth] is 8 bits an empty palette is allocated for the surface,
   *!   otherwise a 'packed-pixel' @[SDL.PixelFormat] is created using
   *!   the @b{[RGBA]mask@}'s provided.
   *!
   *! @param width
   *! @param height
   *!   @[width] and @[height] specify the desired size of the image.
   *!
   *! @param flags
   *!   @[flags] specifies the type of surface that should be created.
   *!   It is an OR'd combination of the following possible values:
   *!
   *! @dl
   *!   @item SDL.SWSURFACE
   *!     SDL will create the surface in system memory. This improves
   *!     the performance of pixel level access, however you may not
   *!     be able to take advantage of some types of hardware
   *!     blitting.
   *!
   *!   @item SDL.HWSURFACE
   *!     SDL will attempt to create the surface in video memory. This
   *!     will allow SDL to take advantage of Video->Video blits
   *!     (which are often accelerated).
   *!
   *!   @item SDL.SRCCOLORKEY
   *!
   *!     This flag turns on colourkeying for blits from this
   *!     surface. If SDL.HWSURFACE is also specified and colourkeyed
   *!     blits are hardware-accelerated, then SDL will attempt to
   *!     place the surface in video memory. Use @[set_color_key()] to
   *!     set or clear this flag after surface creation.
   *!
   *!   @item SDL.SRCALPHA
   *!     This flag turns on alpha-blending for blits from this
   *!     surface. If SDL.HWSURFACE is also specified and alpha
   *!     blending blits are hardware-accelerated, then the surface
   *!     will be placed in video memory if possible.  Use
   *!     @[set_alpha()] to set or clear this flag after surface
   *!     creation.
   *! @enddl
   *!
   *! @note
   *!   If an alpha-channel is specified (that is, if Amask is
   *!   nonzero), then the SDL.SRCALPHA flag is automatically set. You
   *!   may remove this flag by calling @[set_alpha()] after surface
   *!   creation.
   *!
   *! @returns
   *!  A reference to itself.
   *!
   *! @note
   *!  If this method fails, the surface will become uninitialized.
   *!
   *! @seealso
   *!  @[set_image()]
   */
#define f_Surface_init_defined

#ifdef f_Surface_init_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_init_fun_num = 0;

#endif /* f_Surface_init_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_init(INT32 args) {
#line 1320 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE flags;
#line 1320 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE width;
#line 1320 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE height;
#line 1320 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE depth;
INT_TYPE Rmask;
#line 1321 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE Gmask;
#line 1321 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE Bmask;
#line 1321 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE Amask;
#line 1320 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 8) wrong_number_of_args_error("init",args,8);
#line 1320 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-8]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("init",1,"int");
#line 1320 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
flags=Pike_sp[0-8].u.integer;
#line 1320 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-8]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("init",2,"int");
#line 1320 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
width=Pike_sp[1-8].u.integer;
#line 1320 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[2-8]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("init",3,"int");
#line 1320 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
height=Pike_sp[2-8].u.integer;
#line 1320 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[3-8]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("init",4,"int");
#line 1320 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
depth=Pike_sp[3-8].u.integer;
if(TYPEOF(Pike_sp[4-8]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("init",5,"int");
#line 1321 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
Rmask=Pike_sp[4-8].u.integer;
#line 1321 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[5-8]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("init",6,"int");
#line 1321 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
Gmask=Pike_sp[5-8].u.integer;
#line 1321 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[6-8]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("init",7,"int");
#line 1321 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
Bmask=Pike_sp[6-8].u.integer;
#line 1321 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[7-8]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("init",8,"int");
#line 1321 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
Amask=Pike_sp[7-8].u.integer;
#line 1321 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
if((THIS->generation == video_generation ) && THIS->_s) {
SDL_FreeSurface(THIS->_s);
}
THIS->_s = SDL_CreateRGBSurface(flags, width, height, depth,
Rmask, Gmask, Bmask, Amask);
if(THIS->_s == NULL) {
Pike_error("Failed to create SDL surface: %s\n", SDL_GetError());
} else {
THIS->generation = video_generation;
RET_THIS();
}
}

}
/*!  @decl SDL.Surface set_image(Image.Image image, int|void flags)
   *!  @decl SDL.Surface set_image(Image.Image image, Image.Image alpha, @
   *!                              int|void flags)
   *!
   *! This (re)initializes this surface from the @[Image.Image] in
   *! @[image].
   *!
   *! Any previously allocated data will be freed.
   *!
   *! If initialization is successful, this surface will use @tt{RGBA8888@}
   *! format. For good blitting performance, it should be converted to
   *! the display format using @[display_format()].
   *!
   *! @param image
   *!  The source image.
   *! @param alpha
   *!   Optional alpha channel. In Pike, the alpha channel can have
   *!   different alpha values for red, green and blue. Since SDL
   *!   doesn't support this, only the alpha value of the red color is
   *!   used in the conversion. When this calling convention is used,
   *!   the surface alpha value of @b{image@} is ignored.
   *!
   *! @param flags
   *!   When present this specifies the type of surface that should be
   *!   created. It is an OR'd combination of the following possible
   *!   values:
   *!
   *! @dl
   *!   @item SDL.SWSURFACE
   *!     SDL will create the surface in system memory. This improves
   *!     the performance of pixel level access, however you may not
   *!     be able to take advantage of some types of hardware
   *!     blitting.
   *!
   *!   @item SDL.HWSURFACE
   *!     SDL will attempt to create the surface in video memory. This
   *!     will allow SDL to take advantage of Video->Video blits
   *!     (which are often accelerated).
   *!
   *!   @item SDL.SRCCOLORKEY
   *!     This flag turns on colourkeying for blits from this
   *!     surface. If SDL.HWSURFACE is also specified and colourkeyed
   *!     blits are hardware-accelerated, then SDL will attempt to
   *!     place the surface in video memory. Use @[set_color_key()] to
   *!     set or clear this flag after surface creation.
   *!
   *!   @item SDL.SRCALPHA
   *!     This flag turns on alpha-blending for blits from this
   *!     surface. If SDL.HWSURFACE is also specified and alpha
   *!     blending blits are hardware-accelerated, then the surface
   *!     will be placed in video memory if possible. Note that if
   *!     this surface has an alpha value specified, this flag is
   *!     enabled automatically. Use @[set_alpha()] to modify this
   *!     flag at a later point.
   *! @enddl
   *!
   *! @note
   *!  If this method fails, the surface will become uninitialized.
   *!
   *! @returns
   *!  A reference to itself.
   *!
   *! @seealso
   *!  @[init()]
   */
#define f_Surface_set_image_1_defined

#ifdef f_Surface_set_image_1_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_set_image_1_fun_num = 0;

#endif /* f_Surface_set_image_1_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_set_image_1(INT32 args) {
#line 1400 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * image;
#line 1400 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct svalue * _flags;
#line 1400 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args < 1) wrong_number_of_args_error("set_image_1",args,1);
#line 1400 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args > 2) wrong_number_of_args_error("set_image_1",args,2);
#line 1400 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("set_image",1,"object");
#line 1400 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(image=Pike_sp[0-args].u.object);
#line 1400 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if ((args > 1) &&
    ((TYPEOF(Pike_sp[1-args]) != PIKE_T_INT) ||
     (SUBTYPEOF(Pike_sp[1-args]) != NUMBER_UNDEFINED))) {
#line 1400 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("set_image",2,"int|void");
#line 1400 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
_flags=Pike_sp+1-args; dmalloc_touch_svalue(Pike_sp+1-args);
#line 1400 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
} else _flags = NULL;
#line 1400 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
int flags = 0;
int x, y;
struct image *i;
Uint32 *dest;
rgb_group rgb;
if((THIS->generation == video_generation) && (THIS->_s != NULL)) {
SDL_FreeSurface(THIS->_s);
THIS->_s = NULL;
}
/*    if(image_program != NULL) { */
CHECK_CLASS(image, image, 1);
/*    } */
if(_flags) {
if(TYPEOF(*_flags) != PIKE_T_INT) {
SIMPLE_BAD_ARG_ERROR("set_image",2,"int|void");
}
flags = _flags->u.integer;
}
i = ((struct image *)(image->storage));
if(i->alpha) {
flags &= SDL_SRCALPHA;
}
THIS->_s =
SDL_CreateRGBSurface(flags, i->xsize, i->ysize, 32,
0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff);
if(!THIS->_s) {
Pike_error("Failed to create SDL surface: %s\n", SDL_GetError());
}
THIS->generation = video_generation;
SDL_LockSurface(THIS->_s);
dest = THIS->_s->pixels;

#define pixel(_img,x,y) ((_img)->img[((int)(x))+((int)(y))*(int)(_img)->xsize])
 for(y = 0; y < i->ysize; y++) {
int off = y*THIS->_s->pitch/4;
for(x = 0; x < i->xsize; x++) {
rgb = pixel(i, x, y);
*((Uint32 *)dest + off + x) =
(rgb.r << 24) + (rgb.g << 16) + (rgb.b << 8) +
CONVERT_ALPHA(i->alpha);
}
}
#undef pixel
 SDL_UnlockSurface(THIS->_s);
RET_THIS();
}

}
#define f_Surface_set_image_2_defined

#ifdef f_Surface_set_image_2_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_set_image_2_fun_num = 0;

#endif /* f_Surface_set_image_2_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_set_image_2(INT32 args) {
#line 1448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * image;
#line 1448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * alpha;
#line 1448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct svalue * _flags;
#line 1448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args < 2) wrong_number_of_args_error("set_image_2",args,2);
#line 1448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args > 3) wrong_number_of_args_error("set_image_2",args,3);
#line 1448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("set_image",1,"object");
#line 1448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(image=Pike_sp[0-args].u.object);
#line 1448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("set_image",2,"object");
#line 1448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(alpha=Pike_sp[1-args].u.object);
#line 1448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if ((args > 2) &&
    ((TYPEOF(Pike_sp[2-args]) != PIKE_T_INT) ||
     (SUBTYPEOF(Pike_sp[2-args]) != NUMBER_UNDEFINED))) {
#line 1448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[2-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("set_image",3,"int|void");
#line 1448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
_flags=Pike_sp+2-args; dmalloc_touch_svalue(Pike_sp+2-args);
#line 1448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
} else _flags = NULL;
#line 1448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
int flags = 0;
int x, y;
struct image *i, *a;
Uint32 *dest;
rgb_group rgb, argb;
if((THIS->generation == video_generation) && (THIS->_s != NULL)) {
SDL_FreeSurface(THIS->_s);
THIS->_s = NULL;
}

CHECK_CLASS(image, image, 1);
CHECK_CLASS(alpha, image, 2);

if(_flags) {
if(TYPEOF(*_flags) != PIKE_T_INT) {
SIMPLE_BAD_ARG_ERROR("set_image",3,"int|void");
}
flags = _flags->u.integer;
}
i = ((struct image *)(image->storage));
a = ((struct image *)(alpha->storage));

THIS->_s =
SDL_CreateRGBSurface(flags, i->xsize, i->ysize, 32,
0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff);
if(!THIS->_s) {
Pike_error("Failed to create SDL surface: %s\n", SDL_GetError());
}
THIS->generation = video_generation;
SDL_LockSurface(THIS->_s);
dest = THIS->_s->pixels;

#define pixel(_img,x,y) ((_img)->img[((int)(x))+((int)(y))*(int)(_img)->xsize])
 for(y = 0; y < i->ysize; y++) {
int off = y*THIS->_s->pitch/4;
for(x = 0; x < i->xsize; x++) {
rgb = pixel(i, x, y);
argb = pixel(a, x, y);
*((Uint32 *)dest + off + x) =
(rgb.r << 24) + (rgb.g << 16) + (rgb.b << 8) +
CONVERT_ALPHA(argb.r);
}
}
#undef pixel
 SDL_UnlockSurface(THIS->_s);
RET_THIS();
}

}

#if defined(f_Surface_set_image_1_defined) || defined(f_Surface_set_image_2_defined)
#define f_Surface_set_image_defined

#ifdef Surface_f_Surface_set_image_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t Surface_f_Surface_set_image_fun_num = 0;

#endif /* Surface_f_Surface_set_image_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_set_image(INT32 args) {
  switch(args) {
   case 1:

#ifdef f_Surface_set_image_1_defined
    f_Surface_set_image_1(args);
    return;

#endif /* f_Surface_set_image_1_defined */
    break;
   case 2:
    switch(TYPEOF(Pike_sp[1-2])) {
     case PIKE_T_OBJECT:

#ifdef f_Surface_set_image_2_defined
      f_Surface_set_image_2(args);
      return;

#endif /* f_Surface_set_image_2_defined */
      break;
     case PIKE_T_INT:

#ifdef f_Surface_set_image_1_defined
      f_Surface_set_image_1(args);
      return;

#endif /* f_Surface_set_image_1_defined */
      break;
     default:
      SIMPLE_BAD_ARG_ERROR("set_image",2,"object|int");
    }
   case 3:

#ifdef f_Surface_set_image_2_defined
    f_Surface_set_image_2(args);
    return;

#endif /* f_Surface_set_image_2_defined */
    break;
   default:
    wrong_number_of_args_error("set_image",args,1);
  }
}

#endif /* f_Surface_set_image_1_defined, f_Surface_set_image_2_defined */
/*! @decl SDL.Surface display_format()
   *!
   *! This function takes a surface and copies it to a new  surface
   *! of  the  pixel format and colors of the video framebuffer,
   *! suitable for fast blitting onto the  display  surface. It calls
   *! @[convert_surface()].
   *!
   *! If you want to take advantage of hardware colorkey or alpha blit
   *! acceleration, you should set the colorkey and / or alpha value
   *! before calling this function.
   *!
   *! If you want an alpha channel, see @[display_format_alpha()].
   *!
   *! @returns
   *!   The new surface. An error is thrown if the conversion fails.
   */
#define f_Surface_display_format_defined

#ifdef f_Surface_display_format_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_display_format_fun_num = 0;

#endif /* f_Surface_display_format_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_display_format(INT32 args) {
#line 1513 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("display_format",args,0);
#line 1513 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
SDL_Surface *tmp;
CHECK_INIT();
tmp = SDL_DisplayFormat(THIS->_s);
if(tmp) {
struct object *new_surface = clone_object( Surface_program, 0 );
OBJ2_SURFACE(new_surface)->_s = tmp;
do { struct object * ret_=(new_surface);  push_object(ret_); return; }while(0);
#line 1521 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
} else {
Pike_error("Failed to create SDL surface: %s\n", SDL_GetError());
}
}

}
/*! @decl SDL.Surface display_format_alpha()
   *!
   *! This function takes a surface and copies it to a new  surface
   *! of  the  pixel format and colors of the video framebuffer,
   *! suitable for fast blitting onto the  display  surface. It calls
   *! @[convert_surface()].
   *!
   *! If you want to take advantage of hardware colorkey or alpha blit
   *! acceleration, you should set the colorkey and / or alpha value
   *! before calling this function.
   *!
   *! This function can be used to convert a colourkey to an alpha
   *! channel, if the SDL.SRCCOLORKEY flag is set on the surface. The
   *! generated surface will then be transparent (alpha=0) where the
   *! pixels match the colourkey, and opaque (alpha=255) elsewhere.
   *!
   *! @returns
   *!   The new surface. An error is thrown if the conversion fails.
   */
#define f_Surface_display_format_alpha_defined

#ifdef f_Surface_display_format_alpha_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_display_format_alpha_fun_num = 0;

#endif /* f_Surface_display_format_alpha_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_display_format_alpha(INT32 args) {
#line 1545 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("display_format_alpha",args,0);
#line 1545 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
SDL_Surface *tmp;
CHECK_INIT();
tmp = SDL_DisplayFormatAlpha(THIS->_s);
if(tmp) {
struct object *new_surface = clone_object( Surface_program, 0 );
OBJ2_SURFACE(new_surface)->_s = tmp;
do { struct object * ret_=(new_surface);  push_object(ret_); return; }while(0);
#line 1553 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
} else {
Pike_error("Failed to create SDL surface: %s\n", SDL_GetError());
}
}

}
/*! @decl object blit(SDL.Surface dst, SDL.Rect|void srcrect,@
    *!                   SDL.Rect|void dstrect)
    *!
    *! Perform a blit from this surface to the @[dst] surface.
    *!
    *! @param dst
    *!   Destination @[Surface] for the blit.
    *!
    *! @param srcrect
    *!   Optional source @[Rect]. If @[UNDEFINED] the entire source @[Surface]
    *!   will be copied.
    *!
    *! @param dstrect
    *!   Optional destination @[Rect]. Only the position fields
    *!   @tt{x@} and @tt{y@} values are used. If @[UNDEFINED] the
    *!   blit will be performed to position @tt{0, 0@}.
    */
#define f_Surface_blit_defined

#ifdef f_Surface_blit_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_blit_fun_num = 0;

#endif /* f_Surface_blit_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_blit(INT32 args) {
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * dst;
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * _srcrect;
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * _dstrect;
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args < 1) wrong_number_of_args_error("blit",args,1);
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args > 3) wrong_number_of_args_error("blit",args,3);
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("blit",1,"object");
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(dst=Pike_sp[0-args].u.object);
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if (args > 1 &&
    (TYPEOF(Pike_sp[1-args]) != PIKE_T_INT ||
     Pike_sp[1-args].u.integer)) {
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("blit",2,"object|void");
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(_srcrect=Pike_sp[1-args].u.object);
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
} else _srcrect = NULL;
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if (args > 2 &&
    (TYPEOF(Pike_sp[2-args]) != PIKE_T_INT ||
     Pike_sp[2-args].u.integer)) {
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[2-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("blit",3,"object|void");
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(_dstrect=Pike_sp[2-args].u.object);
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
} else _dstrect = NULL;
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
SDL_Rect *srcrect = NULL, *dstrect = NULL;
CHECK_CLASS(dst, Surface, 1);
if (OBJ2_SURFACE(dst)->generation != video_generation)
Pike_error("Uninitialized destination surface.\n");
if(_srcrect) {
CHECK_CLASS(_srcrect, Rect, 2);
srcrect = &(OBJ2_RECT(_srcrect)->rect);
}
if(_dstrect) {
CHECK_CLASS(_dstrect, Rect, 3);
dstrect = &(OBJ2_RECT(_dstrect)->rect);
}

CHECK_INIT();
SDL_BlitSurface(THIS->_s, srcrect,
OBJ2_SURFACE(dst)->_s, dstrect);
RET_THIS();
}

}
/*! @decl object fill_rect(int color, SDL.Rect dstrect)
   *!
   *! Fill a rectangle with a solid color.
   *!
   *! @seealso
   *!   @[fill()]
   */
#define f_Surface_fill_rect_defined

#ifdef f_Surface_fill_rect_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_fill_rect_fun_num = 0;

#endif /* f_Surface_fill_rect_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_fill_rect(INT32 args) {
#line 1602 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE color;
#line 1602 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * dstrect;
#line 1602 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 2) wrong_number_of_args_error("fill_rect",args,2);
#line 1602 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("fill_rect",1,"int");
#line 1602 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
color=Pike_sp[0-2].u.integer;
#line 1602 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-2]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("fill_rect",2,"object");
#line 1602 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(dstrect=Pike_sp[1-2].u.object);
#line 1602 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT();
CHECK_CLASS(dstrect, Rect, 2);
SDL_FillRect(THIS->_s,&(OBJ2_RECT(dstrect)->rect), (Uint32)color);
RET_THIS();
}

}
/*! @decl object fill(int color)
   *!
   *! Fill the entire surface with a solid color.
   *!
   *! @seealso
   *!   @[fill_rect()]
   */
#define f_Surface_fill_defined

#ifdef f_Surface_fill_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_fill_fun_num = 0;

#endif /* f_Surface_fill_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_fill(INT32 args) {
#line 1616 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE color;
#line 1616 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("fill",args,1);
#line 1616 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("fill",1,"int");
#line 1616 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
color=Pike_sp[0-1].u.integer;
#line 1616 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT();
SDL_FillRect(THIS->_s, NULL, (Uint32)color);
RET_THIS();
}

}
/*! @decl object set_color_key(int flag, int key)
   *!
   *! Set or clear the color key (aka transparent pixel) for a the surface.
   *! Also control whether RLE-accelleration is enabled or not.
   *!
   *! @param flag
   *!
   *! @fixme
   *!   Document this function
   */
#define f_Surface_set_color_key_defined

#ifdef f_Surface_set_color_key_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_set_color_key_fun_num = 0;

#endif /* f_Surface_set_color_key_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_set_color_key(INT32 args) {
#line 1632 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE flag;
#line 1632 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE key;
#line 1632 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 2) wrong_number_of_args_error("set_color_key",args,2);
#line 1632 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("set_color_key",1,"int");
#line 1632 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
flag=Pike_sp[0-2].u.integer;
#line 1632 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("set_color_key",2,"int");
#line 1632 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
key=Pike_sp[1-2].u.integer;
#line 1632 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT();
SDL_SetColorKey(THIS->_s, flag, key);
RET_THIS();
}

}
/*! @decl object set_alpha(int flag, int alpha)
   *!
   *! @fixme
   *!   Document this function
   */
#define f_Surface_set_alpha_defined

#ifdef f_Surface_set_alpha_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_set_alpha_fun_num = 0;

#endif /* f_Surface_set_alpha_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_set_alpha(INT32 args) {
#line 1643 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE flag;
#line 1643 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE alpha;
#line 1643 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 2) wrong_number_of_args_error("set_alpha",args,2);
#line 1643 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("set_alpha",1,"int");
#line 1643 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
flag=Pike_sp[0-2].u.integer;
#line 1643 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("set_alpha",2,"int");
#line 1643 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
alpha=Pike_sp[1-2].u.integer;
#line 1643 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT();
SDL_SetAlpha(THIS->_s, flag, CONVERT_ALPHA(alpha));
RET_THIS();
}

}
/*! @decl object set_clip_rect(SDL.Rect rect)
   *!
   *! @fixme
   *!   Document this function
   */
#define f_Surface_set_clip_rect_defined

#ifdef f_Surface_set_clip_rect_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_set_clip_rect_fun_num = 0;

#endif /* f_Surface_set_clip_rect_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_set_clip_rect(INT32 args) {
#line 1654 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * rect;
#line 1654 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("set_clip_rect",args,1);
#line 1654 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("set_clip_rect",1,"object");
#line 1654 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(rect=Pike_sp[0-1].u.object);
#line 1654 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT();
CHECK_CLASS(rect, Rect, 1);
SDL_SetClipRect(THIS->_s, &OBJ2_RECT(rect)->rect);
RET_THIS();
}

}
/*! @decl object convert_surface(SDL.PixelFormat fmt, int flags)
   *!
   *! @fixme
   *!   Document this function
   */
#define f_Surface_convert_surface_defined

#ifdef f_Surface_convert_surface_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Surface_convert_surface_fun_num = 0;

#endif /* f_Surface_convert_surface_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Surface_convert_surface(INT32 args) {
#line 1666 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * fmt;
#line 1666 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE flags;
#line 1666 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 2) wrong_number_of_args_error("convert_surface",args,2);
#line 1666 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-2]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("convert_surface",1,"object");
#line 1666 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(fmt=Pike_sp[0-2].u.object);
#line 1666 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("convert_surface",2,"int");
#line 1666 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
flags=Pike_sp[1-2].u.integer;
#line 1666 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
struct object *new_surface;
SDL_Surface *tmp;
CHECK_INIT();
CHECK_CLASS(fmt, PixelFormat, 1);

tmp = SDL_ConvertSurface(THIS->_s, OBJ2_PIXELFORMAT(fmt)->fmt, flags);
pop_n_elems(args);
if(!tmp) {
Pike_error("Failed to convert surface: %s\n", SDL_GetError());
}
new_surface = clone_object( Surface_program, 0 );
OBJ2_SURFACE(new_surface)->_s = tmp;
push_object(new_surface);
}

}

#ifdef Surface_event_handler_defined
static void Surface_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Surface_defined
  case PROG_EVENT_INIT: init_Surface_struct(); break;

#endif /* internal_init_Surface_defined */

#ifdef internal_exit_Surface_defined
  case PROG_EVENT_EXIT: exit_Surface_struct(); break;

#endif /* internal_exit_Surface_defined */
  default: break; 
  }
}

#endif /* Surface_event_handler_defined */
/*! @endclass Surface */
#line 1684 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#undef CHECK_INIT

/* SDL Video Method */

/*! @decl int video_mode_ok(int width, int height, int bpp, int flags)
 *!
 *! Checks to see if a particular video mode is supported.
 *!
 *! @returns
 *!  Returns 0 if the requested mode isn't supported under any bit depth, or the
 *!  bits-per-pixel of the closest available mode with the given width, height
 *!  and @[SDL.Surface] flags.
 *!
 *! @seealso
 *!  @[SDL.Surface], @[SDL.set_video_mode()], @[SDL.get_video_info()]
 */
#define f_video_mode_ok_defined

#ifdef f_video_mode_ok_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_video_mode_ok_fun_num = 0;

#endif /* f_video_mode_ok_fun_num_used */
DEFAULT_CMOD_STORAGE void f_video_mode_ok(INT32 args) {
#line 1700 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE width;
#line 1700 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE height;
#line 1700 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE bpp;
#line 1700 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE flags;
#line 1700 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 4) wrong_number_of_args_error("video_mode_ok",args,4);
#line 1700 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("video_mode_ok",1,"int");
#line 1700 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
width=Pike_sp[0-4].u.integer;
#line 1700 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("video_mode_ok",2,"int");
#line 1700 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
height=Pike_sp[1-4].u.integer;
#line 1700 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[2-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("video_mode_ok",3,"int");
#line 1700 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
bpp=Pike_sp[2-4].u.integer;
#line 1700 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[3-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("video_mode_ok",4,"int");
#line 1700 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
flags=Pike_sp[3-4].u.integer;
#line 1700 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_VideoModeOK(width, height, bpp, flags)); pop_n_elems(4); push_int(ret_); return; }while(0);
#line 1702 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}


}
/*! @decl int flip(SDL.Surface|void screen)
 *! On  hardware that supports double-buffering, this function
 *! sets up a flip and returns. The  hardware  will  wait  for
 *! vertical  retrace,  and then swap video buffers before the
 *! next video surface blit or lock will return.  On  hardware
 *! that  doesn't support double-buffering, this is equivalent
 *! to calling @[SDL.update_rect(screen, 0, 0, 0, 0)]
 *!
 *! The  @[SDL.DOUBLEBUF] flag must have been passed to
 *! @[SDL.set_video_mode()] when setting the video mode for this
 *! function to perform hardware flipping.
 *!
 *! @param screen
 *!  The screen object to flip. If missing, the default screen is used.
 *! @returns
 *!  This function returns 1 if successful, or 0 if there was an error.
 *!
 *! @seealso
 *!  @[SDL.update_rect()]
 */

#define f_flip_defined

#ifdef f_flip_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_flip_fun_num = 0;

#endif /* f_flip_fun_num_used */
DEFAULT_CMOD_STORAGE void f_flip(INT32 args) {
#line 1726 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * screen;
#line 1726 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args > 1) wrong_number_of_args_error("flip",args,1);
#line 1726 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if (args > 0 &&
    (TYPEOF(Pike_sp[0-args]) != PIKE_T_INT ||
     Pike_sp[0-args].u.integer)) {
#line 1726 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("flip",1,"object|void");
#line 1726 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(screen=Pike_sp[0-args].u.object);
#line 1726 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
} else screen = NULL;
#line 1726 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
SDL_Surface *vs = NULL;
if(!screen) {
vs = SDL_GetVideoSurface();
} else {
CHECK_CLASS(screen, Surface, 5);
if (OBJ2_SURFACE(screen)->generation != video_generation)
Pike_error("Uninitialized screen Surface.\n");
vs = OBJ2_SURFACE(screen)->_s;
}
do { INT_TYPE ret_=(SDL_Flip(vs) == 0); pop_n_elems(args); push_int(ret_); return; }while(0);
#line 1737 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
#line 1739 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
/*PIKEFUN void SDL_UpdateRects(object|void screen, int numrects, array rects);*/

/*! @decl void update_rect(int x, int y, int w, int h, SDL.Surface|void screen)
 *!
 *! Makes sure the given area is updated on the given screen.  The
 *! rectangle must be confined within the screen boundaries (no clipping
 *! is done).
 *!
 *! If 'x', 'y', 'w' and 'h' are all 0, @[SDL.update_rect()] will update
 *! the entire screen.
 *!
 *! This function should not be called while @[screen] is locked.
 *!
 *! @param x
 *! @param y
 *!  Top left corner of the rectangle to update.
 *! @param w
 *! @param h
 *!  Width and height of the rectangle to update.
 *! @param screen
 *!  The screen object to flip. If missing, the default screen is used.
 *! @seealso
 *!  @[SDL.flip()]
 */
#define f_update_rect_defined

#ifdef f_update_rect_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_update_rect_fun_num = 0;

#endif /* f_update_rect_fun_num_used */
DEFAULT_CMOD_STORAGE void f_update_rect(INT32 args) {
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE x;
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE y;
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE w;
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE h;
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * screen;
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args < 4) wrong_number_of_args_error("update_rect",args,4);
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args > 5) wrong_number_of_args_error("update_rect",args,5);
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("update_rect",1,"int");
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
x=Pike_sp[0-args].u.integer;
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("update_rect",2,"int");
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
y=Pike_sp[1-args].u.integer;
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[2-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("update_rect",3,"int");
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
w=Pike_sp[2-args].u.integer;
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[3-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("update_rect",4,"int");
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
h=Pike_sp[3-args].u.integer;
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if (args > 4 &&
    (TYPEOF(Pike_sp[4-args]) != PIKE_T_INT ||
     Pike_sp[4-args].u.integer)) {
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[4-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("update_rect",5,"object|void");
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(screen=Pike_sp[4-args].u.object);
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
} else screen = NULL;
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
SDL_Surface *vs;
if(!screen) {
vs = SDL_GetVideoSurface();
} else {
CHECK_CLASS(screen, Surface, 5);
if (OBJ2_SURFACE(screen)->generation != video_generation)
Pike_error("Uninitialized screen Surface.\n");
vs = OBJ2_SURFACE(screen)->_s;
}
SDL_UpdateRect(vs, x, y, w, h);
}

}
/*! @decl int set_gamma(float red, float green, float blue)
 *!
 *! @fixme
 *!   Document this function
 */
#define f_set_gamma_defined

#ifdef f_set_gamma_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_set_gamma_fun_num = 0;

#endif /* f_set_gamma_fun_num_used */
DEFAULT_CMOD_STORAGE void f_set_gamma(INT32 args) {
#line 1781 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
FLOAT_TYPE red;
#line 1781 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
FLOAT_TYPE green;
#line 1781 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
FLOAT_TYPE blue;
#line 1781 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 3) wrong_number_of_args_error("set_gamma",args,3);
#line 1781 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-3]) != PIKE_T_FLOAT) SIMPLE_ARG_TYPE_ERROR("set_gamma",1,"float");
#line 1781 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
red=Pike_sp[0-3].u.float_number;
#line 1781 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-3]) != PIKE_T_FLOAT) SIMPLE_ARG_TYPE_ERROR("set_gamma",2,"float");
#line 1781 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
green=Pike_sp[1-3].u.float_number;
#line 1781 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[2-3]) != PIKE_T_FLOAT) SIMPLE_ARG_TYPE_ERROR("set_gamma",3,"float");
#line 1781 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
blue=Pike_sp[2-3].u.float_number;
#line 1781 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_SetGamma(red, green, blue)); pop_n_elems(3); push_int(ret_); return; }while(0);
#line 1783 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl void|object get_video_surface()
 *!
 *! Returns the current display surface.
 *!
 *! If SDL is doing format conversion on the display surface, this method
 *! returns the publicly visible surface, not the real video surface.
 *!
 *! @returns
 *!   The current display surface, or 0 if there is no display surface.
 *!
 *! @seealso
 *!   @[SDL.set_video_mode()]
 */
#define f_get_video_surface_defined

#ifdef f_get_video_surface_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_get_video_surface_fun_num = 0;

#endif /* f_get_video_surface_fun_num_used */
DEFAULT_CMOD_STORAGE void f_get_video_surface(INT32 args) {
#line 1798 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("get_video_surface",args,0);
{
SDL_Surface *screen = SDL_GetVideoSurface();
if(screen != NULL) {
struct object *surface = clone_object( Surface_program, 0 );
/* to avoid freeing when the new Surface class is destroyed */
screen->refcount ++;
OBJ2_SURFACE(surface)->_s = screen;
push_object(surface);
return;
}
push_int(0);
}

}
/*! @decl void|object get_video_info()
 *!
 *! @returns
 *!  Returns an @[SDL.VideoInfo] object, which holds information about the video
 *!  hardware, or 0 if the video device has not yet been initialized (with a
 *!  call to @[SDL.init()]).
 */
#define f_get_video_info_defined

#ifdef f_get_video_info_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_get_video_info_fun_num = 0;

#endif /* f_get_video_info_fun_num_used */
DEFAULT_CMOD_STORAGE void f_get_video_info(INT32 args) {
#line 1819 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("get_video_info",args,0);
{
const SDL_VideoInfo *vidinfo = SDL_GetVideoInfo();
if(vidinfo != NULL) {
struct object *viptr = clone_object( VideoInfo_program, 0 );
/* to avoid freeing when the new Surface class is destroyed */
OBJ2_VIDEOINFO(viptr)->vidinfo = vidinfo;
push_object(viptr);
return;
}
push_int(0);
}

}
/*! @decl void gl_set_attribute(int attribute, int value)
 *!
 *! Sets an SDL/OpenGL attribute to the given value.
 *!
 *! This won't take effect until after a call to @[SDL.set_video_mode()].
 *!
 *! @param attribute
 *!  The attribute to set.  This will be one of @[SDL.GL_RED_SIZE],
 *!  @[SDL.GL_GREEN_SIZE], @[SDL.GL_BLUE_SIZE],
 *!  @[SDL.GL_DEPTH_SIZE] or @[SDL.GL_DOUBLEBUFFER].
 *!
 *! @param value
 *!  The value to set for this attribute.
 *!
 *! @seealso
 *!  @[SDL.gl_get_attribute()]
 */
#define f_gl_set_attribute_defined

#ifdef f_gl_set_attribute_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_gl_set_attribute_fun_num = 0;

#endif /* f_gl_set_attribute_fun_num_used */
DEFAULT_CMOD_STORAGE void f_gl_set_attribute(INT32 args) {
#line 1849 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE attribute;
#line 1849 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE value;
#line 1849 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 2) wrong_number_of_args_error("gl_set_attribute",args,2);
#line 1849 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("gl_set_attribute",1,"int");
#line 1849 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
attribute=Pike_sp[0-2].u.integer;
#line 1849 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("gl_set_attribute",2,"int");
#line 1849 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
value=Pike_sp[1-2].u.integer;
{
SDL_GL_SetAttribute( attribute, value );
}

}
/*! @decl int gl_get_attribute(int attribute)
 *!
 *! Returns the value of the given SDL/OpenGL attribute.  You might want
 *! to call this after @[SDL.set_video_mode()] to check that attributes
 *! have been set as you expected.
 *!
 *! @param attribute
 *!  The SDL/OpenGL attribute to query.
 *!
 *! @returns
 *!  The value of the given attribute.
 *!
 *! @example
 *!   @code
 *!     // Has double-buffering been set?
 *!     int db = SDL.gl_get_attribute( SDL.GL_DOUBLEBUFFER );
 *!     if ( db )
 *!     {
 *!       // yes...
 *!   @endcode
 */
#define f_gl_get_attribute_defined

#ifdef f_gl_get_attribute_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_gl_get_attribute_fun_num = 0;

#endif /* f_gl_get_attribute_fun_num_used */
DEFAULT_CMOD_STORAGE void f_gl_get_attribute(INT32 args) {
#line 1875 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE attribute;
#line 1875 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("gl_get_attribute",args,1);
#line 1875 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("gl_get_attribute",1,"int");
#line 1875 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
attribute=Pike_sp[0-1].u.integer;
{
int res;
SDL_GL_GetAttribute( attribute, &res );
do { INT_TYPE ret_=(res); pop_stack(); push_int(ret_); return; }while(0);
#line 1880 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int show_cursor(int show)
 *!
 *! Sets the state of the mouse cursor on the SDL screen (visible or hidden),
 *! or queries its current state.
 *!
 *! By default, the cursor is visible.
 *!
 *! @param show
 *!  One of these constants:
 *!   @dl
 *!    @item SDL.ENABLE
 *!     Show the cursor.
 *!    @item SDL.DISABLE
 *!     Hide the cursor.
 *!    @item SDL.QUERY
 *!     Determine the current state of the cursor.
 *!   @enddl
 *!
 *! @returns
 *!  The current state of the mouse cursor, either @[SDL.ENABLE] or
 *!  @[SDL.DISABLE].
 */
#define f_show_cursor_defined

#ifdef f_show_cursor_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_show_cursor_fun_num = 0;

#endif /* f_show_cursor_fun_num_used */
DEFAULT_CMOD_STORAGE void f_show_cursor(INT32 args) {
#line 1904 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE show;
#line 1904 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("show_cursor",args,1);
#line 1904 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("show_cursor",1,"int");
#line 1904 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
show=Pike_sp[0-1].u.integer;
{
do { INT_TYPE ret_=(SDL_ShowCursor( show )); pop_stack(); push_int(ret_); return; }while(0);
#line 1907 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl void warp_mouse(int xpos, int ypos)
 *!
 *! Sets the position of the mouse cursor to the given coordinates.
 *! This generates an @tt{SDL.MOUSEMOTION@} event.
 *!
 *! @param xpos
 *!  Requested position of the mouse cursor along the x-axis.
 *! @param ypos
 *!  Requested position of the mouse cursor along the y-axis.
 */
#define f_warp_mouse_defined

#ifdef f_warp_mouse_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_warp_mouse_fun_num = 0;

#endif /* f_warp_mouse_fun_num_used */
DEFAULT_CMOD_STORAGE void f_warp_mouse(INT32 args) {
#line 1919 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE xpos;
#line 1919 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE ypos;
#line 1919 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 2) wrong_number_of_args_error("warp_mouse",args,2);
#line 1919 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("warp_mouse",1,"int");
#line 1919 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
xpos=Pike_sp[0-2].u.integer;
#line 1919 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("warp_mouse",2,"int");
#line 1919 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
ypos=Pike_sp[1-2].u.integer;
{
SDL_WarpMouse( xpos, ypos );
}

}
/*! @decl void gl_swap_buffers()
 *!
 *! Swaps the OpenGL buffers on a double-buffered screen.
 *!
 *! @seealso
 *!  @[SDL.gl_set_attribute()], @[SDL.gl_get_attribute()],
 *!  @[SDL.set_video_mode()]
 */

#define f_gl_swap_buffers_defined

#ifdef f_gl_swap_buffers_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_gl_swap_buffers_fun_num = 0;

#endif /* f_gl_swap_buffers_fun_num_used */
DEFAULT_CMOD_STORAGE void f_gl_swap_buffers(INT32 args) {
#line 1933 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("gl_swap_buffers",args,0);
{
THREADS_ALLOW();
SDL_GL_SwapBuffers( );
THREADS_DISALLOW();
}

}
/*! @decl object set_video_mode(int width, int height, int bpp, int flags)
 *!
 *! Sets up a video mode with the specified width, height and bits per pixel.
 *!
 *! @param width
 *!  The desired width.  Setting this to <= 0 results in an SDL error.
 *! @param height
 *!  The desired height.  Setting this to <= 0 results in an SDL error.
 *! @param bpp
 *!  The bits per pixel.  This should be either 0, 8, 16, 24 or 32.  If you set
 *!  this to 0, the bits-per-pixel value of the current display will be used.
 *! @param flags
 *!  An OR'd combination of the desired @[SDL.Surface] flags.
 *!
 *! @returns
 *!  The framebuffer surface.  An error is thrown if the video mode can't be
 *!  set.
 *!
 *! @seealso
 *!  @[SDL.Surface], @[SDL.video_mode_ok()]
 */
#define f_set_video_mode_defined

#ifdef f_set_video_mode_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_set_video_mode_fun_num = 0;

#endif /* f_set_video_mode_fun_num_used */
DEFAULT_CMOD_STORAGE void f_set_video_mode(INT32 args) {
#line 1961 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE width;
#line 1961 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE height;
#line 1961 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE bpp;
#line 1961 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE flags;
#line 1961 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 4) wrong_number_of_args_error("set_video_mode",args,4);
#line 1961 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("set_video_mode",1,"int");
#line 1961 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
width=Pike_sp[0-4].u.integer;
#line 1961 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("set_video_mode",2,"int");
#line 1961 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
height=Pike_sp[1-4].u.integer;
#line 1961 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[2-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("set_video_mode",3,"int");
#line 1961 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
bpp=Pike_sp[2-4].u.integer;
#line 1961 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[3-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("set_video_mode",4,"int");
#line 1961 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
flags=Pike_sp[3-4].u.integer;
{
if(width <= 0 || height <= 0) { /* To avoid core dump in SDL */
SDL_SetError("Tried to open window with width and/or height smaller than 1.");
} else {
SDL_Surface *screen = NULL;
switch(bpp) { /* Switch to avoid coredump in SDL */
case 0: case 8: case 16: case 24: case 32:
screen = SDL_SetVideoMode(width, height, bpp, flags);
if(screen != NULL) {
struct object *surface = clone_object( Surface_program, 0 );
/* to avoid freeing when the new Surface class is destroyed, since
	 * it's a reference to the screen surface, which SDL handles.
	 */
screen->refcount ++;
OBJ2_SURFACE(surface)->_s = screen;
pop_n_elems(args);
push_object(surface);
return;
}
break;
default:
SDL_SetError("Invalid bpp, expected 0, 8, 16, 24 or 32.");
}
}
Pike_error("Failed to set video mode: %s\n", SDL_GetError());
}

}
/*! @decl int blit_surface(SDL.Surface src, SDL.Surface dst,@
 *!                        SDL.Rect|void srcrect, SDL.Rect|void dstrect)
 *!
 *! Peforms a fast blit from the source surface to the destination surface.
 *!
 *! The final blit rectangle is stored in @tt{dstrect@}.  This may differ from
 *! @tt{srcrect@} if there was clipping.
 *!
 *! This function should not be called on a locked surface.
 *!
 *! @param src
 *!  The surface to be copied.
 *! @param dst
 *!  The destination surface.  This will usually be your main screen,
 *!  initialized with a call to @[SDL.set_video_mode()].
 *! @param srcrect
 *!  The rectangular section of @tt{src@} to copy.  If the whole surface is to
 *!  be copied, you can set this to @tt{0@}.
 *! @param dstrect
 *!  Where the source surface should be copied to on the destination surface.
 *!  Only the @tt{x@} and @tt{y@} fields of the @[SDL.Rect] object are used.
 *!  To copy @tt{src@} to the top-left corner of @tt{dst@}, i.e. at coordinates
 *!  <0,0>, you can set this to @tt{0@}.
 *!
 *! @returns
 *!  If successful, 0, otherwise -1.
 *!
 *! @seealso
 *!  @[SDL.Surface()->blit()]
 */
#define f_blit_surface_defined

#ifdef f_blit_surface_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_blit_surface_fun_num = 0;

#endif /* f_blit_surface_fun_num_used */
DEFAULT_CMOD_STORAGE void f_blit_surface(INT32 args) {
#line 2019 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * src;
#line 2019 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * dst;
struct object * _srcrect;
struct object * _dstrect;
#line 2019 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args < 2) wrong_number_of_args_error("blit_surface",args,2);
#line 2019 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args > 4) wrong_number_of_args_error("blit_surface",args,4);
#line 2019 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("blit_surface",1,"object");
#line 2019 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(src=Pike_sp[0-args].u.object);
#line 2019 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("blit_surface",2,"object");
#line 2019 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(dst=Pike_sp[1-args].u.object);
if (args > 2 &&
    (TYPEOF(Pike_sp[2-args]) != PIKE_T_INT ||
     Pike_sp[2-args].u.integer)) {
#line 2020 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[2-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("blit_surface",3,"object|void");
#line 2020 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(_srcrect=Pike_sp[2-args].u.object);
#line 2020 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
} else _srcrect = NULL;
if (args > 3 &&
    (TYPEOF(Pike_sp[3-args]) != PIKE_T_INT ||
     Pike_sp[3-args].u.integer)) {
#line 2021 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[3-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("blit_surface",4,"object|void");
#line 2021 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(_dstrect=Pike_sp[3-args].u.object);
#line 2021 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
} else _dstrect = NULL;
#line 2021 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
SDL_Rect *srcrect = NULL, *dstrect = NULL;
CHECK_CLASS(src, Surface, 1);
CHECK_CLASS(dst, Surface, 2);
if (OBJ2_SURFACE(src)->generation != video_generation)
Pike_error("Uninitialized source Surface.\n");
if (OBJ2_SURFACE(dst)->generation != video_generation)
Pike_error("Uninitialized destination Surface.\n");
if(_srcrect) {
CHECK_CLASS(_srcrect, Rect, 3);
srcrect = &(OBJ2_RECT(_srcrect)->rect);
}
if(_dstrect) {
CHECK_CLASS(_dstrect, Rect, 4);
dstrect = &(OBJ2_RECT(_dstrect)->rect);
}

do { INT_TYPE ret_=(SDL_BlitSurface(OBJ2_SURFACE(src)->_s, srcrect,
OBJ2_SURFACE(dst)->_s, dstrect)); pop_n_elems(args); push_int(ret_); return; }while(0);
#line 2040 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl void|string video_driver_name()
 *!
 *! Obtains the name of the video driver.  This is a simple one-word identifier
 *! such as 'x11' or 'windib'.
 *!
 *! @returns
 *!  The name of the video driver, or 0 if video has not yet been initialized
 *!  (with a call to @[SDL.init()]).
 */
#define f_video_driver_name_defined

#ifdef f_video_driver_name_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_video_driver_name_fun_num = 0;

#endif /* f_video_driver_name_fun_num_used */
DEFAULT_CMOD_STORAGE void f_video_driver_name(INT32 args) {
#line 2051 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("video_driver_name",args,0);
#line 2051 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
char tmp[256];
tmp[0] = 0;
SDL_VideoDriverName(tmp, 255);
if(!*tmp) {
push_int(0);
return;
}
push_text(tmp);
}

}
/*! @decl void set_caption(string title, string icon)
 *!
 *! Sets the window's title and icon name.  Icon name refers to the text
 *! that appears next to the application's icon in its minimized window.
 *!
 *! @param title
 *!  The window's title.
 *!
 *! @param icon
 *!  The minimized window's icon name.
 *!
 *! @seealso
 *!  @[SDL.get_caption()]
 */
#define f_set_caption_defined

#ifdef f_set_caption_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_set_caption_fun_num = 0;

#endif /* f_set_caption_fun_num_used */
DEFAULT_CMOD_STORAGE void f_set_caption(INT32 args) {
#line 2076 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct pike_string * title;
#line 2076 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct pike_string * icon;
#line 2076 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 2) wrong_number_of_args_error("set_caption",args,2);
#line 2076 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-2]) != PIKE_T_STRING) SIMPLE_ARG_TYPE_ERROR("set_caption",1,"string");
#line 2076 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(title=Pike_sp[0-2].u.string);
#line 2076 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-2]) != PIKE_T_STRING) SIMPLE_ARG_TYPE_ERROR("set_caption",2,"string");
#line 2076 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(icon=Pike_sp[1-2].u.string);
#line 2076 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
SDL_WM_SetCaption(title->str, icon->str);
}

}
/*! @decl array(string) get_caption()
 *!
 *! @returns
 *!  A 2-element array holding the window title and icon name.
 *!
 *! @seealso
 *!  @[SDL.set_caption()]
 */
#define f_get_caption_defined

#ifdef f_get_caption_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_get_caption_fun_num = 0;

#endif /* f_get_caption_fun_num_used */
DEFAULT_CMOD_STORAGE void f_get_caption(INT32 args) {
#line 2088 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("get_caption",args,0);
#line 2088 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
char *title, *icon;
SDL_WM_GetCaption(&title, &icon);
pop_n_elems(args);
push_text(title == NULL ? "" : title);
push_text(icon == NULL ? "" : icon);
f_aggregate(2);
}

}
/*! @decl int iconify_window()
 *!
 *! Attempts to iconify (i.e. minimize) the application window.
 *!
 *! If the call is successful, the application will receive an
 *! @[SDL.APPACTIVE] loss event.
 *!
 *! @returns
 *!  Non-zero if successful, otherwise @expr{0@}.
 */
#define f_iconify_window_defined

#ifdef f_iconify_window_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_iconify_window_fun_num = 0;

#endif /* f_iconify_window_fun_num_used */
DEFAULT_CMOD_STORAGE void f_iconify_window(INT32 args) {
#line 2107 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("iconify_window",args,0);
#line 2107 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_WM_IconifyWindow());  push_int(ret_); return; }while(0);
#line 2109 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int toggle_fullscreen(void|SDL.Surface screen)
 *!
 *! Toggles the application between windowed and fullscreen mode, if supported.
 *! X11 is the only target currently supported.
 *!
 *! @param screen
 *!   The framebuffer surface, as returned by @[SDL.set_video_mode()].
 *!
 *! @returns
 *!   Returns 1 on success or 0 on failure.
 */
#define f_toggle_fullscreen_defined

#ifdef f_toggle_fullscreen_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_toggle_fullscreen_fun_num = 0;

#endif /* f_toggle_fullscreen_fun_num_used */
DEFAULT_CMOD_STORAGE void f_toggle_fullscreen(INT32 args) {
#line 2122 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct object * screen;
#line 2122 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args > 1) wrong_number_of_args_error("toggle_fullscreen",args,1);
#line 2122 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if (args > 0 &&
    (TYPEOF(Pike_sp[0-args]) != PIKE_T_INT ||
     Pike_sp[0-args].u.integer)) {
#line 2122 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("toggle_fullscreen",1,"void|object");
#line 2122 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(screen=Pike_sp[0-args].u.object);
#line 2122 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
} else screen = NULL;
#line 2122 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
SDL_Surface *vs = 0;
if(!screen) {
vs = SDL_GetVideoSurface();
} else {
CHECK_CLASS(screen, Surface, 1);
if (OBJ2_SURFACE(screen)->generation != video_generation)
Pike_error("Uninitialized screen Surface.\n");
vs = OBJ2_SURFACE(screen)->_s;
}
if(!vs) { do { INT_TYPE ret_=(-1); pop_n_elems(args); push_int(ret_); return; }while(0);}
do { INT_TYPE ret_=(SDL_WM_ToggleFullScreen(vs)); pop_n_elems(args); push_int(ret_); return; }while(0);
#line 2134 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int grab_input(int mode)
 *!
 *! Sets or queries the current 'grab' mode.
 *!
 *! Grabbing input means asking that all mouse activity be confined to
 *! this application window and that nearly all keyboard events are
 *! passed directly to the application, bypassing the window manager.
 *!
 *! @param mode
 *!  One of the following constants:
 *!   @dl
 *!    @item
 *!     @[SDL.GRAB_ON]
 *!    @item
 *!     @[SDL.GRAB_OFF]
 *!    @item
 *!     @[SDL.GRAB_QUERY]
 *!   @enddl
 *!
 *! @returns
 *!  The current grab mode, either @[SDL.GRAB_ON] or @[SDL.GRAB_OFF].
 */
#define f_grab_input_defined

#ifdef f_grab_input_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_grab_input_fun_num = 0;

#endif /* f_grab_input_fun_num_used */
DEFAULT_CMOD_STORAGE void f_grab_input(INT32 args) {
#line 2158 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE mode;
#line 2158 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("grab_input",args,1);
#line 2158 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("grab_input",1,"int");
#line 2158 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
mode=Pike_sp[0-1].u.integer;
#line 2158 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_WM_GrabInput(mode)); pop_stack(); push_int(ret_); return; }while(0);
#line 2160 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
#line 2162 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
/* Joystick related functionality */

#ifdef HAVE_LIBSDL_JOYSTICK

/*! @class Joystick
 *!
 *! Represents a joystick, gamepad or other similar input device attached
 *! to the system.
 *!
 *! You must call @[SDL.init()] with the @[SDL.INIT_JOYSTICK] flag to
 *! enable joystick support.
 *!
 *! All index numbers count from @expr{0@}.
 *!
 *! All @[SDL.Joystick] methods throw an exception if they are called on
 *! an uninitialized object.
 */

#define CHECK_INIT() if((THIS->generation != joystick_generation) || (THIS->joystick == NULL)) { Pike_error("Joystick uninitialized!\n"); }

#undef class_Joystick_defined
#define class_Joystick_defined
DEFAULT_CMOD_STORAGE struct program *Joystick_program=NULL;

#ifdef Joystick_program_fun_num_used
DEFAULT_CMOD_STORAGE int Joystick_program_fun_num=-1;
#endif /* Joystick_program_fun_num_used */

#undef var_joystick_Joystick_defined
#define var_joystick_Joystick_defined

#undef var_generation_Joystick_defined
#define var_generation_Joystick_defined

#undef THIS
#define THIS ((struct Joystick_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_JOYSTICK
#define THIS_JOYSTICK ((struct Joystick_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_JOYSTICK
#define OBJ2_JOYSTICK(o) ((struct Joystick_struct *)(o->storage+Joystick_storage_offset))

#undef GET_JOYSTICK_STORAGE
#define GET_JOYSTICK_STORAGE(o) ((struct Joystick_struct *)(o->storage+Joystick_storage_offset)
static ptrdiff_t Joystick_storage_offset;
struct Joystick_struct {

#ifdef var_joystick_Joystick_defined
#line 2182 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
SDL_Joystick *joystick;
#endif /* var_joystick_Joystick_defined */

#ifdef var_generation_Joystick_defined
#line 2183 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
int generation;
#endif /* var_generation_Joystick_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Joystick_struct *Joystick_gdb_dummy_ptr;
#endif

#undef internal_init_Joystick_defined
#define internal_init_Joystick_defined

#undef Joystick_event_handler_defined
#define Joystick_event_handler_defined
static void init_Joystick_struct(void)
#line 2185 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
THIS->joystick = NULL;
THIS->generation = joystick_generation;
}


#undef internal_exit_Joystick_defined
#define internal_exit_Joystick_defined

#undef Joystick_event_handler_defined
#define Joystick_event_handler_defined
static void exit_Joystick_struct(void)
#line 2192 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
if((THIS->generation == joystick_generation) && (THIS->joystick != NULL)) {
SDL_JoystickClose(THIS->joystick);
THIS->joystick = NULL;
}
}

/*! @decl void create(int device_index)
   *!
   *! Opens the given joystick device for use.
   *!
   *! @param device_index
   *!  The @i{n@}th joystick device available to the system.
   *!
   *! @seealso
   *!  @[SDL.num_joysticks()]
   */
#define f_Joystick_create_defined

#ifdef f_Joystick_create_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Joystick_create_fun_num = 0;

#endif /* f_Joystick_create_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Joystick_create(INT32 args) {
#line 2209 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE device_index;
#line 2209 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("create",args,1);
#line 2209 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("create",1,"int");
#line 2209 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
device_index=Pike_sp[0-1].u.integer;
#line 2209 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
THIS->joystick = SDL_JoystickOpen(device_index);
if(!THIS->joystick) {
Pike_error("Failed to open joystick %"PRINTPIKEINT"d: %s\n", device_index,
SDL_GetError());
}
THIS->generation = joystick_generation;
}

}
/*! @decl int index()
   *!
   *! @returns
   *!  The index of this joystick.
   */
#define f_Joystick_index_defined

#ifdef f_Joystick_index_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Joystick_index_fun_num = 0;

#endif /* f_Joystick_index_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Joystick_index(INT32 args) {
#line 2223 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("index",args,0);
#line 2223 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT();
do { INT_TYPE ret_=(SDL_JoystickIndex(THIS->joystick));  push_int(ret_); return; }while(0);
#line 2226 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int num_axes()
   *!
   *! @returns
   *!  The number of axes available for this joystick.
   */
#define f_Joystick_num_axes_defined

#ifdef f_Joystick_num_axes_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Joystick_num_axes_fun_num = 0;

#endif /* f_Joystick_num_axes_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Joystick_num_axes(INT32 args) {
#line 2233 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("num_axes",args,0);
#line 2233 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT();
do { INT_TYPE ret_=(SDL_JoystickNumAxes(THIS->joystick));  push_int(ret_); return; }while(0);
#line 2236 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int num_balls()
   *!
   *! @returns
   *!  The number of trackballs available for this joystick.
   */
#define f_Joystick_num_balls_defined

#ifdef f_Joystick_num_balls_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Joystick_num_balls_fun_num = 0;

#endif /* f_Joystick_num_balls_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Joystick_num_balls(INT32 args) {
#line 2243 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("num_balls",args,0);
#line 2243 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT();
do { INT_TYPE ret_=(SDL_JoystickNumBalls(THIS->joystick));  push_int(ret_); return; }while(0);
#line 2246 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int num_hats()
   *!
   *! @returns
   *!  The number of hats available for this joystick.
   */
#define f_Joystick_num_hats_defined

#ifdef f_Joystick_num_hats_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Joystick_num_hats_fun_num = 0;

#endif /* f_Joystick_num_hats_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Joystick_num_hats(INT32 args) {
#line 2253 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("num_hats",args,0);
#line 2253 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT();
do { INT_TYPE ret_=(SDL_JoystickNumHats(THIS->joystick));  push_int(ret_); return; }while(0);
#line 2256 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int num_buttons()
   *!
   *! @returns
   *!  The number of buttons available for this joystick.
   */
#define f_Joystick_num_buttons_defined

#ifdef f_Joystick_num_buttons_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Joystick_num_buttons_fun_num = 0;

#endif /* f_Joystick_num_buttons_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Joystick_num_buttons(INT32 args) {
#line 2263 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("num_buttons",args,0);
#line 2263 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT();
do { INT_TYPE ret_=(SDL_JoystickNumButtons(THIS->joystick));  push_int(ret_); return; }while(0);
#line 2266 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl float get_axis(int axis)
   *!
   *! Returns the current position of the given axis.
   *!
   *! The returned value is a float between @expr{-1.0@} and @expr{1.0@}.
   *!
   *! @param axis
   *!  The axis index.
   *!
   *! @returns
   *!  The current position of the given axis.
   *!
   *! @seealso
   *!  @[num_axes()]
   */
#define f_Joystick_get_axis_defined

#ifdef f_Joystick_get_axis_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Joystick_get_axis_fun_num = 0;

#endif /* f_Joystick_get_axis_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Joystick_get_axis(INT32 args) {
#line 2283 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE axis;
#line 2283 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("get_axis",args,1);
#line 2283 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("get_axis",1,"int");
#line 2283 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
axis=Pike_sp[0-1].u.integer;
#line 2283 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
int axis_value;
CHECK_INIT();
axis_value = SDL_JoystickGetAxis(THIS->joystick, axis);
do { FLOAT_TYPE ret_=((FLOAT_TYPE)axis_value / (FLOAT_TYPE)32768); pop_stack(); push_float(ret_); return; }while(0);
#line 2288 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int get_hat(int hat)
   *!
   *! Returns the current state of the given hat.
   *!
   *! This is represented as an OR'd combination of one or more of the
   *! following constants:
   *!
   *! @dl
   *!   @item
   *!     @[SDL.HAT_CENTERED]
   *!   @item
   *!     @[SDL.HAT_UP]
   *!   @item
   *!     @[SDL.HAT_RIGHT]
   *!   @item
   *!     @[SDL.HAT_DOWN]
   *!   @item
   *!     @[SDL.HAT_LEFT]
   *!   @item
   *!     @[SDL.HAT_RIGHTUP]
   *!   @item
   *!     @[SDL.HAT_RIGHTDOWN]
   *!   @item
   *!     @[SDL.HAT_LEFTUP]
   *!   @item
   *!     @[SDL.HAT_LEFTDOWN]
   *! @enddl
   *!
   *! @param hat
   *!  The hat index.
   *!
   *! @returns
   *!  The current state of the given hat.
   *!
   *! @seealso
   *!  @[num_hats()]
   */
#define f_Joystick_get_hat_defined

#ifdef f_Joystick_get_hat_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Joystick_get_hat_fun_num = 0;

#endif /* f_Joystick_get_hat_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Joystick_get_hat(INT32 args) {
#line 2327 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE hat;
#line 2327 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("get_hat",args,1);
#line 2327 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("get_hat",1,"int");
#line 2327 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
hat=Pike_sp[0-1].u.integer;
#line 2327 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT();
do { INT_TYPE ret_=(SDL_JoystickGetHat(THIS->joystick, hat)); pop_stack(); push_int(ret_); return; }while(0);
#line 2330 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl array(int) get_ball(int ball)
   *!
   *! Returns the axis change of the given trackball.
   *!
   *! This is its relative motion along both axes since the last call to
   *! @[get_ball()]. It is returned as a 2-element array holding the values
   *! of @i{dx@} and @i{dy@} (- the motion deltas).
   *!
   *! @returns
   *!  The axis change of the given trackball.
   *!
   *! @seealso
   *!  @[num_balls()]
   */
#define f_Joystick_get_ball_defined

#ifdef f_Joystick_get_ball_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Joystick_get_ball_fun_num = 0;

#endif /* f_Joystick_get_ball_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Joystick_get_ball(INT32 args) {
#line 2346 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE ball;
#line 2346 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("get_ball",args,1);
#line 2346 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("get_ball",1,"int");
#line 2346 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
ball=Pike_sp[0-1].u.integer;
#line 2346 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
int dx, dy;
CHECK_INIT();
SDL_JoystickGetBall(THIS->joystick, ball, &dx, &dy);
pop_n_elems(args);
push_int(dx);
push_int(dy);
f_aggregate(2);
}

}
/*! @decl int get_button(int button)
   *!
   *! Returns the current state of the given button.
   *!
   *! This is @expr{1@} if the button is pressed, otherwise @expr{0@}.
   *!
   *! @param button
   *!  The button index.
   *!
   *! @returns
   *!  The current state of the given button.
   *!
   *! @seealso
   *!  @[num_buttons()]
   */
#define f_Joystick_get_button_defined

#ifdef f_Joystick_get_button_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Joystick_get_button_fun_num = 0;

#endif /* f_Joystick_get_button_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Joystick_get_button(INT32 args) {
#line 2371 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE button;
#line 2371 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("get_button",args,1);
#line 2371 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("get_button",1,"int");
#line 2371 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
button=Pike_sp[0-1].u.integer;
#line 2371 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT();
do { INT_TYPE ret_=(SDL_JoystickGetButton(THIS->joystick, button)); pop_stack(); push_int(ret_); return; }while(0);
#line 2374 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl string name()
   *!
   *! @returns
   *!  The implementation-dependent name of this joystick.
   *!
   *! @seealso
   *!  @[SDL.joystick_name()]
   */
#define f_Joystick_name_defined

#ifdef f_Joystick_name_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Joystick_name_fun_num = 0;

#endif /* f_Joystick_name_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Joystick_name(INT32 args) {
#line 2384 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("name",args,0);
#line 2384 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
const char *name;
CHECK_INIT();
name = SDL_JoystickName(SDL_JoystickIndex(THIS->joystick));
pop_n_elems(args);
if(name == NULL) {
push_int(0);
} else {
push_text(name);
}
}
}

#ifdef Joystick_event_handler_defined
static void Joystick_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Joystick_defined
  case PROG_EVENT_INIT: init_Joystick_struct(); break;

#endif /* internal_init_Joystick_defined */

#ifdef internal_exit_Joystick_defined
  case PROG_EVENT_EXIT: exit_Joystick_struct(); break;

#endif /* internal_exit_Joystick_defined */
  default: break; 
  }
}

#endif /* Joystick_event_handler_defined */
#line 2396 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#undef CHECK_INIT

/*! @endclass
 */

/*! @decl void pump_events()
 *!
 *! Pumps the event loop, gathering events from the input devices.
 *!
 *! Normally you won't need to call this method, as it's called implicitly
 *! by @[SDL.Event->poll()].
 *!
 *! @seealso
 *!  @[get_key_state()], @[get_mod_state()]
 */
#define f_pump_events_defined

#ifdef f_pump_events_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_pump_events_fun_num = 0;

#endif /* f_pump_events_fun_num_used */
DEFAULT_CMOD_STORAGE void f_pump_events(INT32 args) {
#line 2411 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("pump_events",args,0);
#line 2411 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
SDL_PumpEvents();
}

}
/*! @decl int num_joysticks()
 *!
 *! @returns
 *!  The number of joysticks available to the system.
 *!
 *! @seealso
 *!  @[SDL.Joystick]
 */
#define f_num_joysticks_defined

#ifdef f_num_joysticks_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_num_joysticks_fun_num = 0;

#endif /* f_num_joysticks_fun_num_used */
DEFAULT_CMOD_STORAGE void f_num_joysticks(INT32 args) {
#line 2423 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("num_joysticks",args,0);
#line 2423 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_NumJoysticks());  push_int(ret_); return; }while(0);
#line 2425 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl string joystick_name(int device_index)
 *!
 *! Returns the implementation-dependent name of the @i{n@}th joystick
 *! device available to the system.
 *!
 *! @param device_index
 *!  The @i{n@}th joystick device.
 *!
 *! @returns
 *!  The implementation-dependent name of the given joystick device.
 *!
 *! @seealso
 *!  @[SDL.Joystick->name()]
 */
#define f_joystick_name_defined

#ifdef f_joystick_name_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_joystick_name_fun_num = 0;

#endif /* f_joystick_name_fun_num_used */
DEFAULT_CMOD_STORAGE void f_joystick_name(INT32 args) {
#line 2441 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE device_index;
#line 2441 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("joystick_name",args,1);
#line 2441 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("joystick_name",1,"int");
#line 2441 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
device_index=Pike_sp[0-1].u.integer;
#line 2441 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
const char *name = SDL_JoystickName(device_index);
pop_n_elems(args);
if(name == NULL) {
push_int(0);
} else {
push_text(name);
}
}

}
/*! @decl int joystick_opened(int device_index)
 *!
 *! Determines whether the given joystick device has already been opened.
 *!
 *! @param device_index
 *!  The @i{n@}th joystick device.
 *!
 *! @returns
 *!  @expr{1@} if this device has already been opened, otherwise @expr{0@}.
 */
#define f_joystick_opened_defined

#ifdef f_joystick_opened_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_joystick_opened_fun_num = 0;

#endif /* f_joystick_opened_fun_num_used */
DEFAULT_CMOD_STORAGE void f_joystick_opened(INT32 args) {
#line 2461 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE device_index;
#line 2461 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("joystick_opened",args,1);
#line 2461 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("joystick_opened",1,"int");
#line 2461 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
device_index=Pike_sp[0-1].u.integer;
#line 2461 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_JoystickOpened(device_index)); pop_stack(); push_int(ret_); return; }while(0);
#line 2463 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl void joystick_update()
 *!
 *! Updates the state of all open joysticks attached to the system.
 */
#define f_joystick_update_defined

#ifdef f_joystick_update_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_joystick_update_fun_num = 0;

#endif /* f_joystick_update_fun_num_used */
DEFAULT_CMOD_STORAGE void f_joystick_update(INT32 args) {
#line 2469 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("joystick_update",args,0);
#line 2469 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
SDL_JoystickUpdate();
}

}
/*! @decl int joystick_event_state(int state)
 *!
 *! Enables, disables or queries the state of joystick event processing.
 *!
 *! @param state
 *!  One of the following constants:
 *!  @dl
 *!    @item
 *!     @[SDL.ENABLE]
 *!
 *!      Enables joystick event processing.
 *!    @item
 *!     @[SDL.IGNORE]
 *!
 *!      Disables joystick event processing.
 *!    @item
 *!     @[SDL.QUERY]
 *!
 *!      Queries the current state and returns it.
 *!  @enddl
 *!
 *! @returns
 *!   The current state of joystick event processing.  If @[state] was
 *!   @[SDL.ENABLE] or @[SDL.IGNORE], then processing will now be enabled
 *!   or disabled, respectively.
 */
#define f_joystick_event_state_defined

#ifdef f_joystick_event_state_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_joystick_event_state_fun_num = 0;

#endif /* f_joystick_event_state_fun_num_used */
DEFAULT_CMOD_STORAGE void f_joystick_event_state(INT32 args) {
#line 2499 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE state;
#line 2499 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("joystick_event_state",args,1);
#line 2499 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("joystick_event_state",1,"int");
#line 2499 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
state=Pike_sp[0-1].u.integer;
#line 2499 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_JoystickEventState(state)); pop_stack(); push_int(ret_); return; }while(0);
#line 2501 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}
}
#line 2502 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#endif

/* CD Related methods */

/*! @class CDTrack
 *!
 *! @decl int id
 *! @decl int length
 *! @decl int offset
 *! @decl int type
 *!
 *! @fixme
 *!   Document this variable
 */

#undef class_CDTrack_defined
#define class_CDTrack_defined
DEFAULT_CMOD_STORAGE struct program *CDTrack_program=NULL;

#ifdef CDTrack_program_fun_num_used
DEFAULT_CMOD_STORAGE int CDTrack_program_fun_num=-1;
#endif /* CDTrack_program_fun_num_used */

#undef var_track_CDTrack_defined
#define var_track_CDTrack_defined

#undef THIS
#define THIS ((struct CDTrack_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_CDTRACK
#define THIS_CDTRACK ((struct CDTrack_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_CDTRACK
#define OBJ2_CDTRACK(o) ((struct CDTrack_struct *)(o->storage+CDTrack_storage_offset))

#undef GET_CDTRACK_STORAGE
#define GET_CDTRACK_STORAGE(o) ((struct CDTrack_struct *)(o->storage+CDTrack_storage_offset)
static ptrdiff_t CDTrack_storage_offset;
struct CDTrack_struct {

#ifdef var_track_CDTrack_defined
#line 2517 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
SDL_CDtrack track;
#endif /* var_track_CDTrack_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct CDTrack_struct *CDTrack_gdb_dummy_ptr;
#endif

#undef internal_init_CDTrack_defined
#define internal_init_CDTrack_defined

#undef CDTrack_event_handler_defined
#define CDTrack_event_handler_defined
static void init_CDTrack_struct(void)
#line 2518 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
THIS->track.id = 0;
THIS->track.type = 0;
THIS->track.length = 0;
THIS->track.offset = 0;
}
#define f_CDTrack_cq__backtickid_defined

#ifdef f_CDTrack_cq__backtickid_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CDTrack_cq__backtickid_fun_num = 0;

#endif /* f_CDTrack_cq__backtickid_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CDTrack_cq__backtickid(INT32 args) {
#line 2524 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`id",args,0);
{
push_int(THIS->track.id);
}
}
#define f_CDTrack_cq__backticklength_defined

#ifdef f_CDTrack_cq__backticklength_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CDTrack_cq__backticklength_fun_num = 0;

#endif /* f_CDTrack_cq__backticklength_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CDTrack_cq__backticklength(INT32 args) {
#line 2528 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`length",args,0);
{
push_int(THIS->track.length);
}
}
#define f_CDTrack_cq__backtickoffset_defined

#ifdef f_CDTrack_cq__backtickoffset_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CDTrack_cq__backtickoffset_fun_num = 0;

#endif /* f_CDTrack_cq__backtickoffset_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CDTrack_cq__backtickoffset(INT32 args) {
#line 2532 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`offset",args,0);
{
push_int(THIS->track.offset);
}
}
#define f_CDTrack_cq__backticktype_defined

#ifdef f_CDTrack_cq__backticktype_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CDTrack_cq__backticktype_fun_num = 0;

#endif /* f_CDTrack_cq__backticktype_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CDTrack_cq__backticktype(INT32 args) {
#line 2536 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`type",args,0);
{
push_int(THIS->track.type);
}
}

#ifdef CDTrack_event_handler_defined
static void CDTrack_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_CDTrack_defined
  case PROG_EVENT_INIT: init_CDTrack_struct(); break;

#endif /* internal_init_CDTrack_defined */
  default: break; 
  }
}

#endif /* CDTrack_event_handler_defined */
/*! @endclass
 */

/*! @class CD
 */
#line 2546 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#define CHECK_INIT() if((THIS->generation != cdrom_generation) || (THIS->cd == NULL)) { Pike_error("CD unitialized!\n"); }

#undef class_CD_defined
#define class_CD_defined
DEFAULT_CMOD_STORAGE struct program *CD_program=NULL;

#ifdef CD_program_fun_num_used
DEFAULT_CMOD_STORAGE int CD_program_fun_num=-1;
#endif /* CD_program_fun_num_used */

#undef var_cd_CD_defined
#define var_cd_CD_defined

#undef var_generation_CD_defined
#define var_generation_CD_defined

#undef THIS
#define THIS ((struct CD_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_CD
#define THIS_CD ((struct CD_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_CD
#define OBJ2_CD(o) ((struct CD_struct *)(o->storage+CD_storage_offset))

#undef GET_CD_STORAGE
#define GET_CD_STORAGE(o) ((struct CD_struct *)(o->storage+CD_storage_offset)
static ptrdiff_t CD_storage_offset;
struct CD_struct {

#ifdef var_cd_CD_defined
#line 2548 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
SDL_CD *cd;
#endif /* var_cd_CD_defined */

#ifdef var_generation_CD_defined
#line 2549 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
int generation;
#endif /* var_generation_CD_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct CD_struct *CD_gdb_dummy_ptr;
#endif

#undef internal_init_CD_defined
#define internal_init_CD_defined

#undef CD_event_handler_defined
#define CD_event_handler_defined
static void init_CD_struct(void)
#line 2550 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
THIS->cd = NULL;
THIS->generation = cdrom_generation;
}

#undef internal_exit_CD_defined
#define internal_exit_CD_defined

#undef CD_event_handler_defined
#define CD_event_handler_defined
static void exit_CD_struct(void)
#line 2556 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
if((THIS->generation == cdrom_generation) && THIS->cd) {
SDL_CDClose(THIS->cd);
THIS->cd = NULL;
};
}

/*! @decl void create(int drive)
   *!
   *! @fixme
   *!   Document this function
   */
#define f_CD_create_defined

#ifdef f_CD_create_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CD_create_fun_num = 0;

#endif /* f_CD_create_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CD_create(INT32 args) {
#line 2568 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE drive;
#line 2568 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("create",args,1);
#line 2568 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("create",1,"int");
#line 2568 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
drive=Pike_sp[0-1].u.integer;
#line 2568 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
THIS->cd = SDL_CDOpen(drive);
if(!THIS->cd) {
Pike_error("Failed to open CD %"PRINTPIKEINT"d: %s\n", drive, SDL_GetError());
}
THIS->generation = cdrom_generation;
}

}
/*! @decl int current_frame
   *!
   *! @fixme
   *!   Document this variable
   */
#define f_CD_cq__backtickcurrent_frame_defined

#ifdef f_CD_cq__backtickcurrent_frame_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CD_cq__backtickcurrent_frame_fun_num = 0;

#endif /* f_CD_cq__backtickcurrent_frame_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CD_cq__backtickcurrent_frame(INT32 args) {
#line 2581 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`current_frame",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->cd->cur_frame);
}

}
/*! @decl int current_track
   *!
   *! @fixme
   *!   Document this variable
   */
#define f_CD_cq__backtickcurrent_track_defined

#ifdef f_CD_cq__backtickcurrent_track_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CD_cq__backtickcurrent_track_fun_num = 0;

#endif /* f_CD_cq__backtickcurrent_track_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CD_cq__backtickcurrent_track(INT32 args) {
#line 2592 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`current_track",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->cd->cur_track);
}

}
/*! @decl int id
   *!
   *! @fixme
   *!   Document this variable
   */
#define f_CD_cq__backtickid_defined

#ifdef f_CD_cq__backtickid_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CD_cq__backtickid_fun_num = 0;

#endif /* f_CD_cq__backtickid_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CD_cq__backtickid(INT32 args) {
#line 2603 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`id",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->cd->id);
}

}
/*! @decl int numtracks
   *!
   *! @fixme
   *!   Document this variable
   */
#define f_CD_cq__backticknumtracks_defined

#ifdef f_CD_cq__backticknumtracks_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CD_cq__backticknumtracks_fun_num = 0;

#endif /* f_CD_cq__backticknumtracks_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CD_cq__backticknumtracks(INT32 args) {
#line 2614 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`numtracks",args,0);
{
CHECK_INIT(); /* Make sure this is inited */
push_int(THIS->cd->numtracks);
}

}
/*! @decl CDTrack track(int track)
   *!
   *! @fixme
   *!   Document this function
   */
#define f_CD_track_defined

#ifdef f_CD_track_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CD_track_fun_num = 0;

#endif /* f_CD_track_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CD_track(INT32 args) {
#line 2625 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE track;
#line 2625 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("track",args,1);
#line 2625 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("track",1,"int");
#line 2625 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
track=Pike_sp[0-1].u.integer;
#line 2625 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
struct object *trackobj;
CHECK_INIT(); /* Make sure this is inited */
if(track >= THIS->cd->numtracks || track < 0) {
Pike_error("Track ID out of range.\n");
}
trackobj = clone_object( CDTrack_program, 0 );
OBJ2_CDTRACK(trackobj)->track = THIS->cd->track[track];
do { struct object * ret_=(trackobj); pop_stack(); push_object(ret_); return; }while(0);
#line 2634 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int status()
   *!
   *! @fixme
   *!   Document this function
   */
#define f_CD_status_defined

#ifdef f_CD_status_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CD_status_fun_num = 0;

#endif /* f_CD_status_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CD_status(INT32 args) {
#line 2641 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("status",args,0);
#line 2641 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT(); /* Make sure this is inited */
do { INT_TYPE ret_=(SDL_CDStatus(THIS->cd));  push_int(ret_); return; }while(0);
#line 2644 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int play(int start, int length)
   *!
   *! @fixme
   *!   Document this function
   */
#define f_CD_play_defined

#ifdef f_CD_play_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CD_play_fun_num = 0;

#endif /* f_CD_play_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CD_play(INT32 args) {
#line 2651 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE start;
#line 2651 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE length;
#line 2651 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 2) wrong_number_of_args_error("play",args,2);
#line 2651 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("play",1,"int");
#line 2651 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
start=Pike_sp[0-2].u.integer;
#line 2651 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("play",2,"int");
#line 2651 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
length=Pike_sp[1-2].u.integer;
#line 2651 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT(); /* Make sure this is inited */
do { INT_TYPE ret_=(SDL_CDPlay(THIS->cd, start, length)); pop_n_elems(2); push_int(ret_); return; }while(0);
#line 2654 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int play_tracks(int start_track, int start_frame, @
   *!                       int ntracks, int nframes)
   *!
   *! @fixme
   *!   Document this function
   */
#define f_CD_play_tracks_defined

#ifdef f_CD_play_tracks_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CD_play_tracks_fun_num = 0;

#endif /* f_CD_play_tracks_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CD_play_tracks(INT32 args) {
#line 2662 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE start_track;
#line 2662 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE start_frame;
INT_TYPE ntracks;
#line 2663 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE nframes;
#line 2662 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 4) wrong_number_of_args_error("play_tracks",args,4);
#line 2662 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("play_tracks",1,"int");
#line 2662 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
start_track=Pike_sp[0-4].u.integer;
#line 2662 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("play_tracks",2,"int");
#line 2662 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
start_frame=Pike_sp[1-4].u.integer;
if(TYPEOF(Pike_sp[2-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("play_tracks",3,"int");
#line 2663 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
ntracks=Pike_sp[2-4].u.integer;
#line 2663 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[3-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("play_tracks",4,"int");
#line 2663 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
nframes=Pike_sp[3-4].u.integer;
#line 2663 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT(); /* Make sure this is inited */
do { INT_TYPE ret_=(SDL_CDPlayTracks(THIS->cd, start_track, start_frame,
ntracks, nframes)); pop_n_elems(4); push_int(ret_); return; }while(0);
#line 2667 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int pause()
   *!
   *! @fixme
   *!   Document this function
   */
#define f_CD_pause_defined

#ifdef f_CD_pause_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CD_pause_fun_num = 0;

#endif /* f_CD_pause_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CD_pause(INT32 args) {
#line 2674 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("pause",args,0);
#line 2674 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT(); /* Make sure this is inited */
do { INT_TYPE ret_=(SDL_CDPause(THIS->cd));  push_int(ret_); return; }while(0);
#line 2677 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int resume()
   *!
   *! @fixme
   *!   Document this function
   */
#define f_CD_resume_defined

#ifdef f_CD_resume_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CD_resume_fun_num = 0;

#endif /* f_CD_resume_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CD_resume(INT32 args) {
#line 2684 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("resume",args,0);
#line 2684 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT(); /* Make sure this is inited */
do { INT_TYPE ret_=(SDL_CDResume(THIS->cd));  push_int(ret_); return; }while(0);
#line 2687 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int stop()
   *!
   *! @fixme
   *!   Document this function
   */
#define f_CD_stop_defined

#ifdef f_CD_stop_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CD_stop_fun_num = 0;

#endif /* f_CD_stop_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CD_stop(INT32 args) {
#line 2694 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("stop",args,0);
#line 2694 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT(); /* Make sure this is inited */
do { INT_TYPE ret_=(SDL_CDStop(THIS->cd));  push_int(ret_); return; }while(0);
#line 2697 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int eject()
   *!
   *! @fixme
   *!   Document this function
   */
#define f_CD_eject_defined

#ifdef f_CD_eject_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CD_eject_fun_num = 0;

#endif /* f_CD_eject_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CD_eject(INT32 args) {
#line 2704 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("eject",args,0);
#line 2704 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
CHECK_INIT(); /* Make sure this is inited */
do { INT_TYPE ret_=(SDL_CDEject(THIS->cd));  push_int(ret_); return; }while(0);
#line 2707 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}
}

#ifdef CD_event_handler_defined
static void CD_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_CD_defined
  case PROG_EVENT_INIT: init_CD_struct(); break;

#endif /* internal_init_CD_defined */

#ifdef internal_exit_CD_defined
  case PROG_EVENT_EXIT: exit_CD_struct(); break;

#endif /* internal_exit_CD_defined */
  default: break; 
  }
}

#endif /* CD_event_handler_defined */
#line 2709 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#undef CHECK_INIT

/*! @endclass
 */

/*! @decl int cd_num_drives()
 *!
 *! @returns
 *!  The number of CD-ROM drives on the system.
 *!
 *! @seealso
 *!  @[SDL.cd_name()]
 */
#define f_cd_num_drives_defined

#ifdef f_cd_num_drives_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_cd_num_drives_fun_num = 0;

#endif /* f_cd_num_drives_fun_num_used */
DEFAULT_CMOD_STORAGE void f_cd_num_drives(INT32 args) {
#line 2722 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("cd_num_drives",args,0);
#line 2722 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_CDNumDrives());  push_int(ret_); return; }while(0);
#line 2724 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl string|void cd_name(int drive)
 *!
 *! Returns a human-readable and system-dependent name for the given drive.
 *!
 *! @param drive
 *!  The CD drive index.
 *!
 *! @returns
 *!  A human-readable and system-dependent name for the given drive,
 *!  or @expr{0@} if no name is available.
 *!
 *! @seealso
 *!  @[SDL.cd_num_drives()]
 */
#define f_cd_name_defined

#ifdef f_cd_name_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_cd_name_fun_num = 0;

#endif /* f_cd_name_fun_num_used */
DEFAULT_CMOD_STORAGE void f_cd_name(INT32 args) {
#line 2740 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE drive;
#line 2740 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("cd_name",args,1);
#line 2740 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("cd_name",1,"int");
#line 2740 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
drive=Pike_sp[0-1].u.integer;
#line 2740 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
const char *name = SDL_CDName(drive);
pop_n_elems(args);
if(name != NULL) {
push_text(name);
} else {
push_int(0);
}
}

}
#line 2750 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#ifdef HAVE_SDL_MIXER
/* This section contains all audio code, and it requires the SDL_mixer
 * library.
 */

/*! @class Music
 *!
 *! Use an @[SDL.Music] object to load in a music file or sample and
 *! then play it back using an internal player.
 *!
 *! You must call @[SDL.init()] with the @[SDL.INIT_AUDIO] flag for
 *! audio support to be available.  You must also first set up some
 *! audio parameters with a call to @[SDL.open_audio()].
 *!
 *! @seealso
 *!  @[SDL.open_audio()]
 */

#undef class_Music_defined
#define class_Music_defined
DEFAULT_CMOD_STORAGE struct program *Music_program=NULL;

#ifdef Music_program_fun_num_used
DEFAULT_CMOD_STORAGE int Music_program_fun_num=-1;
#endif /* Music_program_fun_num_used */

#undef var_music_Music_defined
#define var_music_Music_defined

#undef var_generation_Music_defined
#define var_generation_Music_defined

#undef THIS
#define THIS ((struct Music_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_MUSIC
#define THIS_MUSIC ((struct Music_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_MUSIC
#define OBJ2_MUSIC(o) ((struct Music_struct *)(o->storage+Music_storage_offset))

#undef GET_MUSIC_STORAGE
#define GET_MUSIC_STORAGE(o) ((struct Music_struct *)(o->storage+Music_storage_offset)
static ptrdiff_t Music_storage_offset;
struct Music_struct {

#ifdef var_music_Music_defined
#line 2768 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
Mix_Music *music;
#endif /* var_music_Music_defined */

#ifdef var_generation_Music_defined
#line 2769 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
int generation;
#endif /* var_generation_Music_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Music_struct *Music_gdb_dummy_ptr;
#endif

#undef internal_init_Music_defined
#define internal_init_Music_defined

#undef Music_event_handler_defined
#define Music_event_handler_defined
static void init_Music_struct(void)
#line 2771 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
THIS->music = NULL;
}

#undef internal_exit_Music_defined
#define internal_exit_Music_defined

#undef Music_event_handler_defined
#define Music_event_handler_defined
static void exit_Music_struct(void)
#line 2776 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
if((THIS->generation == audio_generation) && (THIS->music != NULL)) {
Mix_FreeMusic(THIS->music);
THIS->music = NULL;
}
}

/*! @decl void create(string fname)
   *!
   *! Loads in the given music file and initializes the object ready
   *! for playback.
   *!
   *! Supported formats are OGG, MP3, MOD, MID and WAV.
   *!
   *! An exception is thrown if the file fails to load.
   *!
   *! @param fname
   *!  The name of the music file to be loaded.
   */
#define f_Music_create_defined

#ifdef f_Music_create_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Music_create_fun_num = 0;

#endif /* f_Music_create_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Music_create(INT32 args) {
#line 2795 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct pike_string * fname;
#line 2795 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("create",args,1);
#line 2795 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_STRING) SIMPLE_ARG_TYPE_ERROR("create",1,"string");
#line 2795 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
debug_malloc_pass(fname=Pike_sp[0-1].u.string);
#line 2795 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
if((THIS->generation == audio_generation) && (THIS->music)) {
/* Since you can manually call this... */
Mix_FreeMusic(THIS->music);
}
THIS->music = Mix_LoadMUS(fname->str);
if(THIS->music == NULL) {
Pike_error("Failed to load %S: %s\n",
fname, SDL_GetError());
}
THIS->generation = audio_generation;
}

}
/*! @decl object pause()
   *!
   *! Pauses the music playback.
   *!
   *! It is safe to call this method when the music is already paused.
   *!
   *! @returns
   *!  The @[SDL.Music] object.
   *!
   *! @seealso
   *!  @[resume()], @[paused()]
   */
#define f_Music_pause_defined

#ifdef f_Music_pause_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Music_pause_fun_num = 0;

#endif /* f_Music_pause_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Music_pause(INT32 args) {
#line 2820 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("pause",args,0);
#line 2820 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
Mix_PauseMusic();
RET_THIS();
}

}
/*! @decl object halt()
   *!
   *! Stops music playback immediately, including any fader effects.
   *!
   *! @returns
   *!  The @[SDL.Music] object.
   */
#define f_Music_halt_defined

#ifdef f_Music_halt_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Music_halt_fun_num = 0;

#endif /* f_Music_halt_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Music_halt(INT32 args) {
#line 2832 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("halt",args,0);
#line 2832 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
Mix_HaltMusic();
RET_THIS();
}

}
/*! @decl object resume()
   *!
   *! Resume music playback after a call to @[pause()].
   *!
   *! It is safe to call this method when the music isn't paused.
   *!
   *! @returns
   *!  The @[SDL.Music] object.
   *!
   *! @seealso
   *!  @[pause()], @[paused()]
   */
#define f_Music_resume_defined

#ifdef f_Music_resume_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Music_resume_fun_num = 0;

#endif /* f_Music_resume_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Music_resume(INT32 args) {
#line 2849 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("resume",args,0);
#line 2849 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
Mix_ResumeMusic();
RET_THIS();
}

}
/*! @decl object rewind()
   *!
   *! Rewinds the music to the start and resumes playback.
   *!
   *! If the music was paused at the time of this call, you will still
   *! need to call @[resume()] to restart playback.
   *!
   *! This function works only for MOD, OGG, MP3 and Native MIDI streams.
   *!
   *! @returns
   *!  The @[SDL.Music] object.
   */
#define f_Music_rewind_defined

#ifdef f_Music_rewind_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Music_rewind_fun_num = 0;

#endif /* f_Music_rewind_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Music_rewind(INT32 args) {
#line 2866 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("rewind",args,0);
#line 2866 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
Mix_RewindMusic();
RET_THIS();
}

}
#line 2871 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
/* Status queries */
/*! @decl int paused()
   *!
   *! Determines if the music is already paused.
   *!
   *! @returns
   *!  @expr{1@} if the music is paused, otherwise @expr{0@}.
   */
#define f_Music_paused_defined

#ifdef f_Music_paused_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Music_paused_fun_num = 0;

#endif /* f_Music_paused_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Music_paused(INT32 args) {
#line 2879 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("paused",args,0);
#line 2879 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(Mix_PausedMusic());  push_int(ret_); return; }while(0);
#line 2881 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int playing()
   *!
   *! Determines if the music is already playing.
   *!
   *! This method will return @expr{1@} even if the music has been paused.
   *!
   *! @returns
   *!  @expr{1@} if the music is playing, otherwise @expr{0@}.
   */
#define f_Music_playing_defined

#ifdef f_Music_playing_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Music_playing_fun_num = 0;

#endif /* f_Music_playing_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Music_playing(INT32 args) {
#line 2892 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("playing",args,0);
#line 2892 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(Mix_PlayingMusic());  push_int(ret_); return; }while(0);
#line 2894 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int fading()
   *!
   *! Determines the current state of fading for this @[SDL.Music] object.
   *!
   *! @returns
   *!  One of the following constants:
   *!  @dl
   *!   @item
   *!    @[SDL.MIX_NO_FADING]
   *!   @item
   *!    @[SDL.MIX_FADING_IN]
   *!   @item
   *!    @[SDL.MIX_FADING_OUT]
   *!  @enddl
   *!
   *! @seealso
   *!  @[fade_in()], @[fade_out()]
   */
#define f_Music_fading_defined

#ifdef f_Music_fading_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Music_fading_fun_num = 0;

#endif /* f_Music_fading_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Music_fading(INT32 args) {
#line 2914 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("fading",args,0);
#line 2914 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(Mix_FadingMusic());  push_int(ret_); return; }while(0);
#line 2916 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl object play(int|void loops)
   *!
   *! Starts playback.  Repeats @tt{loops@} number of times.
   *!
   *! @param loops
   *!  The number of times the music should be looped (i.e. repeated).
   *!  If @tt{loops@} is @expr{-1@} or omitted, the music will repeat
   *!  indefinitely.
   *!
   *! @returns
   *!  The @[SDL.Music] object.
   */
#define f_Music_play_defined

#ifdef f_Music_play_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Music_play_fun_num = 0;

#endif /* f_Music_play_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Music_play(INT32 args) {
#line 2930 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct svalue * _loops;
#line 2930 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args > 1) wrong_number_of_args_error("play",args,1);
#line 2930 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if ((args > 0) &&
    ((TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) ||
     (SUBTYPEOF(Pike_sp[0-args]) != NUMBER_UNDEFINED))) {
#line 2930 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("play",1,"int|void");
#line 2930 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
_loops=Pike_sp+0-args; dmalloc_touch_svalue(Pike_sp+0-args);
#line 2930 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
} else _loops = NULL;
#line 2930 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
int loops = -1;
if(_loops) {
if(TYPEOF(*_loops) == PIKE_T_INT) {
loops = _loops->u.integer;
} else {
SIMPLE_BAD_ARG_ERROR("play", 1, "void|int");
}
}
Mix_PlayMusic(THIS->music, loops);
RET_THIS();
}

}
/*! @decl object fade_in(int ms, int|void loops)
   *!
   *! Fades the music in over the given number of milliseconds.
   *! Playback is repeated @tt{loops@} number of times.
   *!
   *! The fade-in will only happen on the first play, not on subsequent loops.
   *! Likewise, calling this method on an object that is already playing has
   *! the same effect as @[rewind()]: playback will start over at the
   *! beginning but without fading in.
   *!
   *! @param ms
   *!  Music fades in over this number of milliseconds.
   *!
   *! @param loops
   *!  How many times the music should be repeated (looped).
   *!  Passing a value of @expr{0@} here means the music
   *!  plays once over - i.e. no repeats.  A value of @expr{-1@}
   *!  loops the music indefinitely.  This is the default if you
   *!  don't specify a value.
   *!
   *! @returns
   *!  The @[SDL.Music] object.
   *!
   *! @seealso
   *!  @[fade_out()], @[fading()]
   */
#define f_Music_fade_in_defined

#ifdef f_Music_fade_in_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Music_fade_in_fun_num = 0;

#endif /* f_Music_fade_in_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Music_fade_in(INT32 args) {
#line 2969 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE ms;
#line 2969 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
struct svalue * _loops;
#line 2969 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args < 1) wrong_number_of_args_error("fade_in",args,1);
#line 2969 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args > 2) wrong_number_of_args_error("fade_in",args,2);
#line 2969 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("fade_in",1,"int");
#line 2969 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
ms=Pike_sp[0-args].u.integer;
#line 2969 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if ((args > 1) &&
    ((TYPEOF(Pike_sp[1-args]) != PIKE_T_INT) ||
     (SUBTYPEOF(Pike_sp[1-args]) != NUMBER_UNDEFINED))) {
#line 2969 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("fade_in",2,"int|void");
#line 2969 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
_loops=Pike_sp+1-args; dmalloc_touch_svalue(Pike_sp+1-args);
#line 2969 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
} else _loops = NULL;
#line 2969 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
int loops = -1;
if(_loops) {
if(TYPEOF(*_loops) == PIKE_T_INT) {
loops = _loops->u.integer;
} else {
SIMPLE_BAD_ARG_ERROR("fade_in", 2, "void|int");
}
}
Mix_FadeInMusic(THIS->music, loops, ms);
RET_THIS();
}

}
/*! @decl object fade_out(int ms)
   *!
   *! Fades the music out over the given number of milliseconds.
   *!
   *! After @tt{ms@} milliseconds have passed, the music will be stopped;
   *! i.e. @[playing()] will return @expr{0@}.
   *!
   *! @param ms
   *!  The number of milliseconds it will take to fade out the music,
   *!  starting from now.
   *!
   *! @returns
   *!  The @[SDL.Music] object.
   */
#define f_Music_fade_out_defined

#ifdef f_Music_fade_out_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Music_fade_out_fun_num = 0;

#endif /* f_Music_fade_out_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Music_fade_out(INT32 args) {
#line 2996 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE ms;
#line 2996 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("fade_out",args,1);
#line 2996 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("fade_out",1,"int");
#line 2996 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
ms=Pike_sp[0-1].u.integer;
#line 2996 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
Mix_FadeOutMusic(ms);
RET_THIS();
}

}
/*! @decl float set_volume(float vol)
   *!
   *! Sets the volume for music playback.
   *!
   *! @param vol
   *!  The volume to set.  This is a float value from @expr{0.0@}
   *!  (silent) to @expr{1.0@} (full volume).  Values
   *!  above and below these limits will be clamped.
   *!
   *! @returns
   *!  The previous volume setting.
   */
#define f_Music_set_volume_defined

#ifdef f_Music_set_volume_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Music_set_volume_fun_num = 0;

#endif /* f_Music_set_volume_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Music_set_volume(INT32 args) {
#line 3013 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
FLOAT_TYPE vol;
#line 3013 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 1) wrong_number_of_args_error("set_volume",args,1);
#line 3013 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_FLOAT) SIMPLE_ARG_TYPE_ERROR("set_volume",1,"float");
#line 3013 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
vol=Pike_sp[0-1].u.float_number;
#line 3013 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
if(vol > 1.0) { vol = 1.0; }
else if(vol < 0.0) { vol = 0.0; }
do { FLOAT_TYPE ret_=((FLOAT_TYPE)Mix_VolumeMusic((int)(128 * vol)) / 128.0); pop_stack(); push_float(ret_); return; }while(0);
#line 3017 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl float volume()
   *!
   *! @returns
   *!  The current volume setting.  This is a float value from
   *!  @expr{0.0@} (silent) to @expr{1.0@} (full volume).
   */
#define f_Music_volume_defined

#ifdef f_Music_volume_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Music_volume_fun_num = 0;

#endif /* f_Music_volume_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Music_volume(INT32 args) {
#line 3025 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("volume",args,0);
#line 3025 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { FLOAT_TYPE ret_=((FLOAT_TYPE)Mix_VolumeMusic(-1) / 128.0);  push_float(ret_); return; }while(0);
#line 3027 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}
}

#ifdef Music_event_handler_defined
static void Music_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Music_defined
  case PROG_EVENT_INIT: init_Music_struct(); break;

#endif /* internal_init_Music_defined */

#ifdef internal_exit_Music_defined
  case PROG_EVENT_EXIT: exit_Music_struct(); break;

#endif /* internal_exit_Music_defined */
  default: break; 
  }
}

#endif /* Music_event_handler_defined */
/*! @endclass
 */

/*! @decl void open_audio(int frequency, int format, int channels, int bufsize)
 *!
 *! Initializes the audio API.
 *!
 *! Throws an exception if audio can't be initialized.
 *!
 *! @param frequency
 *!  Output sampling frequency, measured in samples per second (Hz).
 *!  A value of @expr{44100@} provides CD-quality playback.
 *!  A less CPU-intensive value for games is @expr{22050@}.
 *!
 *! @param format
 *!  Output sample format.  One of the following constants:
 *!   @dl
 *!    @item SDL.AUDIO_U8
 *!     Unsigned 8-bit samples.
 *!    @item SDL.AUDIO_S8
 *!     Signed 8-bit samples.
 *!    @item SDL.AUDIO_U16LSB
 *!     Unsigned 16-bit samples in little-endian byte order.
 *!    @item SDL.AUDIO_S16LSB
 *!     Signed 16-bit samples in little-endian byte order.
 *!    @item SDL.AUDIO_U16MSB
 *!     Unsigned 16-bit samples in big-endian byte order.
 *!    @item SDL.AUDIO_S16MSB
 *!     Signed 16-bit samples in big-endian byte order.
 *!    @item SDL.AUDIO_U16
 *!     Same as SDL.AUDIO_U16LSB.
 *!    @item SDL.AUDIO_S16
 *!     Same as SDL.AUDIO_S16LSB.
 *!    @item SDL.AUDIO_U16SYS
 *!     Unsigned 16-bit samples in system byte order.
 *!    @item SDL.AUDIO_S16SYS
 *!     Signed 16-bit samples in system byte order.
 *!     If in doubt, try this one first.
 *!   @enddl
 *!
 *! @param channels
 *!  Number of sound channels in output: @expr{1@} for mono,
 *!  @expr{2@} for stereo.
 *!
 *! @param bufsize
 *!  How many bytes to use per output sample.
 *!  @expr{1024@} is a typical value for games.  If just playing
 *!  music you might set this to @expr{4096@} or higher.
 */
#define f_open_audio_defined

#ifdef f_open_audio_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_open_audio_fun_num = 0;

#endif /* f_open_audio_fun_num_used */
DEFAULT_CMOD_STORAGE void f_open_audio(INT32 args) {
#line 3079 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE frequency;
#line 3079 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE format;
#line 3079 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE channels;
#line 3079 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
INT_TYPE bufsize;
#line 3079 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 4) wrong_number_of_args_error("open_audio",args,4);
#line 3079 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[0-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("open_audio",1,"int");
#line 3079 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
frequency=Pike_sp[0-4].u.integer;
#line 3079 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[1-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("open_audio",2,"int");
#line 3079 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
format=Pike_sp[1-4].u.integer;
#line 3079 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[2-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("open_audio",3,"int");
#line 3079 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
channels=Pike_sp[2-4].u.integer;
#line 3079 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(TYPEOF(Pike_sp[3-4]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("open_audio",4,"int");
#line 3079 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
bufsize=Pike_sp[3-4].u.integer;
#line 3079 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
SDL_InitSubSystem(SDL_INIT_AUDIO); /* Just in case */
if(Mix_OpenAudio(frequency, format, channels, bufsize) == -1) {
Pike_error("Failed to open audio: %s\n", SDL_GetError());
}
}

}
#line 3086 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
/* HAVE_SDL_MIXER */
#endif


/* SDL_event handling */

/*! @class Event
 */

#undef class_Event_defined
#define class_Event_defined
DEFAULT_CMOD_STORAGE struct program *Event_program=NULL;

#ifdef Event_program_fun_num_used
DEFAULT_CMOD_STORAGE int Event_program_fun_num=-1;
#endif /* Event_program_fun_num_used */

#undef var_event_Event_defined
#define var_event_Event_defined

#undef THIS
#define THIS ((struct Event_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_EVENT
#define THIS_EVENT ((struct Event_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_EVENT
#define OBJ2_EVENT(o) ((struct Event_struct *)(o->storage+Event_storage_offset))

#undef GET_EVENT_STORAGE
#define GET_EVENT_STORAGE(o) ((struct Event_struct *)(o->storage+Event_storage_offset)
static ptrdiff_t Event_storage_offset;
struct Event_struct {

#ifdef var_event_Event_defined
#line 3095 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
SDL_Event event;
#endif /* var_event_Event_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Event_struct *Event_gdb_dummy_ptr;
#endif

#undef internal_init_Event_defined
#define internal_init_Event_defined

#undef Event_event_handler_defined
#define Event_event_handler_defined
static void init_Event_struct(void)
#line 3097 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
THIS->event.type = SDL_NOEVENT;
}

/*! @decl int get()
   *!
   *! Removes the next event (if any) from the queue and stores it in this
   *! @[SDL.Event] object.
   *!
   *! @returns
   *!  1 if there was an event to 'get', otherwise 0.
   */
#define f_Event_get_defined

#ifdef f_Event_get_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_get_fun_num = 0;

#endif /* f_Event_get_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_get(INT32 args) {
#line 3109 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("get",args,0);
#line 3109 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_PollEvent(&THIS->event));  push_int(ret_); return; }while(0);
#line 3111 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int wait()
   *!
   *! Waits indefinitely for the next available event, which is then removed
   *! from the queue and stored in this @[SDL.Event] object.
   *!
   *! @returns
   *!  Returns 1 on success, or 0 if there was an error while waiting for the
   *!  next event.
   */
#define f_Event_wait_defined

#ifdef f_Event_wait_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_wait_fun_num = 0;

#endif /* f_Event_wait_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_wait(INT32 args) {
#line 3122 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("wait",args,0);
#line 3122 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_WaitEvent(&THIS->event));  push_int(ret_); return; }while(0);
#line 3124 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int poll()
   *!
   *! Polls for currently pending events.
   *!
   *! @returns
   *!  1 if there are currently pending events, otherwise 0.
   */
#define f_Event_poll_defined

#ifdef f_Event_poll_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_poll_fun_num = 0;

#endif /* f_Event_poll_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_poll(INT32 args) {
#line 3133 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("poll",args,0);
#line 3133 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
{
do { INT_TYPE ret_=(SDL_PollEvent(NULL));  push_int(ret_); return; }while(0);
#line 3135 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
}

}
/*! @decl int axis
   *! @decl int ball
   *! @decl int button
   *! @decl int code
   *! @decl int gain
   *! @decl int h
   *! @decl int hat
   *! @decl Keysym keysym
   *! @decl int state
   *! @decl int type
   *! @decl int value
   *! @decl int w
   *! @decl int which
   *! @decl int x
   *! @decl int xrel
   *! @decl int y
   *! @decl int yrel
   */

#line 3156 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#define ASSERT_EVENT(TYPE, SYM) do {  \
    if (THIS->event.type != TYPE) \
      Pike_error("Event->" SYM " is not valid for this event type. \n"); \
  } while(0)

#define f_Event_cq__backtickaxis_defined

#ifdef f_Event_cq__backtickaxis_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backtickaxis_fun_num = 0;

#endif /* f_Event_cq__backtickaxis_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backtickaxis(INT32 args) {
#line 3161 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`axis",args,0);
{
ASSERT_EVENT(SDL_JOYAXISMOTION, "axis");
push_int(THIS->event.jaxis.axis);
}
}
#define f_Event_cq__backtickball_defined

#ifdef f_Event_cq__backtickball_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backtickball_fun_num = 0;

#endif /* f_Event_cq__backtickball_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backtickball(INT32 args) {
#line 3166 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`ball",args,0);
{
ASSERT_EVENT(SDL_JOYBALLMOTION, "ball");
push_int(THIS->event.jball.ball);
}
}
#define f_Event_cq__backtickbutton_defined

#ifdef f_Event_cq__backtickbutton_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backtickbutton_fun_num = 0;

#endif /* f_Event_cq__backtickbutton_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backtickbutton(INT32 args) {
#line 3171 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`button",args,0);
{
switch(THIS->event.type) {
case SDL_JOYBUTTONDOWN:
case SDL_JOYBUTTONUP:
push_int(THIS->event.jbutton.button); return;
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
push_int(THIS->event.button.button); return;
default:
Pike_error("Event->button is not valid for this event type. \n");
}
}
}
#define f_Event_cq__backtickcode_defined

#ifdef f_Event_cq__backtickcode_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backtickcode_fun_num = 0;

#endif /* f_Event_cq__backtickcode_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backtickcode(INT32 args) {
#line 3184 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`code",args,0);
{
ASSERT_EVENT(SDL_USEREVENT, "code");
push_int(THIS->event.user.code);
}
}
#define f_Event_cq__backtickgain_defined

#ifdef f_Event_cq__backtickgain_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backtickgain_fun_num = 0;

#endif /* f_Event_cq__backtickgain_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backtickgain(INT32 args) {
#line 3189 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`gain",args,0);
{
ASSERT_EVENT(SDL_ACTIVEEVENT, "gain");
push_int(THIS->event.active.gain);
}
}
#define f_Event_cq__backtickh_defined

#ifdef f_Event_cq__backtickh_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backtickh_fun_num = 0;

#endif /* f_Event_cq__backtickh_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backtickh(INT32 args) {
#line 3194 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`h",args,0);
{
ASSERT_EVENT(SDL_VIDEORESIZE, "h");
push_int(THIS->event.resize.h);
}
}
#define f_Event_cq__backtickhat_defined

#ifdef f_Event_cq__backtickhat_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backtickhat_fun_num = 0;

#endif /* f_Event_cq__backtickhat_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backtickhat(INT32 args) {
#line 3199 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`hat",args,0);
{
ASSERT_EVENT(SDL_JOYHATMOTION, "hat");
push_int(THIS->event.jhat.hat);
}
}
#define f_Event_cq__backtickkeysym_defined

#ifdef f_Event_cq__backtickkeysym_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backtickkeysym_fun_num = 0;

#endif /* f_Event_cq__backtickkeysym_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backtickkeysym(INT32 args) {
#line 3204 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`keysym",args,0);
{
struct object *keysym_obj;
switch(THIS->event.type) {
case SDL_KEYDOWN:
case SDL_KEYUP:
keysym_obj = clone_object(Keysym_program, 0);
OBJ2_KEYSYM(keysym_obj)->keysym = THIS->event.key.keysym;
push_object(keysym_obj);
return;
default:
Pike_error("Event->keysym is not valid for this event type. \n");
}
}
}
#define f_Event_cq__backtickstate_defined

#ifdef f_Event_cq__backtickstate_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backtickstate_fun_num = 0;

#endif /* f_Event_cq__backtickstate_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backtickstate(INT32 args) {
#line 3218 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`state",args,0);
{
switch(THIS->event.type) {
case SDL_ACTIVEEVENT:
push_int(THIS->event.active.state); return;
case SDL_JOYBUTTONDOWN:
case SDL_JOYBUTTONUP:
push_int(THIS->event.jbutton.state); return;
case SDL_KEYDOWN:
case SDL_KEYUP:
push_int(THIS->event.key.state); return;
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
push_int(THIS->event.button.state); return;
case SDL_MOUSEMOTION:
push_int(THIS->event.motion.state); return;
default:
Pike_error("Event->state is not valid for this event type. \n");
}
}
}
#define f_Event_cq__backticktype_defined

#ifdef f_Event_cq__backticktype_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backticktype_fun_num = 0;

#endif /* f_Event_cq__backticktype_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backticktype(INT32 args) {
#line 3238 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`type",args,0);
{
push_int(THIS->event.type);
}
}
#define f_Event_cq__backtickvalue_defined

#ifdef f_Event_cq__backtickvalue_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backtickvalue_fun_num = 0;

#endif /* f_Event_cq__backtickvalue_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backtickvalue(INT32 args) {
#line 3242 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`value",args,0);
{
switch(THIS->event.type) {
case SDL_JOYAXISMOTION:
push_int(THIS->event.jaxis.value); return;
case SDL_JOYHATMOTION:
push_int(THIS->event.jhat.value); return;
default:
Pike_error("Event->value is not valid for this event type. \n");
}
}
}
#define f_Event_cq__backtickw_defined

#ifdef f_Event_cq__backtickw_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backtickw_fun_num = 0;

#endif /* f_Event_cq__backtickw_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backtickw(INT32 args) {
#line 3253 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`w",args,0);
{
ASSERT_EVENT(SDL_VIDEORESIZE, "w");
push_int(THIS->event.resize.w);
}
}
#define f_Event_cq__backtickwhich_defined

#ifdef f_Event_cq__backtickwhich_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backtickwhich_fun_num = 0;

#endif /* f_Event_cq__backtickwhich_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backtickwhich(INT32 args) {
#line 3258 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`which",args,0);
{
switch(THIS->event.type) {
case SDL_JOYAXISMOTION:
push_int(THIS->event.jaxis.which); return;
case SDL_JOYBALLMOTION:
push_int(THIS->event.jball.which); return;
case SDL_JOYBUTTONDOWN:
case SDL_JOYBUTTONUP:
push_int(THIS->event.jbutton.which); return;
case SDL_JOYHATMOTION:
push_int(THIS->event.jhat.which); return;
case SDL_KEYDOWN:
case SDL_KEYUP:
push_int(THIS->event.key.which); return;
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
push_int(THIS->event.button.which); return;
case SDL_MOUSEMOTION:
push_int(THIS->event.motion.which); return;
default:
Pike_error("Event->which is not valid for this event type. \n");
}
}
}
#define f_Event_cq__backtickx_defined

#ifdef f_Event_cq__backtickx_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backtickx_fun_num = 0;

#endif /* f_Event_cq__backtickx_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backtickx(INT32 args) {
#line 3282 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`x",args,0);
{
switch(THIS->event.type) {
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
push_int(THIS->event.button.x); return;
case SDL_MOUSEMOTION:
push_int(THIS->event.motion.x); return;
default:
Pike_error("Event->x is not valid for this event type. \n");
}
}
}
#define f_Event_cq__backtickxrel_defined

#ifdef f_Event_cq__backtickxrel_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backtickxrel_fun_num = 0;

#endif /* f_Event_cq__backtickxrel_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backtickxrel(INT32 args) {
#line 3294 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`xrel",args,0);
{
switch(THIS->event.type) {
case SDL_JOYBALLMOTION:
push_int(THIS->event.jball.xrel); return;
case SDL_MOUSEMOTION:
push_int(THIS->event.motion.xrel); return;
default:
Pike_error("Event->xrel is not valid for this event type. \n");
}
}
}
#define f_Event_cq__backticky_defined

#ifdef f_Event_cq__backticky_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backticky_fun_num = 0;

#endif /* f_Event_cq__backticky_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backticky(INT32 args) {
#line 3305 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`y",args,0);
{
switch(THIS->event.type) {
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
push_int(THIS->event.button.y); return;
case SDL_MOUSEMOTION:
push_int(THIS->event.motion.y); return;
default:
Pike_error("Event->y is not valid for this event type. \n");
}
}
}
#define f_Event_cq__backtickyrel_defined

#ifdef f_Event_cq__backtickyrel_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Event_cq__backtickyrel_fun_num = 0;

#endif /* f_Event_cq__backtickyrel_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Event_cq__backtickyrel(INT32 args) {
#line 3317 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
if(args != 0) wrong_number_of_args_error("`yrel",args,0);
{
switch(THIS->event.type) {
case SDL_JOYBALLMOTION:
push_int(THIS->event.jball.yrel); return;
case SDL_MOUSEMOTION:
push_int(THIS->event.motion.yrel); return;
default:
Pike_error("Event->yrel is not valid for this event type. \n");
}
}
}

#ifdef Event_event_handler_defined
static void Event_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Event_defined
  case PROG_EVENT_INIT: init_Event_struct(); break;

#endif /* internal_init_Event_defined */
  default: break; 
  }
}

#endif /* Event_event_handler_defined */
/*! @endclass
 */

#line 3333 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
/* Pike initialization modules below */

PIKE_MODULE_INIT
{

#ifdef CMOD_MAP_PROGRAM_IDS_DEFINED
set_program_id_to_id( ___cmod_map_program_ids );

#endif /* CMOD_MAP_PROGRAM_IDS_DEFINED */

#ifdef class_Rect_defined

#ifdef PROG_RECT_ID
#line 352 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  START_NEW_PROGRAM_ID(RECT);
#else
#line 352 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  start_new_program();

#endif /* PROG_RECT_ID */
#line 352 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  Rect_program = Pike_compiler->new_program;

#ifndef tObjImpl_RECT

#undef tObjIs_RECT
#define tObjIs_RECT "\3\1\177\0\0\2"

#undef tObjImpl_RECT
#define tObjImpl_RECT "\3\0\177\0\0\2"

#endif /* tObjImpl_RECT */

#ifdef THIS_RECT
  Rect_storage_offset = ADD_STORAGE(struct Rect_struct);
#endif /* THIS_RECT */

#ifdef Rect_event_handler_defined
  pike_set_prog_event_callback(Rect_event_handler);

#ifndef Rect_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Rect_gc_live_obj */

#endif /* Rect_event_handler_defined */

#ifdef f_Rect_create_defined

#ifdef Rect_f_Rect_create_fun_num_used
  Rect_f_Rect_create_fun_num =
#endif /* Rect_f_Rect_create_fun_num_used */
#line 390 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("create", f_Rect_create, tOr3(tFunc(tNone,tVoid),tFunc("\10\377\377\200\0\0\0\177\377" "\10\377\377\200\0\0\0\177\377",tVoid),tFunc("\10\377\377\200\0\0\0\177\377" "\10\377\377\200\0\0\0\177\377" "\10\0\0\0\0\0\0\377\377" "\10\0\0\0\0\0\0\377\377",tVoid)), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Rect_create_defined */

#ifdef f_Rect_cq__backtickx_defined

#ifdef f_Rect_cq__backtickx_fun_num_used
  f_Rect_cq__backtickx_fun_num =
#endif /* f_Rect_cq__backtickx_fun_num_used */
#line 409 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`x", f_Rect_cq__backtickx, tFunc(tNone,"\10\377\377\200\0\0\0\177\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Rect_cq__backtickx_defined */

#ifdef f_Rect_cq__backticky_defined

#ifdef f_Rect_cq__backticky_fun_num_used
  f_Rect_cq__backticky_fun_num =
#endif /* f_Rect_cq__backticky_fun_num_used */
#line 413 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`y", f_Rect_cq__backticky, tFunc(tNone,"\10\377\377\200\0\0\0\177\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Rect_cq__backticky_defined */

#ifdef f_Rect_cq__backtickx_eq_defined

#ifdef f_Rect_cq__backtickx_eq_fun_num_used
  f_Rect_cq__backtickx_eq_fun_num =
#endif /* f_Rect_cq__backtickx_eq_fun_num_used */
#line 417 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`x=", f_Rect_cq__backtickx_eq, tFunc("\10\377\377\200\0\0\0\177\377","\10\377\377\200\0\0\0\177\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Rect_cq__backtickx_eq_defined */

#ifdef f_Rect_cq__backticky_eq_defined

#ifdef f_Rect_cq__backticky_eq_fun_num_used
  f_Rect_cq__backticky_eq_fun_num =
#endif /* f_Rect_cq__backticky_eq_fun_num_used */
#line 422 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`y=", f_Rect_cq__backticky_eq, tFunc("\10\377\377\200\0\0\0\177\377","\10\377\377\200\0\0\0\177\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Rect_cq__backticky_eq_defined */

#ifdef f_Rect_cq__backtickw_defined

#ifdef f_Rect_cq__backtickw_fun_num_used
  f_Rect_cq__backtickw_fun_num =
#endif /* f_Rect_cq__backtickw_fun_num_used */
#line 434 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`w", f_Rect_cq__backtickw, tFunc(tNone,"\10\0\0\0\0\0\0\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Rect_cq__backtickw_defined */

#ifdef f_Rect_cq__backtickh_defined

#ifdef f_Rect_cq__backtickh_fun_num_used
  f_Rect_cq__backtickh_fun_num =
#endif /* f_Rect_cq__backtickh_fun_num_used */
#line 438 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`h", f_Rect_cq__backtickh, tFunc(tNone,"\10\0\0\0\0\0\0\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Rect_cq__backtickh_defined */

#ifdef f_Rect_cq__backtickw_eq_defined

#ifdef f_Rect_cq__backtickw_eq_fun_num_used
  f_Rect_cq__backtickw_eq_fun_num =
#endif /* f_Rect_cq__backtickw_eq_fun_num_used */
#line 443 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`w=", f_Rect_cq__backtickw_eq, tFunc("\10\0\0\0\0\0\0\377\377","\10\0\0\0\0\0\0\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Rect_cq__backtickw_eq_defined */

#ifdef f_Rect_cq__backtickh_eq_defined

#ifdef f_Rect_cq__backtickh_eq_fun_num_used
  f_Rect_cq__backtickh_eq_fun_num =
#endif /* f_Rect_cq__backtickh_eq_fun_num_used */
#line 448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`h=", f_Rect_cq__backtickh_eq, tFunc("\10\0\0\0\0\0\0\377\377","\10\0\0\0\0\0\0\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Rect_cq__backtickh_eq_defined */

#ifdef f_Rect_cast_defined

#ifdef f_Rect_cast_fun_num_used
  f_Rect_cast_fun_num =
#endif /* f_Rect_cast_fun_num_used */
#line 461 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("cast", f_Rect_cast, tFunc(tStr,tOr(tArray,tMapping)), ID_PROTECTED, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Rect_cast_defined */
#line 352 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  Rect_program=end_program();
#line 352 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#ifdef Rect_program_fun_num_used
Rect_program_fun_num=
#endif
 add_program_constant("Rect",Rect_program,0);

#endif /* class_Rect_defined */

#ifdef class_Keysym_defined

#ifdef PROG_KEYSYM_ID
#line 494 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  START_NEW_PROGRAM_ID(KEYSYM);
#else
#line 494 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  start_new_program();

#endif /* PROG_KEYSYM_ID */
#line 494 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  Keysym_program = Pike_compiler->new_program;

#ifndef tObjImpl_KEYSYM

#undef tObjIs_KEYSYM
#define tObjIs_KEYSYM "\3\1\177\0\0\3"

#undef tObjImpl_KEYSYM
#define tObjImpl_KEYSYM "\3\0\177\0\0\3"

#endif /* tObjImpl_KEYSYM */

#ifdef THIS_KEYSYM
  Keysym_storage_offset = ADD_STORAGE(struct Keysym_struct);
#endif /* THIS_KEYSYM */

#ifdef f_Keysym_cq__backtickmod_defined

#ifdef f_Keysym_cq__backtickmod_fun_num_used
  f_Keysym_cq__backtickmod_fun_num =
#endif /* f_Keysym_cq__backtickmod_fun_num_used */
#line 503 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`mod", f_Keysym_cq__backtickmod, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Keysym_cq__backtickmod_defined */

#ifdef f_Keysym_cq__backtickscancode_defined

#ifdef f_Keysym_cq__backtickscancode_fun_num_used
  f_Keysym_cq__backtickscancode_fun_num =
#endif /* f_Keysym_cq__backtickscancode_fun_num_used */
#line 515 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`scancode", f_Keysym_cq__backtickscancode, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Keysym_cq__backtickscancode_defined */

#ifdef f_Keysym_cq__backticksym_defined

#ifdef f_Keysym_cq__backticksym_fun_num_used
  f_Keysym_cq__backticksym_fun_num =
#endif /* f_Keysym_cq__backticksym_fun_num_used */
#line 528 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`sym", f_Keysym_cq__backticksym, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Keysym_cq__backticksym_defined */

#ifdef f_Keysym_cq__backtickunicode_defined

#ifdef f_Keysym_cq__backtickunicode_fun_num_used
  f_Keysym_cq__backtickunicode_fun_num =
#endif /* f_Keysym_cq__backtickunicode_fun_num_used */
#line 546 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`unicode", f_Keysym_cq__backtickunicode, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Keysym_cq__backtickunicode_defined */
#line 494 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  Keysym_program=end_program();
#line 494 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#ifdef Keysym_program_fun_num_used
Keysym_program_fun_num=
#endif
 add_program_constant("Keysym",Keysym_program,0);

#endif /* class_Keysym_defined */

#ifdef class_PixelFormat_defined

#ifdef PROG_PIXELFORMAT_ID
#line 572 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  START_NEW_PROGRAM_ID(PIXELFORMAT);
#else
#line 572 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  start_new_program();

#endif /* PROG_PIXELFORMAT_ID */
#line 572 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  PixelFormat_program = Pike_compiler->new_program;

#ifndef tObjImpl_PIXELFORMAT

#undef tObjIs_PIXELFORMAT
#define tObjIs_PIXELFORMAT "\3\1\177\0\0\4"

#undef tObjImpl_PIXELFORMAT
#define tObjImpl_PIXELFORMAT "\3\0\177\0\0\4"

#endif /* tObjImpl_PIXELFORMAT */

#ifdef THIS_PIXELFORMAT
  PixelFormat_storage_offset = ADD_STORAGE(struct PixelFormat_struct);
#endif /* THIS_PIXELFORMAT */

#ifdef PixelFormat_event_handler_defined
  pike_set_prog_event_callback(PixelFormat_event_handler);

#ifndef PixelFormat_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* PixelFormat_gc_live_obj */

#endif /* PixelFormat_event_handler_defined */

#ifdef f_PixelFormat_cq__backtickrloss_defined

#ifdef f_PixelFormat_cq__backtickrloss_fun_num_used
  f_PixelFormat_cq__backtickrloss_fun_num =
#endif /* f_PixelFormat_cq__backtickrloss_fun_num_used */
#line 590 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`rloss", f_PixelFormat_cq__backtickrloss, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickrloss_defined */

#ifdef f_PixelFormat_cq__backtickgloss_defined

#ifdef f_PixelFormat_cq__backtickgloss_fun_num_used
  f_PixelFormat_cq__backtickgloss_fun_num =
#endif /* f_PixelFormat_cq__backtickgloss_fun_num_used */
#line 595 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`gloss", f_PixelFormat_cq__backtickgloss, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickgloss_defined */

#ifdef f_PixelFormat_cq__backtickbloss_defined

#ifdef f_PixelFormat_cq__backtickbloss_fun_num_used
  f_PixelFormat_cq__backtickbloss_fun_num =
#endif /* f_PixelFormat_cq__backtickbloss_fun_num_used */
#line 600 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`bloss", f_PixelFormat_cq__backtickbloss, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickbloss_defined */

#ifdef f_PixelFormat_cq__backtickaloss_defined

#ifdef f_PixelFormat_cq__backtickaloss_fun_num_used
  f_PixelFormat_cq__backtickaloss_fun_num =
#endif /* f_PixelFormat_cq__backtickaloss_fun_num_used */
#line 605 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`aloss", f_PixelFormat_cq__backtickaloss, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickaloss_defined */

#ifdef f_PixelFormat_cq__backtickrmask_defined

#ifdef f_PixelFormat_cq__backtickrmask_fun_num_used
  f_PixelFormat_cq__backtickrmask_fun_num =
#endif /* f_PixelFormat_cq__backtickrmask_fun_num_used */
#line 617 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`rmask", f_PixelFormat_cq__backtickrmask, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickrmask_defined */

#ifdef f_PixelFormat_cq__backtickgmask_defined

#ifdef f_PixelFormat_cq__backtickgmask_fun_num_used
  f_PixelFormat_cq__backtickgmask_fun_num =
#endif /* f_PixelFormat_cq__backtickgmask_fun_num_used */
#line 622 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`gmask", f_PixelFormat_cq__backtickgmask, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickgmask_defined */

#ifdef f_PixelFormat_cq__backtickbmask_defined

#ifdef f_PixelFormat_cq__backtickbmask_fun_num_used
  f_PixelFormat_cq__backtickbmask_fun_num =
#endif /* f_PixelFormat_cq__backtickbmask_fun_num_used */
#line 627 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`bmask", f_PixelFormat_cq__backtickbmask, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickbmask_defined */

#ifdef f_PixelFormat_cq__backtickamask_defined

#ifdef f_PixelFormat_cq__backtickamask_fun_num_used
  f_PixelFormat_cq__backtickamask_fun_num =
#endif /* f_PixelFormat_cq__backtickamask_fun_num_used */
#line 632 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`amask", f_PixelFormat_cq__backtickamask, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickamask_defined */

#ifdef f_PixelFormat_cq__backtickrshift_defined

#ifdef f_PixelFormat_cq__backtickrshift_fun_num_used
  f_PixelFormat_cq__backtickrshift_fun_num =
#endif /* f_PixelFormat_cq__backtickrshift_fun_num_used */
#line 644 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`rshift", f_PixelFormat_cq__backtickrshift, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickrshift_defined */

#ifdef f_PixelFormat_cq__backtickgshift_defined

#ifdef f_PixelFormat_cq__backtickgshift_fun_num_used
  f_PixelFormat_cq__backtickgshift_fun_num =
#endif /* f_PixelFormat_cq__backtickgshift_fun_num_used */
#line 649 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`gshift", f_PixelFormat_cq__backtickgshift, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickgshift_defined */

#ifdef f_PixelFormat_cq__backtickbshift_defined

#ifdef f_PixelFormat_cq__backtickbshift_fun_num_used
  f_PixelFormat_cq__backtickbshift_fun_num =
#endif /* f_PixelFormat_cq__backtickbshift_fun_num_used */
#line 654 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`bshift", f_PixelFormat_cq__backtickbshift, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickbshift_defined */

#ifdef f_PixelFormat_cq__backtickashift_defined

#ifdef f_PixelFormat_cq__backtickashift_fun_num_used
  f_PixelFormat_cq__backtickashift_fun_num =
#endif /* f_PixelFormat_cq__backtickashift_fun_num_used */
#line 659 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`ashift", f_PixelFormat_cq__backtickashift, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickashift_defined */

#ifdef f_PixelFormat_cq__backtickalpha_defined

#ifdef f_PixelFormat_cq__backtickalpha_fun_num_used
  f_PixelFormat_cq__backtickalpha_fun_num =
#endif /* f_PixelFormat_cq__backtickalpha_fun_num_used */
    ADD_FUNCTION2("`alpha", f_PixelFormat_cq__backtickalpha, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickalpha_defined */

#ifdef f_PixelFormat_cq__backtickcolorkey_defined

#ifdef f_PixelFormat_cq__backtickcolorkey_fun_num_used
  f_PixelFormat_cq__backtickcolorkey_fun_num =
#endif /* f_PixelFormat_cq__backtickcolorkey_fun_num_used */
    ADD_FUNCTION2("`colorkey", f_PixelFormat_cq__backtickcolorkey, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickcolorkey_defined */

#ifdef f_PixelFormat_cq__backtickbits_per_pixel_defined

#ifdef f_PixelFormat_cq__backtickbits_per_pixel_fun_num_used
  f_PixelFormat_cq__backtickbits_per_pixel_fun_num =
#endif /* f_PixelFormat_cq__backtickbits_per_pixel_fun_num_used */
#line 687 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`bits_per_pixel", f_PixelFormat_cq__backtickbits_per_pixel, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickbits_per_pixel_defined */

#ifdef f_PixelFormat_cq__backtickbytes_per_pixel_defined

#ifdef f_PixelFormat_cq__backtickbytes_per_pixel_fun_num_used
  f_PixelFormat_cq__backtickbytes_per_pixel_fun_num =
#endif /* f_PixelFormat_cq__backtickbytes_per_pixel_fun_num_used */
#line 697 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`bytes_per_pixel", f_PixelFormat_cq__backtickbytes_per_pixel, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_cq__backtickbytes_per_pixel_defined */

#ifdef f_PixelFormat_losses_defined

#ifdef f_PixelFormat_losses_fun_num_used
  f_PixelFormat_losses_fun_num =
#endif /* f_PixelFormat_losses_fun_num_used */
    ADD_FUNCTION2("losses", f_PixelFormat_losses, tFunc(tNone,tArr("\10\200\0\0\0\177\377\377\377")), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_losses_defined */

#ifdef f_PixelFormat_masks_defined

#ifdef f_PixelFormat_masks_fun_num_used
  f_PixelFormat_masks_fun_num =
#endif /* f_PixelFormat_masks_fun_num_used */
#line 717 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("masks", f_PixelFormat_masks, tFunc(tNone,tArr("\10\200\0\0\0\177\377\377\377")), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_masks_defined */

#ifdef f_PixelFormat_shifts_defined

#ifdef f_PixelFormat_shifts_fun_num_used
  f_PixelFormat_shifts_fun_num =
#endif /* f_PixelFormat_shifts_fun_num_used */
#line 728 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("shifts", f_PixelFormat_shifts, tFunc(tNone,tArr("\10\200\0\0\0\177\377\377\377")), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_shifts_defined */

#ifdef f_PixelFormat_map_rgb_defined

#ifdef PixelFormat_f_PixelFormat_map_rgb_fun_num_used
  PixelFormat_f_PixelFormat_map_rgb_fun_num =
#endif /* PixelFormat_f_PixelFormat_map_rgb_fun_num_used */
#line 768 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("map_rgb", f_PixelFormat_map_rgb, tOr(tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"),tFunc(tObj,"\10\200\0\0\0\177\377\377\377")), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_map_rgb_defined */

#ifdef f_PixelFormat_map_rgba_defined

#ifdef PixelFormat_f_PixelFormat_map_rgba_fun_num_used
  PixelFormat_f_PixelFormat_map_rgba_fun_num =
#endif /* PixelFormat_f_PixelFormat_map_rgba_fun_num_used */
#line 809 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("map_rgba", f_PixelFormat_map_rgba, tOr(tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"),tFunc(tObj "\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377")), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_map_rgba_defined */

#ifdef f_PixelFormat_get_rgb_defined

#ifdef f_PixelFormat_get_rgb_fun_num_used
  f_PixelFormat_get_rgb_fun_num =
#endif /* f_PixelFormat_get_rgb_fun_num_used */
#line 830 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("get_rgb", f_PixelFormat_get_rgb, tFunc("\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_get_rgb_defined */

#ifdef f_PixelFormat_get_rgba_defined

#ifdef f_PixelFormat_get_rgba_fun_num_used
  f_PixelFormat_get_rgba_fun_num =
#endif /* f_PixelFormat_get_rgba_fun_num_used */
#line 856 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("get_rgba", f_PixelFormat_get_rgba, tFunc("\10\200\0\0\0\177\377\377\377",tMap(tStr,tOr(tObj,"\10\200\0\0\0\177\377\377\377"))), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_PixelFormat_get_rgba_defined */
#line 572 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  PixelFormat_program=end_program();
#line 572 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#ifdef PixelFormat_program_fun_num_used
PixelFormat_program_fun_num=
#endif
 add_program_constant("PixelFormat",PixelFormat_program,0);

#endif /* class_PixelFormat_defined */

#ifdef class_VideoInfo_defined

#ifdef PROG_VIDEOINFO_ID
#line 880 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  START_NEW_PROGRAM_ID(VIDEOINFO);
#else
#line 880 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  start_new_program();

#endif /* PROG_VIDEOINFO_ID */
#line 880 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  VideoInfo_program = Pike_compiler->new_program;

#ifndef tObjImpl_VIDEOINFO

#undef tObjIs_VIDEOINFO
#define tObjIs_VIDEOINFO "\3\1\177\0\0\5"

#undef tObjImpl_VIDEOINFO
#define tObjImpl_VIDEOINFO "\3\0\177\0\0\5"

#endif /* tObjImpl_VIDEOINFO */

#ifdef THIS_VIDEOINFO
  VideoInfo_storage_offset = ADD_STORAGE(struct VideoInfo_struct);
#endif /* THIS_VIDEOINFO */

#ifdef VideoInfo_event_handler_defined
  pike_set_prog_event_callback(VideoInfo_event_handler);

#ifndef VideoInfo_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* VideoInfo_gc_live_obj */

#endif /* VideoInfo_event_handler_defined */

#ifdef f_VideoInfo_cq__backtickblit_fill_defined

#ifdef f_VideoInfo_cq__backtickblit_fill_fun_num_used
  f_VideoInfo_cq__backtickblit_fill_fun_num =
#endif /* f_VideoInfo_cq__backtickblit_fill_fun_num_used */
#line 893 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`blit_fill", f_VideoInfo_cq__backtickblit_fill, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_VideoInfo_cq__backtickblit_fill_defined */

#ifdef f_VideoInfo_cq__backtickblit_hw_defined

#ifdef f_VideoInfo_cq__backtickblit_hw_fun_num_used
  f_VideoInfo_cq__backtickblit_hw_fun_num =
#endif /* f_VideoInfo_cq__backtickblit_hw_fun_num_used */
#line 901 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`blit_hw", f_VideoInfo_cq__backtickblit_hw, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_VideoInfo_cq__backtickblit_hw_defined */

#ifdef f_VideoInfo_cq__backtickblit_hw_a_defined

#ifdef f_VideoInfo_cq__backtickblit_hw_a_fun_num_used
  f_VideoInfo_cq__backtickblit_hw_a_fun_num =
#endif /* f_VideoInfo_cq__backtickblit_hw_a_fun_num_used */
#line 909 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`blit_hw_a", f_VideoInfo_cq__backtickblit_hw_a, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_VideoInfo_cq__backtickblit_hw_a_defined */

#ifdef f_VideoInfo_cq__backtickblit_hw_cc_defined

#ifdef f_VideoInfo_cq__backtickblit_hw_cc_fun_num_used
  f_VideoInfo_cq__backtickblit_hw_cc_fun_num =
#endif /* f_VideoInfo_cq__backtickblit_hw_cc_fun_num_used */
#line 917 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`blit_hw_cc", f_VideoInfo_cq__backtickblit_hw_cc, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_VideoInfo_cq__backtickblit_hw_cc_defined */

#ifdef f_VideoInfo_cq__backtickblit_sw_defined

#ifdef f_VideoInfo_cq__backtickblit_sw_fun_num_used
  f_VideoInfo_cq__backtickblit_sw_fun_num =
#endif /* f_VideoInfo_cq__backtickblit_sw_fun_num_used */
#line 925 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`blit_sw", f_VideoInfo_cq__backtickblit_sw, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_VideoInfo_cq__backtickblit_sw_defined */

#ifdef f_VideoInfo_cq__backtickblit_sw_a_defined

#ifdef f_VideoInfo_cq__backtickblit_sw_a_fun_num_used
  f_VideoInfo_cq__backtickblit_sw_a_fun_num =
#endif /* f_VideoInfo_cq__backtickblit_sw_a_fun_num_used */
#line 933 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`blit_sw_a", f_VideoInfo_cq__backtickblit_sw_a, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_VideoInfo_cq__backtickblit_sw_a_defined */

#ifdef f_VideoInfo_cq__backtickblit_sw_cc_defined

#ifdef f_VideoInfo_cq__backtickblit_sw_cc_fun_num_used
  f_VideoInfo_cq__backtickblit_sw_cc_fun_num =
#endif /* f_VideoInfo_cq__backtickblit_sw_cc_fun_num_used */
#line 941 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`blit_sw_cc", f_VideoInfo_cq__backtickblit_sw_cc, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_VideoInfo_cq__backtickblit_sw_cc_defined */

#ifdef f_VideoInfo_cq__backtickhw_available_defined

#ifdef f_VideoInfo_cq__backtickhw_available_fun_num_used
  f_VideoInfo_cq__backtickhw_available_fun_num =
#endif /* f_VideoInfo_cq__backtickhw_available_fun_num_used */
#line 949 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`hw_available", f_VideoInfo_cq__backtickhw_available, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_VideoInfo_cq__backtickhw_available_defined */

#ifdef f_VideoInfo_cq__backtickvideo_mem_defined

#ifdef f_VideoInfo_cq__backtickvideo_mem_fun_num_used
  f_VideoInfo_cq__backtickvideo_mem_fun_num =
#endif /* f_VideoInfo_cq__backtickvideo_mem_fun_num_used */
#line 957 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`video_mem", f_VideoInfo_cq__backtickvideo_mem, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_VideoInfo_cq__backtickvideo_mem_defined */

#ifdef f_VideoInfo_cq__backtickwm_available_defined

#ifdef f_VideoInfo_cq__backtickwm_available_fun_num_used
  f_VideoInfo_cq__backtickwm_available_fun_num =
#endif /* f_VideoInfo_cq__backtickwm_available_fun_num_used */
#line 965 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`wm_available", f_VideoInfo_cq__backtickwm_available, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_VideoInfo_cq__backtickwm_available_defined */

#ifdef f_VideoInfo_cq__backtickformat_defined

#ifdef f_VideoInfo_cq__backtickformat_fun_num_used
  f_VideoInfo_cq__backtickformat_fun_num =
#endif /* f_VideoInfo_cq__backtickformat_fun_num_used */
#line 973 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`format", f_VideoInfo_cq__backtickformat, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_VideoInfo_cq__backtickformat_defined */
#line 880 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  VideoInfo_program=end_program();
#line 880 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#ifdef VideoInfo_program_fun_num_used
VideoInfo_program_fun_num=
#endif
 add_program_constant("VideoInfo",VideoInfo_program,0);

#endif /* class_VideoInfo_defined */

#ifdef class_Surface_defined

#ifdef PROG_SURFACE_ID
#line 993 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  START_NEW_PROGRAM_ID(SURFACE);
#else
#line 993 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  start_new_program();

#endif /* PROG_SURFACE_ID */
#line 993 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  Surface_program = Pike_compiler->new_program;

#ifndef tObjImpl_SURFACE

#undef tObjIs_SURFACE
#define tObjIs_SURFACE "\3\1\177\0\0\6"

#undef tObjImpl_SURFACE
#define tObjImpl_SURFACE "\3\0\177\0\0\6"

#endif /* tObjImpl_SURFACE */

#ifdef THIS_SURFACE
  Surface_storage_offset = ADD_STORAGE(struct Surface_struct);
#endif /* THIS_SURFACE */

#ifdef Surface_event_handler_defined
  pike_set_prog_event_callback(Surface_event_handler);

#ifndef Surface_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Surface_gc_live_obj */

#endif /* Surface_event_handler_defined */

#ifdef f_Surface_get_pixel_defined

#ifdef f_Surface_get_pixel_fun_num_used
  f_Surface_get_pixel_fun_num =
#endif /* f_Surface_get_pixel_fun_num_used */
#line 1045 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("get_pixel", f_Surface_get_pixel, tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_get_pixel_defined */

#ifdef f_Surface_set_pixel_defined

#ifdef f_Surface_set_pixel_fun_num_used
  f_Surface_set_pixel_fun_num =
#endif /* f_Surface_set_pixel_fun_num_used */
#line 1087 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("set_pixel", f_Surface_set_pixel, tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_set_pixel_defined */

#ifdef f_Surface_cq__backtickflags_defined

#ifdef f_Surface_cq__backtickflags_fun_num_used
  f_Surface_cq__backtickflags_fun_num =
#endif /* f_Surface_cq__backtickflags_fun_num_used */
#line 1150 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`flags", f_Surface_cq__backtickflags, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_cq__backtickflags_defined */

#ifdef f_Surface_cq__backtickh_defined

#ifdef f_Surface_cq__backtickh_fun_num_used
  f_Surface_cq__backtickh_fun_num =
#endif /* f_Surface_cq__backtickh_fun_num_used */
#line 1160 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`h", f_Surface_cq__backtickh, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_cq__backtickh_defined */

#ifdef f_Surface_cq__backtickw_defined

#ifdef f_Surface_cq__backtickw_fun_num_used
  f_Surface_cq__backtickw_fun_num =
#endif /* f_Surface_cq__backtickw_fun_num_used */
#line 1165 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`w", f_Surface_cq__backtickw, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_cq__backtickw_defined */

#ifdef f_Surface_cq__backtickpitch_defined

#ifdef f_Surface_cq__backtickpitch_fun_num_used
  f_Surface_cq__backtickpitch_fun_num =
#endif /* f_Surface_cq__backtickpitch_fun_num_used */
#line 1172 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`pitch", f_Surface_cq__backtickpitch, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_cq__backtickpitch_defined */

#ifdef f_Surface_cq__backtickclip_rect_defined

#ifdef f_Surface_cq__backtickclip_rect_fun_num_used
  f_Surface_cq__backtickclip_rect_fun_num =
#endif /* f_Surface_cq__backtickclip_rect_fun_num_used */
#line 1182 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`clip_rect", f_Surface_cq__backtickclip_rect, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_cq__backtickclip_rect_defined */

#ifdef f_Surface_cq__backtickformat_defined

#ifdef f_Surface_cq__backtickformat_fun_num_used
  f_Surface_cq__backtickformat_fun_num =
#endif /* f_Surface_cq__backtickformat_fun_num_used */
#line 1193 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`format", f_Surface_cq__backtickformat, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_cq__backtickformat_defined */

#ifdef f_Surface_lock_defined

#ifdef f_Surface_lock_fun_num_used
  f_Surface_lock_fun_num =
#endif /* f_Surface_lock_fun_num_used */
#line 1221 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("lock", f_Surface_lock, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_lock_defined */

#ifdef f_Surface_unlock_defined

#ifdef f_Surface_unlock_fun_num_used
  f_Surface_unlock_fun_num =
#endif /* f_Surface_unlock_fun_num_used */
#line 1243 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("unlock", f_Surface_unlock, tFunc(tNone,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_unlock_defined */

#ifdef f_Surface_init_defined

#ifdef f_Surface_init_fun_num_used
  f_Surface_init_fun_num =
#endif /* f_Surface_init_fun_num_used */
#line 1320 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("init", f_Surface_init, tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_init_defined */

#ifdef f_Surface_set_image_defined

#ifdef Surface_f_Surface_set_image_fun_num_used
  Surface_f_Surface_set_image_fun_num =
#endif /* Surface_f_Surface_set_image_fun_num_used */
#line 1448 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("set_image", f_Surface_set_image, tOr(tFunc(tObj tOr("\10\200\0\0\0\177\377\377\377",tVoid),tObj),tFunc(tObj tObj tOr("\10\200\0\0\0\177\377\377\377",tVoid),tObj)), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_set_image_defined */

#ifdef f_Surface_display_format_defined

#ifdef f_Surface_display_format_fun_num_used
  f_Surface_display_format_fun_num =
#endif /* f_Surface_display_format_fun_num_used */
#line 1513 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("display_format", f_Surface_display_format, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_display_format_defined */

#ifdef f_Surface_display_format_alpha_defined

#ifdef f_Surface_display_format_alpha_fun_num_used
  f_Surface_display_format_alpha_fun_num =
#endif /* f_Surface_display_format_alpha_fun_num_used */
#line 1545 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("display_format_alpha", f_Surface_display_format_alpha, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_display_format_alpha_defined */

#ifdef f_Surface_blit_defined

#ifdef f_Surface_blit_fun_num_used
  f_Surface_blit_fun_num =
#endif /* f_Surface_blit_fun_num_used */
#line 1575 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("blit", f_Surface_blit, tFunc(tObj tOr(tObj,tVoid) tOr(tObj,tVoid),tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_blit_defined */

#ifdef f_Surface_fill_rect_defined

#ifdef f_Surface_fill_rect_fun_num_used
  f_Surface_fill_rect_fun_num =
#endif /* f_Surface_fill_rect_fun_num_used */
#line 1602 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("fill_rect", f_Surface_fill_rect, tFunc("\10\200\0\0\0\177\377\377\377" tObj,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_fill_rect_defined */

#ifdef f_Surface_fill_defined

#ifdef f_Surface_fill_fun_num_used
  f_Surface_fill_fun_num =
#endif /* f_Surface_fill_fun_num_used */
#line 1616 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("fill", f_Surface_fill, tFunc("\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_fill_defined */

#ifdef f_Surface_set_color_key_defined

#ifdef f_Surface_set_color_key_fun_num_used
  f_Surface_set_color_key_fun_num =
#endif /* f_Surface_set_color_key_fun_num_used */
#line 1632 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("set_color_key", f_Surface_set_color_key, tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_set_color_key_defined */

#ifdef f_Surface_set_alpha_defined

#ifdef f_Surface_set_alpha_fun_num_used
  f_Surface_set_alpha_fun_num =
#endif /* f_Surface_set_alpha_fun_num_used */
#line 1643 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("set_alpha", f_Surface_set_alpha, tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_set_alpha_defined */

#ifdef f_Surface_set_clip_rect_defined

#ifdef f_Surface_set_clip_rect_fun_num_used
  f_Surface_set_clip_rect_fun_num =
#endif /* f_Surface_set_clip_rect_fun_num_used */
#line 1654 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("set_clip_rect", f_Surface_set_clip_rect, tFunc(tObj,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_set_clip_rect_defined */

#ifdef f_Surface_convert_surface_defined

#ifdef f_Surface_convert_surface_fun_num_used
  f_Surface_convert_surface_fun_num =
#endif /* f_Surface_convert_surface_fun_num_used */
#line 1666 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("convert_surface", f_Surface_convert_surface, tFunc(tObj "\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Surface_convert_surface_defined */
#line 993 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  Surface_program=end_program();
#line 993 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#ifdef Surface_program_fun_num_used
Surface_program_fun_num=
#endif
 add_program_constant("Surface",Surface_program,0);

#endif /* class_Surface_defined */

#ifdef class_Joystick_defined

#ifdef PROG_JOYSTICK_ID
#line 2181 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  START_NEW_PROGRAM_ID(JOYSTICK);
#else
#line 2181 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  start_new_program();

#endif /* PROG_JOYSTICK_ID */
#line 2181 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  Joystick_program = Pike_compiler->new_program;

#ifndef tObjImpl_JOYSTICK

#undef tObjIs_JOYSTICK
#define tObjIs_JOYSTICK "\3\1\177\0\0\a"

#undef tObjImpl_JOYSTICK
#define tObjImpl_JOYSTICK "\3\0\177\0\0\a"

#endif /* tObjImpl_JOYSTICK */

#ifdef THIS_JOYSTICK
  Joystick_storage_offset = ADD_STORAGE(struct Joystick_struct);
#endif /* THIS_JOYSTICK */

#ifdef Joystick_event_handler_defined
  pike_set_prog_event_callback(Joystick_event_handler);

#ifndef Joystick_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Joystick_gc_live_obj */

#endif /* Joystick_event_handler_defined */

#ifdef f_Joystick_create_defined

#ifdef f_Joystick_create_fun_num_used
  f_Joystick_create_fun_num =
#endif /* f_Joystick_create_fun_num_used */
#line 2209 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("create", f_Joystick_create, tFunc("\10\200\0\0\0\177\377\377\377",tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Joystick_create_defined */

#ifdef f_Joystick_index_defined

#ifdef f_Joystick_index_fun_num_used
  f_Joystick_index_fun_num =
#endif /* f_Joystick_index_fun_num_used */
#line 2223 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("index", f_Joystick_index, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Joystick_index_defined */

#ifdef f_Joystick_num_axes_defined

#ifdef f_Joystick_num_axes_fun_num_used
  f_Joystick_num_axes_fun_num =
#endif /* f_Joystick_num_axes_fun_num_used */
#line 2233 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("num_axes", f_Joystick_num_axes, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Joystick_num_axes_defined */

#ifdef f_Joystick_num_balls_defined

#ifdef f_Joystick_num_balls_fun_num_used
  f_Joystick_num_balls_fun_num =
#endif /* f_Joystick_num_balls_fun_num_used */
#line 2243 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("num_balls", f_Joystick_num_balls, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Joystick_num_balls_defined */

#ifdef f_Joystick_num_hats_defined

#ifdef f_Joystick_num_hats_fun_num_used
  f_Joystick_num_hats_fun_num =
#endif /* f_Joystick_num_hats_fun_num_used */
#line 2253 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("num_hats", f_Joystick_num_hats, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Joystick_num_hats_defined */

#ifdef f_Joystick_num_buttons_defined

#ifdef f_Joystick_num_buttons_fun_num_used
  f_Joystick_num_buttons_fun_num =
#endif /* f_Joystick_num_buttons_fun_num_used */
#line 2263 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("num_buttons", f_Joystick_num_buttons, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Joystick_num_buttons_defined */

#ifdef f_Joystick_get_axis_defined

#ifdef f_Joystick_get_axis_fun_num_used
  f_Joystick_get_axis_fun_num =
#endif /* f_Joystick_get_axis_fun_num_used */
#line 2283 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("get_axis", f_Joystick_get_axis, tFunc("\10\200\0\0\0\177\377\377\377",tFloat), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Joystick_get_axis_defined */

#ifdef f_Joystick_get_hat_defined

#ifdef f_Joystick_get_hat_fun_num_used
  f_Joystick_get_hat_fun_num =
#endif /* f_Joystick_get_hat_fun_num_used */
#line 2327 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("get_hat", f_Joystick_get_hat, tFunc("\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Joystick_get_hat_defined */

#ifdef f_Joystick_get_ball_defined

#ifdef f_Joystick_get_ball_fun_num_used
  f_Joystick_get_ball_fun_num =
#endif /* f_Joystick_get_ball_fun_num_used */
#line 2346 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("get_ball", f_Joystick_get_ball, tFunc("\10\200\0\0\0\177\377\377\377",tArr("\10\200\0\0\0\177\377\377\377")), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Joystick_get_ball_defined */

#ifdef f_Joystick_get_button_defined

#ifdef f_Joystick_get_button_fun_num_used
  f_Joystick_get_button_fun_num =
#endif /* f_Joystick_get_button_fun_num_used */
#line 2371 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("get_button", f_Joystick_get_button, tFunc("\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Joystick_get_button_defined */

#ifdef f_Joystick_name_defined

#ifdef f_Joystick_name_fun_num_used
  f_Joystick_name_fun_num =
#endif /* f_Joystick_name_fun_num_used */
#line 2384 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("name", f_Joystick_name, tFunc(tNone,tStr), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Joystick_name_defined */
#line 2181 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  Joystick_program=end_program();
#line 2181 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#ifdef Joystick_program_fun_num_used
Joystick_program_fun_num=
#endif
 add_program_constant("Joystick",Joystick_program,0);

#endif /* class_Joystick_defined */

#ifdef class_CDTrack_defined

#ifdef PROG_CDTRACK_ID
#line 2516 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  START_NEW_PROGRAM_ID(CDTRACK);
#else
#line 2516 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  start_new_program();

#endif /* PROG_CDTRACK_ID */
#line 2516 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  CDTrack_program = Pike_compiler->new_program;

#ifndef tObjImpl_CDTRACK

#undef tObjIs_CDTRACK
#define tObjIs_CDTRACK "\3\1\177\0\0\b"

#undef tObjImpl_CDTRACK
#define tObjImpl_CDTRACK "\3\0\177\0\0\b"

#endif /* tObjImpl_CDTRACK */

#ifdef THIS_CDTRACK
  CDTrack_storage_offset = ADD_STORAGE(struct CDTrack_struct);
#endif /* THIS_CDTRACK */

#ifdef CDTrack_event_handler_defined
  pike_set_prog_event_callback(CDTrack_event_handler);

#ifndef CDTrack_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* CDTrack_gc_live_obj */

#endif /* CDTrack_event_handler_defined */

#ifdef f_CDTrack_cq__backtickid_defined

#ifdef f_CDTrack_cq__backtickid_fun_num_used
  f_CDTrack_cq__backtickid_fun_num =
#endif /* f_CDTrack_cq__backtickid_fun_num_used */
#line 2524 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`id", f_CDTrack_cq__backtickid, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CDTrack_cq__backtickid_defined */

#ifdef f_CDTrack_cq__backticklength_defined

#ifdef f_CDTrack_cq__backticklength_fun_num_used
  f_CDTrack_cq__backticklength_fun_num =
#endif /* f_CDTrack_cq__backticklength_fun_num_used */
#line 2528 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`length", f_CDTrack_cq__backticklength, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CDTrack_cq__backticklength_defined */

#ifdef f_CDTrack_cq__backtickoffset_defined

#ifdef f_CDTrack_cq__backtickoffset_fun_num_used
  f_CDTrack_cq__backtickoffset_fun_num =
#endif /* f_CDTrack_cq__backtickoffset_fun_num_used */
#line 2532 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`offset", f_CDTrack_cq__backtickoffset, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CDTrack_cq__backtickoffset_defined */

#ifdef f_CDTrack_cq__backticktype_defined

#ifdef f_CDTrack_cq__backticktype_fun_num_used
  f_CDTrack_cq__backticktype_fun_num =
#endif /* f_CDTrack_cq__backticktype_fun_num_used */
#line 2536 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`type", f_CDTrack_cq__backticktype, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CDTrack_cq__backticktype_defined */
#line 2516 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  CDTrack_program=end_program();
#line 2516 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#ifdef CDTrack_program_fun_num_used
CDTrack_program_fun_num=
#endif
 add_program_constant("CDTrack",CDTrack_program,0);

#endif /* class_CDTrack_defined */

#ifdef class_CD_defined

#ifdef PROG_CD_ID
#line 2547 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  START_NEW_PROGRAM_ID(CD);
#else
#line 2547 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  start_new_program();

#endif /* PROG_CD_ID */
#line 2547 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  CD_program = Pike_compiler->new_program;

#ifndef tObjImpl_CD

#undef tObjIs_CD
#define tObjIs_CD "\3\1\177\0\0\t"

#undef tObjImpl_CD
#define tObjImpl_CD "\3\0\177\0\0\t"

#endif /* tObjImpl_CD */

#ifdef THIS_CD
  CD_storage_offset = ADD_STORAGE(struct CD_struct);
#endif /* THIS_CD */

#ifdef CD_event_handler_defined
  pike_set_prog_event_callback(CD_event_handler);

#ifndef CD_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* CD_gc_live_obj */

#endif /* CD_event_handler_defined */

#ifdef f_CD_create_defined

#ifdef f_CD_create_fun_num_used
  f_CD_create_fun_num =
#endif /* f_CD_create_fun_num_used */
#line 2568 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("create", f_CD_create, tFunc("\10\200\0\0\0\177\377\377\377",tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CD_create_defined */

#ifdef f_CD_cq__backtickcurrent_frame_defined

#ifdef f_CD_cq__backtickcurrent_frame_fun_num_used
  f_CD_cq__backtickcurrent_frame_fun_num =
#endif /* f_CD_cq__backtickcurrent_frame_fun_num_used */
#line 2581 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`current_frame", f_CD_cq__backtickcurrent_frame, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CD_cq__backtickcurrent_frame_defined */

#ifdef f_CD_cq__backtickcurrent_track_defined

#ifdef f_CD_cq__backtickcurrent_track_fun_num_used
  f_CD_cq__backtickcurrent_track_fun_num =
#endif /* f_CD_cq__backtickcurrent_track_fun_num_used */
#line 2592 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`current_track", f_CD_cq__backtickcurrent_track, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CD_cq__backtickcurrent_track_defined */

#ifdef f_CD_cq__backtickid_defined

#ifdef f_CD_cq__backtickid_fun_num_used
  f_CD_cq__backtickid_fun_num =
#endif /* f_CD_cq__backtickid_fun_num_used */
#line 2603 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`id", f_CD_cq__backtickid, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CD_cq__backtickid_defined */

#ifdef f_CD_cq__backticknumtracks_defined

#ifdef f_CD_cq__backticknumtracks_fun_num_used
  f_CD_cq__backticknumtracks_fun_num =
#endif /* f_CD_cq__backticknumtracks_fun_num_used */
#line 2614 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`numtracks", f_CD_cq__backticknumtracks, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CD_cq__backticknumtracks_defined */

#ifdef f_CD_track_defined

#ifdef f_CD_track_fun_num_used
  f_CD_track_fun_num =
#endif /* f_CD_track_fun_num_used */
#line 2625 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("track", f_CD_track, tFunc("\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CD_track_defined */

#ifdef f_CD_status_defined

#ifdef f_CD_status_fun_num_used
  f_CD_status_fun_num =
#endif /* f_CD_status_fun_num_used */
#line 2641 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("status", f_CD_status, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CD_status_defined */

#ifdef f_CD_play_defined

#ifdef f_CD_play_fun_num_used
  f_CD_play_fun_num =
#endif /* f_CD_play_fun_num_used */
#line 2651 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("play", f_CD_play, tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CD_play_defined */

#ifdef f_CD_play_tracks_defined

#ifdef f_CD_play_tracks_fun_num_used
  f_CD_play_tracks_fun_num =
#endif /* f_CD_play_tracks_fun_num_used */
#line 2662 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("play_tracks", f_CD_play_tracks, tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CD_play_tracks_defined */

#ifdef f_CD_pause_defined

#ifdef f_CD_pause_fun_num_used
  f_CD_pause_fun_num =
#endif /* f_CD_pause_fun_num_used */
#line 2674 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("pause", f_CD_pause, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CD_pause_defined */

#ifdef f_CD_resume_defined

#ifdef f_CD_resume_fun_num_used
  f_CD_resume_fun_num =
#endif /* f_CD_resume_fun_num_used */
#line 2684 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("resume", f_CD_resume, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CD_resume_defined */

#ifdef f_CD_stop_defined

#ifdef f_CD_stop_fun_num_used
  f_CD_stop_fun_num =
#endif /* f_CD_stop_fun_num_used */
#line 2694 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("stop", f_CD_stop, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CD_stop_defined */

#ifdef f_CD_eject_defined

#ifdef f_CD_eject_fun_num_used
  f_CD_eject_fun_num =
#endif /* f_CD_eject_fun_num_used */
#line 2704 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("eject", f_CD_eject, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CD_eject_defined */
#line 2547 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  CD_program=end_program();
#line 2547 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#ifdef CD_program_fun_num_used
CD_program_fun_num=
#endif
 add_program_constant("CD",CD_program,0);

#endif /* class_CD_defined */

#ifdef class_Music_defined

#ifdef PROG_MUSIC_ID
#line 2767 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  START_NEW_PROGRAM_ID(MUSIC);
#else
#line 2767 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  start_new_program();

#endif /* PROG_MUSIC_ID */
#line 2767 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  Music_program = Pike_compiler->new_program;

#ifndef tObjImpl_MUSIC

#undef tObjIs_MUSIC
#define tObjIs_MUSIC "\3\1\177\0\0\n"

#undef tObjImpl_MUSIC
#define tObjImpl_MUSIC "\3\0\177\0\0\n"

#endif /* tObjImpl_MUSIC */

#ifdef THIS_MUSIC
  Music_storage_offset = ADD_STORAGE(struct Music_struct);
#endif /* THIS_MUSIC */

#ifdef Music_event_handler_defined
  pike_set_prog_event_callback(Music_event_handler);

#ifndef Music_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Music_gc_live_obj */

#endif /* Music_event_handler_defined */

#ifdef f_Music_create_defined

#ifdef f_Music_create_fun_num_used
  f_Music_create_fun_num =
#endif /* f_Music_create_fun_num_used */
#line 2795 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("create", f_Music_create, tFunc(tStr,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Music_create_defined */

#ifdef f_Music_pause_defined

#ifdef f_Music_pause_fun_num_used
  f_Music_pause_fun_num =
#endif /* f_Music_pause_fun_num_used */
#line 2820 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("pause", f_Music_pause, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Music_pause_defined */

#ifdef f_Music_halt_defined

#ifdef f_Music_halt_fun_num_used
  f_Music_halt_fun_num =
#endif /* f_Music_halt_fun_num_used */
#line 2832 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("halt", f_Music_halt, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Music_halt_defined */

#ifdef f_Music_resume_defined

#ifdef f_Music_resume_fun_num_used
  f_Music_resume_fun_num =
#endif /* f_Music_resume_fun_num_used */
#line 2849 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("resume", f_Music_resume, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Music_resume_defined */

#ifdef f_Music_rewind_defined

#ifdef f_Music_rewind_fun_num_used
  f_Music_rewind_fun_num =
#endif /* f_Music_rewind_fun_num_used */
#line 2866 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("rewind", f_Music_rewind, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Music_rewind_defined */

#ifdef f_Music_paused_defined

#ifdef f_Music_paused_fun_num_used
  f_Music_paused_fun_num =
#endif /* f_Music_paused_fun_num_used */
#line 2879 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("paused", f_Music_paused, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Music_paused_defined */

#ifdef f_Music_playing_defined

#ifdef f_Music_playing_fun_num_used
  f_Music_playing_fun_num =
#endif /* f_Music_playing_fun_num_used */
#line 2892 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("playing", f_Music_playing, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Music_playing_defined */

#ifdef f_Music_fading_defined

#ifdef f_Music_fading_fun_num_used
  f_Music_fading_fun_num =
#endif /* f_Music_fading_fun_num_used */
#line 2914 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("fading", f_Music_fading, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Music_fading_defined */

#ifdef f_Music_play_defined

#ifdef f_Music_play_fun_num_used
  f_Music_play_fun_num =
#endif /* f_Music_play_fun_num_used */
#line 2930 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("play", f_Music_play, tFunc(tOr("\10\200\0\0\0\177\377\377\377",tVoid),tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Music_play_defined */

#ifdef f_Music_fade_in_defined

#ifdef f_Music_fade_in_fun_num_used
  f_Music_fade_in_fun_num =
#endif /* f_Music_fade_in_fun_num_used */
#line 2969 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("fade_in", f_Music_fade_in, tFunc("\10\200\0\0\0\177\377\377\377" tOr("\10\200\0\0\0\177\377\377\377",tVoid),tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Music_fade_in_defined */

#ifdef f_Music_fade_out_defined

#ifdef f_Music_fade_out_fun_num_used
  f_Music_fade_out_fun_num =
#endif /* f_Music_fade_out_fun_num_used */
#line 2996 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("fade_out", f_Music_fade_out, tFunc("\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Music_fade_out_defined */

#ifdef f_Music_set_volume_defined

#ifdef f_Music_set_volume_fun_num_used
  f_Music_set_volume_fun_num =
#endif /* f_Music_set_volume_fun_num_used */
#line 3013 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("set_volume", f_Music_set_volume, tFunc(tFloat,tFloat), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Music_set_volume_defined */

#ifdef f_Music_volume_defined

#ifdef f_Music_volume_fun_num_used
  f_Music_volume_fun_num =
#endif /* f_Music_volume_fun_num_used */
#line 3025 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("volume", f_Music_volume, tFunc(tNone,tFloat), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Music_volume_defined */
#line 2767 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  Music_program=end_program();
#line 2767 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#ifdef Music_program_fun_num_used
Music_program_fun_num=
#endif
 add_program_constant("Music",Music_program,0);

#endif /* class_Music_defined */

#ifdef class_Event_defined

#ifdef PROG_EVENT_ID
#line 3094 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  START_NEW_PROGRAM_ID(EVENT);
#else
#line 3094 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  start_new_program();

#endif /* PROG_EVENT_ID */
#line 3094 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  Event_program = Pike_compiler->new_program;

#ifndef tObjImpl_EVENT

#undef tObjIs_EVENT
#define tObjIs_EVENT "\3\1\177\0\0\v"

#undef tObjImpl_EVENT
#define tObjImpl_EVENT "\3\0\177\0\0\v"

#endif /* tObjImpl_EVENT */

#ifdef THIS_EVENT
  Event_storage_offset = ADD_STORAGE(struct Event_struct);
#endif /* THIS_EVENT */

#ifdef Event_event_handler_defined
  pike_set_prog_event_callback(Event_event_handler);

#ifndef Event_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Event_gc_live_obj */

#endif /* Event_event_handler_defined */

#ifdef f_Event_get_defined

#ifdef f_Event_get_fun_num_used
  f_Event_get_fun_num =
#endif /* f_Event_get_fun_num_used */
#line 3109 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("get", f_Event_get, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_get_defined */

#ifdef f_Event_wait_defined

#ifdef f_Event_wait_fun_num_used
  f_Event_wait_fun_num =
#endif /* f_Event_wait_fun_num_used */
#line 3122 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("wait", f_Event_wait, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_wait_defined */

#ifdef f_Event_poll_defined

#ifdef f_Event_poll_fun_num_used
  f_Event_poll_fun_num =
#endif /* f_Event_poll_fun_num_used */
#line 3133 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("poll", f_Event_poll, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_poll_defined */

#ifdef f_Event_cq__backtickaxis_defined

#ifdef f_Event_cq__backtickaxis_fun_num_used
  f_Event_cq__backtickaxis_fun_num =
#endif /* f_Event_cq__backtickaxis_fun_num_used */
#line 3161 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`axis", f_Event_cq__backtickaxis, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backtickaxis_defined */

#ifdef f_Event_cq__backtickball_defined

#ifdef f_Event_cq__backtickball_fun_num_used
  f_Event_cq__backtickball_fun_num =
#endif /* f_Event_cq__backtickball_fun_num_used */
#line 3166 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`ball", f_Event_cq__backtickball, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backtickball_defined */

#ifdef f_Event_cq__backtickbutton_defined

#ifdef f_Event_cq__backtickbutton_fun_num_used
  f_Event_cq__backtickbutton_fun_num =
#endif /* f_Event_cq__backtickbutton_fun_num_used */
#line 3171 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`button", f_Event_cq__backtickbutton, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backtickbutton_defined */

#ifdef f_Event_cq__backtickcode_defined

#ifdef f_Event_cq__backtickcode_fun_num_used
  f_Event_cq__backtickcode_fun_num =
#endif /* f_Event_cq__backtickcode_fun_num_used */
#line 3184 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`code", f_Event_cq__backtickcode, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backtickcode_defined */

#ifdef f_Event_cq__backtickgain_defined

#ifdef f_Event_cq__backtickgain_fun_num_used
  f_Event_cq__backtickgain_fun_num =
#endif /* f_Event_cq__backtickgain_fun_num_used */
#line 3189 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`gain", f_Event_cq__backtickgain, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backtickgain_defined */

#ifdef f_Event_cq__backtickh_defined

#ifdef f_Event_cq__backtickh_fun_num_used
  f_Event_cq__backtickh_fun_num =
#endif /* f_Event_cq__backtickh_fun_num_used */
#line 3194 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`h", f_Event_cq__backtickh, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backtickh_defined */

#ifdef f_Event_cq__backtickhat_defined

#ifdef f_Event_cq__backtickhat_fun_num_used
  f_Event_cq__backtickhat_fun_num =
#endif /* f_Event_cq__backtickhat_fun_num_used */
#line 3199 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`hat", f_Event_cq__backtickhat, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backtickhat_defined */

#ifdef f_Event_cq__backtickkeysym_defined

#ifdef f_Event_cq__backtickkeysym_fun_num_used
  f_Event_cq__backtickkeysym_fun_num =
#endif /* f_Event_cq__backtickkeysym_fun_num_used */
#line 3204 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`keysym", f_Event_cq__backtickkeysym, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backtickkeysym_defined */

#ifdef f_Event_cq__backtickstate_defined

#ifdef f_Event_cq__backtickstate_fun_num_used
  f_Event_cq__backtickstate_fun_num =
#endif /* f_Event_cq__backtickstate_fun_num_used */
#line 3218 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`state", f_Event_cq__backtickstate, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backtickstate_defined */

#ifdef f_Event_cq__backticktype_defined

#ifdef f_Event_cq__backticktype_fun_num_used
  f_Event_cq__backticktype_fun_num =
#endif /* f_Event_cq__backticktype_fun_num_used */
#line 3238 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`type", f_Event_cq__backticktype, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backticktype_defined */

#ifdef f_Event_cq__backtickvalue_defined

#ifdef f_Event_cq__backtickvalue_fun_num_used
  f_Event_cq__backtickvalue_fun_num =
#endif /* f_Event_cq__backtickvalue_fun_num_used */
#line 3242 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`value", f_Event_cq__backtickvalue, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backtickvalue_defined */

#ifdef f_Event_cq__backtickw_defined

#ifdef f_Event_cq__backtickw_fun_num_used
  f_Event_cq__backtickw_fun_num =
#endif /* f_Event_cq__backtickw_fun_num_used */
#line 3253 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`w", f_Event_cq__backtickw, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backtickw_defined */

#ifdef f_Event_cq__backtickwhich_defined

#ifdef f_Event_cq__backtickwhich_fun_num_used
  f_Event_cq__backtickwhich_fun_num =
#endif /* f_Event_cq__backtickwhich_fun_num_used */
#line 3258 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`which", f_Event_cq__backtickwhich, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backtickwhich_defined */

#ifdef f_Event_cq__backtickx_defined

#ifdef f_Event_cq__backtickx_fun_num_used
  f_Event_cq__backtickx_fun_num =
#endif /* f_Event_cq__backtickx_fun_num_used */
#line 3282 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`x", f_Event_cq__backtickx, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backtickx_defined */

#ifdef f_Event_cq__backtickxrel_defined

#ifdef f_Event_cq__backtickxrel_fun_num_used
  f_Event_cq__backtickxrel_fun_num =
#endif /* f_Event_cq__backtickxrel_fun_num_used */
#line 3294 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`xrel", f_Event_cq__backtickxrel, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backtickxrel_defined */

#ifdef f_Event_cq__backticky_defined

#ifdef f_Event_cq__backticky_fun_num_used
  f_Event_cq__backticky_fun_num =
#endif /* f_Event_cq__backticky_fun_num_used */
#line 3305 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`y", f_Event_cq__backticky, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backticky_defined */

#ifdef f_Event_cq__backtickyrel_defined

#ifdef f_Event_cq__backtickyrel_fun_num_used
  f_Event_cq__backtickyrel_fun_num =
#endif /* f_Event_cq__backtickyrel_fun_num_used */
#line 3317 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("`yrel", f_Event_cq__backtickyrel, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Event_cq__backtickyrel_defined */
#line 3094 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
  Event_program=end_program();
#line 3094 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
#ifdef Event_program_fun_num_used
Event_program_fun_num=
#endif
 add_program_constant("Event",Event_program,0);

#endif /* class_Event_defined */

#ifdef f_init_defined

#ifdef f_init_fun_num_used
  f_init_fun_num =
#endif /* f_init_fun_num_used */
#line 153 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("init", f_init, tFunc("\10\200\0\0\0\177\377\377\377",tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_init_defined */

#ifdef f_get_error_defined

#ifdef f_get_error_fun_num_used
  f_get_error_fun_num =
#endif /* f_get_error_fun_num_used */
#line 165 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("get_error", f_get_error, tFunc(tNone,tOr(tVoid,tStr)), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_get_error_defined */

#ifdef f_init_sub_system_defined

#ifdef f_init_sub_system_fun_num_used
  f_init_sub_system_fun_num =
#endif /* f_init_sub_system_fun_num_used */
#line 186 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("init_sub_system", f_init_sub_system, tFunc("\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_init_sub_system_defined */

#ifdef f_quit_sub_system_defined

#ifdef f_quit_sub_system_fun_num_used
  f_quit_sub_system_fun_num =
#endif /* f_quit_sub_system_fun_num_used */
#line 202 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("quit_sub_system", f_quit_sub_system, tFunc("\10\200\0\0\0\177\377\377\377",tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_quit_sub_system_defined */

#ifdef f_was_init_defined

#ifdef f_was_init_fun_num_used
  f_was_init_fun_num =
#endif /* f_was_init_fun_num_used */
#line 227 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("was_init", f_was_init, tFunc("\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND);

#endif /* f_was_init_defined */

#ifdef f_quit_defined

#ifdef f_quit_fun_num_used
  f_quit_fun_num =
#endif /* f_quit_fun_num_used */
#line 245 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("quit", f_quit, tFunc(tNone,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_quit_defined */

#ifdef f_enable_unicode_defined

#ifdef f_enable_unicode_fun_num_used
  f_enable_unicode_fun_num =
#endif /* f_enable_unicode_fun_num_used */
#line 281 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("enable_unicode", f_enable_unicode, tFunc("\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"), 0, OPT_SIDE_EFFECT);

#endif /* f_enable_unicode_defined */

#ifdef f_get_mod_state_defined

#ifdef f_get_mod_state_fun_num_used
  f_get_mod_state_fun_num =
#endif /* f_get_mod_state_fun_num_used */
#line 305 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("get_mod_state", f_get_mod_state, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND);

#endif /* f_get_mod_state_defined */

#ifdef f_get_key_state_defined

#ifdef f_get_key_state_fun_num_used
  f_get_key_state_fun_num =
#endif /* f_get_key_state_fun_num_used */
#line 338 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("get_key_state", f_get_key_state, tFunc(tNone,tStr), 0, OPT_EXTERNAL_DEPEND);

#endif /* f_get_key_state_defined */

#ifdef f_video_mode_ok_defined

#ifdef f_video_mode_ok_fun_num_used
  f_video_mode_ok_fun_num =
#endif /* f_video_mode_ok_fun_num_used */
#line 1700 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("video_mode_ok", f_video_mode_ok, tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_video_mode_ok_defined */

#ifdef f_flip_defined

#ifdef f_flip_fun_num_used
  f_flip_fun_num =
#endif /* f_flip_fun_num_used */
#line 1726 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("flip", f_flip, tFunc(tOr(tObj,tVoid),"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_flip_defined */

#ifdef f_update_rect_defined

#ifdef f_update_rect_fun_num_used
  f_update_rect_fun_num =
#endif /* f_update_rect_fun_num_used */
#line 1763 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("update_rect", f_update_rect, tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" tOr(tObj,tVoid),tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_update_rect_defined */

#ifdef f_set_gamma_defined

#ifdef f_set_gamma_fun_num_used
  f_set_gamma_fun_num =
#endif /* f_set_gamma_fun_num_used */
#line 1781 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("set_gamma", f_set_gamma, tFunc(tFloat tFloat tFloat,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_set_gamma_defined */

#ifdef f_get_video_surface_defined

#ifdef f_get_video_surface_fun_num_used
  f_get_video_surface_fun_num =
#endif /* f_get_video_surface_fun_num_used */
#line 1798 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("get_video_surface", f_get_video_surface, tFunc(tNone,tOr(tVoid,tObj)), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_get_video_surface_defined */

#ifdef f_get_video_info_defined

#ifdef f_get_video_info_fun_num_used
  f_get_video_info_fun_num =
#endif /* f_get_video_info_fun_num_used */
#line 1819 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("get_video_info", f_get_video_info, tFunc(tNone,tOr(tVoid,tObj)), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_get_video_info_defined */

#ifdef f_gl_set_attribute_defined

#ifdef f_gl_set_attribute_fun_num_used
  f_gl_set_attribute_fun_num =
#endif /* f_gl_set_attribute_fun_num_used */
#line 1849 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("gl_set_attribute", f_gl_set_attribute, tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377",tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_gl_set_attribute_defined */

#ifdef f_gl_get_attribute_defined

#ifdef f_gl_get_attribute_fun_num_used
  f_gl_get_attribute_fun_num =
#endif /* f_gl_get_attribute_fun_num_used */
#line 1875 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("gl_get_attribute", f_gl_get_attribute, tFunc("\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_gl_get_attribute_defined */

#ifdef f_show_cursor_defined

#ifdef f_show_cursor_fun_num_used
  f_show_cursor_fun_num =
#endif /* f_show_cursor_fun_num_used */
#line 1904 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("show_cursor", f_show_cursor, tFunc("\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_show_cursor_defined */

#ifdef f_warp_mouse_defined

#ifdef f_warp_mouse_fun_num_used
  f_warp_mouse_fun_num =
#endif /* f_warp_mouse_fun_num_used */
#line 1919 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("warp_mouse", f_warp_mouse, tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377",tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_warp_mouse_defined */

#ifdef f_gl_swap_buffers_defined

#ifdef f_gl_swap_buffers_fun_num_used
  f_gl_swap_buffers_fun_num =
#endif /* f_gl_swap_buffers_fun_num_used */
#line 1933 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("gl_swap_buffers", f_gl_swap_buffers, tFunc(tNone,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_gl_swap_buffers_defined */

#ifdef f_set_video_mode_defined

#ifdef f_set_video_mode_fun_num_used
  f_set_video_mode_fun_num =
#endif /* f_set_video_mode_fun_num_used */
#line 1961 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("set_video_mode", f_set_video_mode, tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_set_video_mode_defined */

#ifdef f_blit_surface_defined

#ifdef f_blit_surface_fun_num_used
  f_blit_surface_fun_num =
#endif /* f_blit_surface_fun_num_used */
#line 2019 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("blit_surface", f_blit_surface, tFunc(tObj tObj tOr(tObj,tVoid) tOr(tObj,tVoid),"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_blit_surface_defined */

#ifdef f_video_driver_name_defined

#ifdef f_video_driver_name_fun_num_used
  f_video_driver_name_fun_num =
#endif /* f_video_driver_name_fun_num_used */
#line 2051 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("video_driver_name", f_video_driver_name, tFunc(tNone,tOr(tVoid,tStr)), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_video_driver_name_defined */

#ifdef f_set_caption_defined

#ifdef f_set_caption_fun_num_used
  f_set_caption_fun_num =
#endif /* f_set_caption_fun_num_used */
#line 2076 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("set_caption", f_set_caption, tFunc(tStr tStr,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_set_caption_defined */

#ifdef f_get_caption_defined

#ifdef f_get_caption_fun_num_used
  f_get_caption_fun_num =
#endif /* f_get_caption_fun_num_used */
#line 2088 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("get_caption", f_get_caption, tFunc(tNone,tArr(tStr)), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_get_caption_defined */

#ifdef f_iconify_window_defined

#ifdef f_iconify_window_fun_num_used
  f_iconify_window_fun_num =
#endif /* f_iconify_window_fun_num_used */
#line 2107 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("iconify_window", f_iconify_window, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_iconify_window_defined */

#ifdef f_toggle_fullscreen_defined

#ifdef f_toggle_fullscreen_fun_num_used
  f_toggle_fullscreen_fun_num =
#endif /* f_toggle_fullscreen_fun_num_used */
#line 2122 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("toggle_fullscreen", f_toggle_fullscreen, tFunc(tOr(tVoid,tObj),"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_toggle_fullscreen_defined */

#ifdef f_grab_input_defined

#ifdef f_grab_input_fun_num_used
  f_grab_input_fun_num =
#endif /* f_grab_input_fun_num_used */
#line 2158 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("grab_input", f_grab_input, tFunc("\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_grab_input_defined */

#ifdef f_pump_events_defined

#ifdef f_pump_events_fun_num_used
  f_pump_events_fun_num =
#endif /* f_pump_events_fun_num_used */
#line 2411 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("pump_events", f_pump_events, tFunc(tNone,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_pump_events_defined */

#ifdef f_num_joysticks_defined

#ifdef f_num_joysticks_fun_num_used
  f_num_joysticks_fun_num =
#endif /* f_num_joysticks_fun_num_used */
#line 2423 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("num_joysticks", f_num_joysticks, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_num_joysticks_defined */

#ifdef f_joystick_name_defined

#ifdef f_joystick_name_fun_num_used
  f_joystick_name_fun_num =
#endif /* f_joystick_name_fun_num_used */
#line 2441 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("joystick_name", f_joystick_name, tFunc("\10\200\0\0\0\177\377\377\377",tStr), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_joystick_name_defined */

#ifdef f_joystick_opened_defined

#ifdef f_joystick_opened_fun_num_used
  f_joystick_opened_fun_num =
#endif /* f_joystick_opened_fun_num_used */
#line 2461 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("joystick_opened", f_joystick_opened, tFunc("\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_joystick_opened_defined */

#ifdef f_joystick_update_defined

#ifdef f_joystick_update_fun_num_used
  f_joystick_update_fun_num =
#endif /* f_joystick_update_fun_num_used */
#line 2469 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("joystick_update", f_joystick_update, tFunc(tNone,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_joystick_update_defined */

#ifdef f_joystick_event_state_defined

#ifdef f_joystick_event_state_fun_num_used
  f_joystick_event_state_fun_num =
#endif /* f_joystick_event_state_fun_num_used */
#line 2499 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("joystick_event_state", f_joystick_event_state, tFunc("\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_joystick_event_state_defined */

#ifdef f_cd_num_drives_defined

#ifdef f_cd_num_drives_fun_num_used
  f_cd_num_drives_fun_num =
#endif /* f_cd_num_drives_fun_num_used */
#line 2722 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("cd_num_drives", f_cd_num_drives, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_cd_num_drives_defined */

#ifdef f_cd_name_defined

#ifdef f_cd_name_fun_num_used
  f_cd_name_fun_num =
#endif /* f_cd_name_fun_num_used */
#line 2740 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("cd_name", f_cd_name, tFunc("\10\200\0\0\0\177\377\377\377",tOr(tStr,tVoid)), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_cd_name_defined */

#ifdef f_open_audio_defined

#ifdef f_open_audio_fun_num_used
  f_open_audio_fun_num =
#endif /* f_open_audio_fun_num_used */
#line 3079 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    ADD_FUNCTION2("open_audio", f_open_audio, tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377",tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_open_audio_defined */

#ifdef CMOD_MAP_PROGRAM_IDS_DEFINED
set_program_id_to_id( 0 );
#endif /* CMOD_MAP_PROGRAM_IDS_DEFINED */
#line 3337 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
;

init_sdl_constants();

#ifdef DYNAMIC_MODULE
 image_program = PIKE_MODULE_IMPORT(Image, image_program);
image_color_program = PIKE_MODULE_IMPORT(Image, image_color_program);

if(!image_program || !image_color_program) {
yyerror("Could not load Image module.");
return;
}
#endif
}

PIKE_MODULE_EXIT
{

#ifdef class_Rect_defined
  if(Rect_program) {
#line 352 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    free_program(Rect_program);
    Rect_program=0;
  }

#endif /* class_Rect_defined */

#ifdef class_Keysym_defined
  if(Keysym_program) {
#line 494 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    free_program(Keysym_program);
    Keysym_program=0;
  }

#endif /* class_Keysym_defined */

#ifdef class_PixelFormat_defined
  if(PixelFormat_program) {
#line 572 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    free_program(PixelFormat_program);
    PixelFormat_program=0;
  }

#endif /* class_PixelFormat_defined */

#ifdef class_VideoInfo_defined
  if(VideoInfo_program) {
#line 880 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    free_program(VideoInfo_program);
    VideoInfo_program=0;
  }

#endif /* class_VideoInfo_defined */

#ifdef class_Surface_defined
  if(Surface_program) {
#line 993 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    free_program(Surface_program);
    Surface_program=0;
  }

#endif /* class_Surface_defined */

#ifdef class_Joystick_defined
  if(Joystick_program) {
#line 2181 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    free_program(Joystick_program);
    Joystick_program=0;
  }

#endif /* class_Joystick_defined */

#ifdef class_CDTrack_defined
  if(CDTrack_program) {
#line 2516 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    free_program(CDTrack_program);
    CDTrack_program=0;
  }

#endif /* class_CDTrack_defined */

#ifdef class_CD_defined
  if(CD_program) {
#line 2547 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    free_program(CD_program);
    CD_program=0;
  }

#endif /* class_CD_defined */

#ifdef class_Music_defined
  if(Music_program) {
#line 2767 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    free_program(Music_program);
    Music_program=0;
  }

#endif /* class_Music_defined */

#ifdef class_Event_defined
  if(Event_program) {
#line 3094 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
    free_program(Event_program);
    Event_program=0;
  }

#endif /* class_Event_defined */
#line 3354 "/Users/hww3/devel/pike/src/post_modules/SDL/SDL.cmod"
;
SDL_Quit();
}


/*! @endmodule SDL */

#else /* HAVE_SDL */

PIKE_MODULE_INIT {
}
PIKE_MODULE_EXIT {
}
#endif /* HAVE_SDL */


#ifdef CMOD_MAP_PROGRAM_IDS_DEFINED
static int ___cmod_map_program_ids(int id)
{
  int i = 0;
  if( (id&0x7f000000) != 0x7f000000 ) return id;
  id = id&0x00ffffff;
#ifdef class_CDTrack_defined
if(id==8) return CDTrack_program->id;
#endif
#ifdef class_CD_defined
if(id==9) return CD_program->id;
#endif
#ifdef class_Music_defined
if(id==10) return Music_program->id;
#endif
#ifdef class_Rect_defined
if(id==2) return Rect_program->id;
#endif
#ifdef class_Event_defined
if(id==11) return Event_program->id;
#endif
#ifdef class_Keysym_defined
if(id==3) return Keysym_program->id;
#endif
#ifdef class_PixelFormat_defined
if(id==4) return PixelFormat_program->id;
#endif
#ifdef class_VideoInfo_defined
if(id==5) return VideoInfo_program->id;
#endif
#ifdef class_Surface_defined
if(id==6) return Surface_program->id;
#endif
#ifdef class_Joystick_defined
if(id==7) return Joystick_program->id;
#endif
  return 0;
}
#endif /* CMOD_MAP_PROGRAM_IDS_DEFINED */
