Sunteți pe pagina 1din 10




” MurmurHash is a non-cryptographic hash function suitable for general hash-based lookup. It was created by
Austin Appleby in 2008 and is currently hosted on Github along with its test suite named ‘SMHasher’. It also
exists in a number of variants,[5] all of which have been released into the public domain. The name comes from
two basic operations, multiply (MU) and rotate (R), used in its inner loop. “
Murmurhash extension is an extension written to implement a full implementation for the MurmurHash library.
Developer: Hassan Ahmed

77.1 MurmurHash1 functions

uint32_t murmurhash1(string key, int seed, [bool return_type]);

uint32_t murmurhash1_aligned(string key, int seed, [bool return_type]);

77.2 MurmurHash2 functions

uint32_t murmurhash2(string key, int seed, [bool return_type]);

uint32_t murmurhash2a(string key, int seed, [bool return_type]);
uint64_t murmurhash64a(string key, int seed, [bool return_type]);
uint64_t murmurhash64b(string key, int seed, [bool return_type]);
uint32_t murmurhash_neutral2(string key, int seed, [bool return_type]);
uint32_t murmurhash_aligned2(string key, int seed, [bool return_type]);

77.3 MurmurHash3 functions

uint32_t murmurhash3_x86_32(string key, int seed, [bool return_type]);

list murmurhash3_x86_128(string key, int seed, [bool return_type]);
list murmurhash3_x64_128(string key, int seed, [bool return_type]);
The third optional parameter is to set the type of the returned value, this parameter accepts a bool value [ true, false ],
true will return a Hex value, while false will return a integer value.

Ring Documentation, Release 1.6

77.4 Example
load "murmurhashlib.ring"

key = "Ring Language"

see murmurhash3_x86_32(key, 0, 0) + nl // Output: 1894444853

see murmurhash3_x86_32(key, 0, 1) + nl // Output: 70eaef35

77.4. Example 844




• void al_exit(void)
• void al_run_main(void)
• int al_init(void)
• ALLEGRO_CONFIG *al_create_config(void)
• void al_destroy_config(ALLEGRO_CONFIG *config)
• ALLEGRO_CONFIG *al_load_config_file(const char *filename)
• ALLEGRO_CONFIG *al_load_config_file_f(ALLEGRO_FILE *file)
• bool al_save_config_file(const char *filename, const ALLEGRO_CONFIG *config)
• bool al_save_config_file_f(ALLEGRO_FILE *file, const ALLEGRO_CONFIG *config)
• void al_add_config_section(ALLEGRO_CONFIG *config, const char *name)
• void al_add_config_comment(ALLEGRO_CONFIG *config, const char *section, const char *comment)
• const char *al_get_config_value(const ALLEGRO_CONFIG *config,const char *section, const char *key)
• void al_set_config_value(ALLEGRO_CONFIG *config,const char *section, const char *key, const char *value)
• char const *al_get_first_config_section(ALLEGRO_CONFIG const *config,ALLEGRO_CONFIG_SECTION
• char const *al_get_next_config_section(ALLEGRO_CONFIG_SECTION **iterator)
• char const *al_get_first_config_entry(ALLEGRO_CONFIG const *config,char const *section, ALLE-
GRO_CONFIG_ENTRY **iterator)
• char const *al_get_next_config_entry(ALLEGRO_CONFIG_ENTRY **iterator)
• ALLEGRO_CONFIG *al_merge_config(const ALLEGRO_CONFIG *cfg1,const ALLEGRO_CONFIG *cfg2)
• void al_merge_config_into(ALLEGRO_CONFIG *master, const ALLEGRO_CONFIG *add)
• ALLEGRO_DISPLAY *al_create_display(int w, int h)
• void al_destroy_display(ALLEGRO_DISPLAY *display)
• int al_get_new_display_flags(void)
• void al_set_new_display_flags(int flags)
• int al_get_new_display_option(int option, int *importance)
• void al_set_new_display_option(int option, int value, int importance)
• void al_reset_new_display_options(void)

Ring Documentation, Release 1.6

• void al_get_new_window_position(int *x, int *y)

• void al_set_new_window_position(int x, int y)
• int al_get_new_display_refresh_rate(void)
• void al_set_new_display_refresh_rate(int refresh_rate)
• ALLEGRO_EVENT_SOURCE *al_get_display_event_source(ALLEGRO_DISPLAY *display)
• ALLEGRO_BITMAP *al_get_backbuffer(ALLEGRO_DISPLAY *display)
• void al_flip_display(void)
• void al_update_display_region(int x, int y, int width, int height)
• bool al_wait_for_vsync(void)
• int al_get_display_width(ALLEGRO_DISPLAY *display)
• int al_get_display_height(ALLEGRO_DISPLAY *display)
• bool al_resize_display(ALLEGRO_DISPLAY *display, int width, int height)
• bool al_acknowledge_resize(ALLEGRO_DISPLAY *display)
• void al_get_window_position(ALLEGRO_DISPLAY *display, int *x, int *y)
• void al_set_window_position(ALLEGRO_DISPLAY *display, int x, int y)
• int al_get_display_flags(ALLEGRO_DISPLAY *display)
• bool al_set_display_flag(ALLEGRO_DISPLAY *display, int flag, bool onoff)
• int al_get_display_option(ALLEGRO_DISPLAY *display, int option)
• int al_get_display_format(ALLEGRO_DISPLAY *display)
• int al_get_display_refresh_rate(ALLEGRO_DISPLAY *display)
• void al_set_window_title(ALLEGRO_DISPLAY *display, const char *title)
• void al_set_display_icon(ALLEGRO_DISPLAY *display, ALLEGRO_BITMAP *icon)
• void al_set_display_icons(ALLEGRO_DISPLAY *display,int num_icons, ALLEGRO_BITMAP *icons[])
• bool al_inhibit_screensaver(bool inhibit)
• void al_acknowledge_drawing_halt(ALLEGRO_DISPLAY *display)
• void al_acknowledge_drawing_resume(ALLEGRO_DISPLAY *display)
• int al_get_display_orientation(ALLEGRO_DISPLAY* display)
• void al_set_display_option(ALLEGRO_DISPLAY *display, int option, int value)
• bool al_get_window_constraints(ALLEGRO_DISPLAY *display,int *min_w, int *min_h, int *max_w, int
• bool al_set_window_constraints(ALLEGRO_DISPLAY *display,int min_w, int min_h, int max_w, int max_h)
• ALLEGRO_EVENT_QUEUE *al_create_event_queue(void)
• void al_destroy_event_queue(ALLEGRO_EVENT_QUEUE *queue)
• void al_register_event_source(ALLEGRO_EVENT_QUEUE *queue,ALLEGRO_EVENT_SOURCE *source)
• void al_unregister_event_source(ALLEGRO_EVENT_QUEUE *queue,ALLEGRO_EVENT_SOURCE
• bool al_is_event_queue_empty(ALLEGRO_EVENT_QUEUE *queue)

Ring Documentation, Release 1.6

• bool al_get_next_event(ALLEGRO_EVENT_QUEUE *queue, ALLEGRO_EVENT *ret_event)

• bool al_peek_next_event(ALLEGRO_EVENT_QUEUE *queue, ALLEGRO_EVENT *ret_event)
• bool al_drop_next_event(ALLEGRO_EVENT_QUEUE *queue)
• void al_flush_event_queue(ALLEGRO_EVENT_QUEUE *queue)
• void al_wait_for_event(ALLEGRO_EVENT_QUEUE *queue, ALLEGRO_EVENT *ret_event)
• bool al_wait_for_event_timed(ALLEGRO_EVENT_QUEUE *queue,ALLEGRO_EVENT *ret_event, float
• bool al_wait_for_event_until(ALLEGRO_EVENT_QUEUE *queue,ALLEGRO_EVENT *ret_event, ALLE-
GRO_TIMEOUT *timeout)
• void al_init_user_event_source(ALLEGRO_EVENT_SOURCE *src)
• void al_destroy_user_event_source(ALLEGRO_EVENT_SOURCE *src)
• intptr_t al_get_event_source_data(const ALLEGRO_EVENT_SOURCE *source)
• void al_set_event_source_data(ALLEGRO_EVENT_SOURCE *source, intptr_t data)
• ALLEGRO_FILE *al_fopen(const char *path, const char *mode)
• ALLEGRO_FILE *al_fopen_interface(const ALLEGRO_FILE_INTERFACE *drv,const char *path, const char
• ALLEGRO_FILE *al_fopen_slice(ALLEGRO_FILE *fp, size_t initial_size, const char *mode)
• void al_fclose(ALLEGRO_FILE *f)
• size_t al_fread(ALLEGRO_FILE *f, void *ptr, size_t size)
• size_t al_fwrite(ALLEGRO_FILE *f, const void *ptr, size_t size)
• bool al_fflush(ALLEGRO_FILE *f)
• int64_t al_ftell(ALLEGRO_FILE *f)
• bool al_fseek(ALLEGRO_FILE *f, int64_t offset, int whence)
• bool al_feof(ALLEGRO_FILE *f)
• bool al_ferror(ALLEGRO_FILE *f)
• void al_fclearerr(ALLEGRO_FILE *f)
• int al_fungetc(ALLEGRO_FILE *f, int c)
• int64_t al_fsize(ALLEGRO_FILE *f)
• int al_fgetc(ALLEGRO_FILE *f)
• int al_fputc(ALLEGRO_FILE *f, int c)
• int16_t al_fread16le(ALLEGRO_FILE *f)
• int16_t al_fread16be(ALLEGRO_FILE *f)
• size_t al_fwrite16le(ALLEGRO_FILE *f, int16_t w)
• size_t al_fwrite16be(ALLEGRO_FILE *f, int16_t w)
• int32_t al_fread32le(ALLEGRO_FILE *f)
• int32_t al_fread32be(ALLEGRO_FILE *f)
• size_t al_fwrite32le(ALLEGRO_FILE *f, int32_t l)

Ring Documentation, Release 1.6

• size_t al_fwrite32be(ALLEGRO_FILE *f, int32_t l)

• char *al_fgets(ALLEGRO_FILE *f, char * const buf, size_t max)
• ALLEGRO_USTR *al_fget_ustr(ALLEGRO_FILE *f)
• int al_fputs(ALLEGRO_FILE *f, char const *p)
• ALLEGRO_FILE *al_fopen_fd(int fd, const char *mode)
• ALLEGRO_FILE *al_make_temp_file(const char *template, ALLEGRO_PATH **ret_path)
• void al_set_new_file_interface(const ALLEGRO_FILE_INTERFACE *file_interface
• void al_set_standard_file_interface(void)
• const ALLEGRO_FILE_INTERFACE *al_get_new_file_interface(void)
• ALLEGRO_FILE *al_create_file_handle(const ALLEGRO_FILE_INTERFACE *drv,void *userdata)
• void *al_get_file_userdata(ALLEGRO_FILE *f)
• ALLEGRO_FS_ENTRY *al_create_fs_entry(const char *path)
• void al_destroy_fs_entry(ALLEGRO_FS_ENTRY *fh)
• const char *al_get_fs_entry_name(ALLEGRO_FS_ENTRY *e)
• bool al_update_fs_entry(ALLEGRO_FS_ENTRY *e)
• uint32_t al_get_fs_entry_mode(ALLEGRO_FS_ENTRY *e)
• time_t al_get_fs_entry_atime(ALLEGRO_FS_ENTRY *e)
• time_t al_get_fs_entry_ctime(ALLEGRO_FS_ENTRY *e)
• time_t al_get_fs_entry_mtime(ALLEGRO_FS_ENTRY *e)
• off_t al_get_fs_entry_size(ALLEGRO_FS_ENTRY *e)
• bool al_fs_entry_exists(ALLEGRO_FS_ENTRY *e)
• bool al_remove_fs_entry(ALLEGRO_FS_ENTRY *e)
• bool al_filename_exists(const char *path)
• bool al_remove_filename(const char *path)
• bool al_open_directory(ALLEGRO_FS_ENTRY *e)
• ALLEGRO_FS_ENTRY *al_read_directory(ALLEGRO_FS_ENTRY *e)
• bool al_close_directory(ALLEGRO_FS_ENTRY *e)
• char *al_get_current_directory(void)
• bool al_change_directory(const char *path)
• bool al_make_directory(const char *path)
• ALLEGRO_FILE *al_open_fs_entry(ALLEGRO_FS_ENTRY *e, const char *mode)
• void al_set_fs_interface(const ALLEGRO_FS_INTERFACE *fs_interface)
• void al_set_standard_fs_interface(void)
• const ALLEGRO_FS_INTERFACE *al_get_fs_interface(void)
• al_fixed al_itofix(int x);
• int al_fixtoi(al_fixed x);

Ring Documentation, Release 1.6

• int al_fixfloor(al_fixed x);

• int al_fixceil(al_fixed x);
• al_fixed al_ftofix(double x);
• double al_fixtof(al_fixed x);
• al_fixed al_fixmul(al_fixed x, al_fixed y);
• al_fixed al_fixdiv(al_fixed x, al_fixed y);
• al_fixed al_fixadd(al_fixed x, al_fixed y);
• al_fixed al_fixsub(al_fixed x, al_fixed y);
• al_fixed al_fixsin(al_fixed x);
• al_fixed al_fixcos(al_fixed x);
• al_fixed al_fixtan(al_fixed x);
• al_fixed al_fixasin(al_fixed x);
• al_fixed al_fixacos(al_fixed x);
• al_fixed al_fixatan(al_fixed x)
• al_fixed al_fixatan2(al_fixed y, al_fixed x)
• al_fixed al_fixsqrt(al_fixed x)
• al_fixed al_fixhypot(al_fixed x, al_fixed y)
• ALLEGRO_DISPLAY_MODE *al_get_display_mode(int index, ALLEGRO_DISPLAY_MODE *mode)
• int al_get_num_display_modes(void)
• ALLEGRO_COLOR al_map_rgb(unsigned char r, unsigned char g, unsigned char b)
• ALLEGRO_COLOR al_map_rgb_f(float r, float g, float b)
• ALLEGRO_COLOR al_map_rgba(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
• ALLEGRO_COLOR al_map_rgba_f(float r, float g, float b, float a)
• void al_unmap_rgb(ALLEGRO_COLOR color,unsigned char *r, unsigned char *g, unsigned char *b)
• void al_unmap_rgb_f(ALLEGRO_COLOR color, float *r, float *g, float *b)
• void al_unmap_rgba(ALLEGRO_COLOR color,unsigned char *r, unsigned char *g, unsigned char *b, unsigned
char *a)
• void al_unmap_rgba_f(ALLEGRO_COLOR color,float *r, float *g, float *b, float *a)
• int al_get_pixel_size(int format)
• int al_get_pixel_format_bits(int format)
• ALLEGRO_LOCKED_REGION *al_lock_bitmap(ALLEGRO_BITMAP *bitmap,int format, int flags)
• ALLEGRO_LOCKED_REGION *al_lock_bitmap_region(ALLEGRO_BITMAP *bitmap,int x, int y, int width,
int height, int format, int flags)
• void al_unlock_bitmap(ALLEGRO_BITMAP *bitmap)
• ALLEGRO_BITMAP *al_create_bitmap(int w, int h)
• ALLEGRO_BITMAP *al_create_sub_bitmap(ALLEGRO_BITMAP *parent,int x, int y, int w, int h)
• ALLEGRO_BITMAP *al_clone_bitmap(ALLEGRO_BITMAP *bitmap)

Ring Documentation, Release 1.6

• void al_destroy_bitmap(ALLEGRO_BITMAP *bitmap)

• int al_get_new_bitmap_flags(void)
• int al_get_new_bitmap_format(void)
• void al_set_new_bitmap_flags(int flags)
• void al_add_new_bitmap_flag(int flag)
• void al_set_new_bitmap_format(int format)
• int al_get_bitmap_flags(ALLEGRO_BITMAP *bitmap)
• int al_get_bitmap_format(ALLEGRO_BITMAP *bitmap)
• int al_get_bitmap_height(ALLEGRO_BITMAP *bitmap)
• int al_get_bitmap_width(ALLEGRO_BITMAP *bitmap)
• ALLEGRO_COLOR al_get_pixel(ALLEGRO_BITMAP *bitmap, int x, int y)
• bool al_is_bitmap_locked(ALLEGRO_BITMAP *bitmap)
• bool al_is_compatible_bitmap(ALLEGRO_BITMAP *bitmap)
• bool al_is_sub_bitmap(ALLEGRO_BITMAP *bitmap)
• ALLEGRO_BITMAP *al_get_parent_bitmap(ALLEGRO_BITMAP *bitmap)
• void al_clear_to_color(ALLEGRO_COLOR color)
• void al_draw_bitmap(ALLEGRO_BITMAP *bitmap, float dx, float dy, int flags)
• void al_draw_tinted_bitmap(ALLEGRO_BITMAP *bitmap, ALLEGRO_COLOR tint,float dx, float dy, int
• void al_draw_bitmap_region(ALLEGRO_BITMAP *bitmap,float sx, float sy, float sw, float sh, float dx, float
dy, int flags)
• void al_draw_tinted_bitmap_region(ALLEGRO_BITMAP *bitmap,ALLEGRO_COLOR tint,float sx, float sy,
float sw, float sh, float dx, float dy,int flags)
• void al_draw_pixel(float x, float y, ALLEGRO_COLOR color)
• void al_draw_rotated_bitmap(ALLEGRO_BITMAP *bitmap,float cx, float cy, float dx, float dy, float angle, int
• void al_draw_tinted_rotated_bitmap(ALLEGRO_BITMAP *bitmap,ALLEGRO_COLOR tint,float cx, float cy,
float dx, float dy, float angle, int flags)
• void al_draw_scaled_rotated_bitmap(ALLEGRO_BITMAP *bitmap,float cx, float cy, float dx, float dy, float
xscale, float yscale,float angle, int flags)
• void al_draw_tinted_scaled_rotated_bitmap(ALLEGRO_BITMAP *bitmap,ALLEGRO_COLOR tint,float cx,
float cy, float dx, float dy, float xscale, float yscale,float angle, int flags)
• void al_draw_tinted_scaled_rotated_bitmap_region(ALLEGRO_BITMAP *bitmap,float sx, float sy, float sw,
float sh,ALLEGRO_COLOR tint,float cx, float cy, float dx, float dy, float xscale, float yscale,float angle, int
• void al_draw_scaled_bitmap(ALLEGRO_BITMAP *bitmap,float sx, float sy, float sw, float sh,float dx, float dy,
float dw, float dh, int flags)
• void al_draw_tinted_scaled_bitmap(ALLEGRO_BITMAP *bitmap,ALLEGRO_COLOR tint,float sx, float sy,
float sw, float sh,float dx, float dy, float dw, float dh, int flags)
• ALLEGRO_BITMAP *al_get_target_bitmap(void)

Ring Documentation, Release 1.6

• void al_put_pixel(int x, int y, ALLEGRO_COLOR color)

• void al_put_blended_pixel(int x, int y, ALLEGRO_COLOR color)
• void al_set_target_bitmap(ALLEGRO_BITMAP *bitmap)
• void al_set_target_backbuffer(ALLEGRO_DISPLAY *display)
• ALLEGRO_DISPLAY *al_get_current_display(void)
• void al_get_blender(int *op, int *src, int *dst)
• void al_get_separate_blender(int *op, int *src, int *dst,int *alpha_op, int *alpha_src, int *alpha_dst)
• void al_set_blender(int op, int src, int dst)
• void al_set_separate_blender(int op, int src, int dst,int alpha_op, int alpha_src, int alpha_dst)
• void al_get_clipping_rectangle(int *x, int *y, int *w, int *h)
• void al_set_clipping_rectangle(int x, int y, int width, int height)
• void al_reset_clipping_rectangle(void)
• void al_convert_mask_to_alpha(ALLEGRO_BITMAP *bitmap, ALLEGRO_COLOR mask_color)
• void al_hold_bitmap_drawing(bool hold)
• bool al_is_bitmap_drawing_held(void)
• ALLEGRO_BITMAP *al_load_bitmap_f(ALLEGRO_FILE *fp, const char *ident)
• bool al_save_bitmap(const char *filename, ALLEGRO_BITMAP *bitmap)
• bool al_save_bitmap_f(ALLEGRO_FILE *fp, const char *ident,ALLEGRO_BITMAP *bitmap)
• bool al_install_joystick(void)
• void al_uninstall_joystick(void)
• bool al_is_joystick_installed(void)
• bool al_reconfigure_joysticks(void)
• int al_get_num_joysticks(void)
• ALLEGRO_JOYSTICK * al_get_joystick(int num)
• void al_release_joystick(ALLEGRO_JOYSTICK *joy)
• bool al_get_joystick_active(ALLEGRO_JOYSTICK *joy)
• const char *al_get_joystick_name(ALLEGRO_JOYSTICK *joy)
• const char *al_get_joystick_stick_name(ALLEGRO_JOYSTICK *joy, int stick)
• const char *al_get_joystick_axis_name(ALLEGRO_JOYSTICK *joy, int stick, int axis)
• const char *al_get_joystick_button_name(ALLEGRO_JOYSTICK *joy, int button)
• int al_get_joystick_stick_flags(ALLEGRO_JOYSTICK *joy, int stick)
• int al_get_joystick_num_sticks(ALLEGRO_JOYSTICK *joy)
• int al_get_joystick_num_axes(ALLEGRO_JOYSTICK *joy, int stick)
• int al_get_joystick_num_buttons(ALLEGRO_JOYSTICK *joy)
• void al_get_joystick_state(ALLEGRO_JOYSTICK *joy, ALLEGRO_JOYSTICK_STATE *ret_state)
• ALLEGRO_EVENT_SOURCE *al_get_joystick_event_source(void)

Ring Documentation, Release 1.6

• bool al_install_keyboard(void)
• bool al_is_keyboard_installed(void)
• void al_uninstall_keyboard(void)
• void al_get_keyboard_state(ALLEGRO_KEYBOARD_STATE *ret_state)
• bool al_key_down(const ALLEGRO_KEYBOARD_STATE *state, int keycode)
• const char *al_keycode_to_name(int keycode)
• bool al_set_keyboard_leds(int leds)
• ALLEGRO_EVENT_SOURCE *al_get_keyboard_event_source(void)
• void *al_malloc_with_context(size_t n,int line, const char *file, const char *func)
• void al_free_with_context(void *ptr, int line, const char *file, const char *func)
• void *al_realloc_with_context(void *ptr, size_t n,int line, const char *file, const char *func)
• void *al_calloc_with_context(size_t count, size_t n,int line, const char *file, const char *func)
• void al_set_memory_interface(ALLEGRO_MEMORY_INTERFACE *memory_interface)
• int al_get_new_display_adapter(void)
• void al_set_new_display_adapter(int adapter)
• bool al_get_monitor_info(int adapter, ALLEGRO_MONITOR_INFO *info)
• int al_get_num_video_adapters(void)
• bool al_install_mouse(void)
• bool al_is_mouse_installed(void)
• void al_uninstall_mouse(void)
• unsigned int al_get_mouse_num_axes(void)
• unsigned int al_get_mouse_num_buttons(void)
• void al_get_mouse_state(ALLEGRO_MOUSE_STATE *ret_state)
• int al_get_mouse_state_axis(const ALLEGRO_MOUSE_STATE *state, int axis)
• bool al_mouse_button_down(const ALLEGRO_MOUSE_STATE *state, int button)
• bool al_set_mouse_xy(ALLEGRO_DISPLAY *display, int x, int y)
• bool al_set_mouse_z(int z)
• bool al_set_mouse_w(int w)
• bool al_set_mouse_axis(int which, int value)
• ALLEGRO_EVENT_SOURCE *al_get_mouse_event_source(void)
• ALLEGRO_MOUSE_CURSOR *al_create_mouse_cursor(ALLEGRO_BITMAP *bmp,int x_focus, int
• void al_destroy_mouse_cursor(ALLEGRO_MOUSE_CURSOR *cursor)
• bool al_set_mouse_cursor(ALLEGRO_DISPLAY *display, ALLEGRO_MOUSE_CURSOR *cursor)
• bool al_set_system_mouse_cursor(ALLEGRO_DISPLAY *display,ALLEGRO_SYSTEM_MOUSE_CURSOR
• bool al_get_mouse_cursor_position(int *ret_x, int *ret_y)