Ruby 2.0.0p247(2013-06-27revision41674)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Macros | Typedefs | Enumerations | Functions
st.h File Reference
`#include "ruby/defines.h"`
Include dependency graph for st.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | st_hash_type
struct | st_table

## Macros
#define | RUBY_ST_H 1
#define | ST_DATA_T_DEFINED
#define | SIZEOF_ST_INDEX_T SIZEOF_VOIDP
#define | ST_INDEX_BITS (sizeof(st_index_t) * CHAR_BIT)
#define | st_is_member(table, key) st_lookup((table),(key),(st_data_t *)0)
#define | st_hash_start(h) ((st_index_t)(h))
#define | ST_DATA_T_DEFINED
#define | CHAR_BIT 8
#define | SIZEOF_ST_INDEX_T SIZEOF_VOIDP
#define | ST_INDEX_BITS (sizeof(st_index_t) * CHAR_BIT)
#define | st_is_member(table, key) st_lookup((table),(key),(st_data_t *)0)
#define | st_hash_start(h) ((st_index_t)(h))

## Typedefs
typedef unsigned long | st_data_t
typedef struct st_table | st_table
typedef st_data_t | st_index_t
typedef int | st_compare_func (st_data_t, st_data_t)
typedef st_index_t | st_hash_func (st_data_t)
typedef char | st_check_for_sizeof_st_index_t [SIZEOF_VOIDP==(int) sizeof(st_index_t)?1:-1]
typedef int | st_update_callback_func (st_data_t *key, st_data_t *value, st_data_t arg, int existing)

## Enumerations
enum | st_retval { ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK, ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK }

## Functions
st_table * | st_init_table (const struct st_hash_type *)
st_table * | st_init_table_with_size (const struct st_hash_type *, st_index_t)
st_table * | st_init_numtable (void)
st_table * | st_init_numtable_with_size (st_index_t)
st_table * | st_init_strtable (void)
st_table * | st_init_strtable_with_size (st_index_t)
st_table * | st_init_strcasetable (void)
st_table * | st_init_strcasetable_with_size (st_index_t)
int | st_delete (st_table *, st_data_t *, st_data_t *)
int | st_delete_safe (st_table *, st_data_t *, st_data_t *, st_data_t)
int | st_insert (st_table *, st_data_t, st_data_t)
int | st_insert2 (st_table *, st_data_t, st_data_t, st_data_t(*)(st_data_t))
int | st_lookup (st_table *, st_data_t, st_data_t *)
int | st_get_key (st_table *, st_data_t, st_data_t *)
int | st_update (st_table *table, st_data_t key, st_update_callback_func *func, st_data_t arg)
int | st_foreach (st_table *, int(*)(ANYARGS), st_data_t)
int | st_foreach_check (st_table *, int(*)(ANYARGS), st_data_t, st_data_t)
int | st_reverse_foreach (st_table *, int(*)(ANYARGS), st_data_t)
void | st_add_direct (st_table *, st_data_t, st_data_t)
void | st_free_table (st_table *)
void | st_cleanup_safe (st_table *, st_data_t)
void | st_clear (st_table *)
st_table * | st_copy (st_table *)
int | st_numcmp (st_data_t, st_data_t)
st_index_t | st_numhash (st_data_t)
int | st_strcasecmp (const char *s1, const char *s2)
int | st_strncasecmp (const char *s1, const char *s2, size_t n)
size_t | st_memsize (const st_table *)
st_index_t | st_hash (const void *ptr, size_t len, st_index_t h)
st_index_t | st_hash_uint32 (st_index_t h, uint32_t i)
st_index_t | st_hash_uint (st_index_t h, st_index_t i)
st_index_t | st_hash_end (st_index_t h)
st_index_t | st_hash_start (st_index_t h)

## Macro Definition Documentation

#define CHAR_BIT 8

Definition at line 47 of file st.h.

#define RUBY_ST_H 1

Definition at line 7 of file ripper.y.

#define SIZEOF_ST_INDEX_T SIZEOF_VOIDP

Definition at line 68 of file st.h.

#define SIZEOF_ST_INDEX_T SIZEOF_VOIDP

Referenced by st_hash().

#define ST_DATA_T_DEFINED

Definition at line 41 of file st.h.

#define st_hash_start | ( |  | h) |  | ((st_index_t)(h))

Definition at line 144 of file st.h.

#define st_hash_start | ( |  | h) |  | ((st_index_t)(h))

Referenced by rb_hash_start(), and st_hash_start().

#define ST_INDEX_BITS (sizeof(st_index_t) * CHAR_BIT)

Definition at line 75 of file st.h.

#define ST_INDEX_BITS (sizeof(st_index_t) * CHAR_BIT)

#define st_is_member | ( |  | table,
|  |  | key
| ) |  | st_lookup((table),(key),(st_data_t *)0)

Definition at line 106 of file st.h.

#define st_is_member | ( |  | table,
|  |  | key
| ) |  | st_lookup((table),(key),(st_data_t *)0)

## Typedef Documentation

typedef char st_check_for_sizeof_st_index_t[SIZEOF_VOIDP==(int) sizeof(st_index_t)?1:-1]

Definition at line 67 of file st.h.

typedef int st_compare_func(st_data_t, st_data_t)

Definition at line 64 of file st.h.

typedef unsigned long st_data_t

Definition at line 35 of file st.h.

typedef st_index_t st_hash_func(st_data_t)

Definition at line 65 of file st.h.

typedef st_data_t st_index_t

Definition at line 63 of file st.h.

typedef struct st_table st_table

Definition at line 61 of file st.h.

typedef int st_update_callback_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing)

Definition at line 124 of file st.h.

## Enumeration Type Documentation

enum st_retval

Enumerator
ST_CONTINUE |
ST_STOP |
ST_DELETE |
ST_CHECK |
ST_CONTINUE |
ST_STOP |
ST_DELETE |
ST_CHECK |

Definition at line 108 of file st.h.

## Function Documentation

void st_add_direct | ( | st_table * | ,
|  | st_data_t | ,
|  | st_data_t |
| ) |  |

Definition at line 624 of file st.c.

References add_direct(), add_packed_direct(), do_hash, st_table::entries_packed, and st_table::num_bins.

void st_cleanup_safe | ( | st_table * | ,
|  | st_data_t |
| ) |  |

Definition at line 797 of file st.c.

References st_table::bins, st_table::entries_packed, i, st_table_entry::key, last, st_table_entry::next, st_table::num_bins, st_table::num_entries, PACKED_ENT, PKEY, st_table::real_entries, and st_free_entry.

void st_clear | ( | st_table * | ) |  |

Definition at line 308 of file st.c.

References st_table::bins, st_table::entries_packed, st_table::head, i, st_table_entry::next, st_table::num_bins, st_table::num_entries, st_table::real_entries, st_free_entry, and st_table::tail.

st_table* st_copy | ( | st_table * | ) |  |

Definition at line 658 of file st.c.

References st_table_entry::back, st_table::bins, st_table::entries_packed, st_table_entry::fore, st_table_entry::hash, st_table::head, MEMCPY, st_table_entry::next, st_table::num_bins, st_alloc_bins, st_alloc_entry, st_alloc_table, st_dealloc_table, st_free_table(), and st_table::tail.

int st_delete | ( | st_table * | ,
|  | st_data_t * | ,
|  | st_data_t * |
| ) |  |

int st_delete_safe | ( | st_table * | ,
|  | st_data_t * | ,
|  | st_data_t * | ,
|  | st_data_t |
| ) |  |

int st_foreach | ( | st_table * | ,
|  | int(*)(ANYARGS) | ,
|  | st_data_t |
| ) |  |

Definition at line 1000 of file st.c.

References arg, st_table::bins, st_table::entries_packed, FIND_ENTRY, st_table_entry::fore, st_table_entry::hash, hash(), st_table::head, i, st_table_entry::key, key, last, st_table_entry::next, st_table::num_bins, PHASH, PKEY, PVAL, st_table::real_entries, st_table_entry::record, remove_entry(), remove_packed_entry(), ST_CHECK, ST_CONTINUE, ST_DELETE, st_free_entry, ST_STOP, and val.

int st_foreach_check | ( | st_table * | ,
|  | int(*)(ANYARGS) | ,
|  | st_data_t | ,
|  | st_data_t |
| ) |  |

Definition at line 909 of file st.c.

References arg, st_table::bins, st_table::entries_packed, FIND_ENTRY, find_packed_index(), st_table_entry::fore, st_table_entry::hash, hash(), st_table::head, i, st_table_entry::key, key, last, st_table_entry::next, st_table::num_bins, PHASH, PKEY, PVAL, st_table::real_entries, st_table_entry::record, remove_entry(), remove_safe_packed_entry(), ST_CHECK, ST_CONTINUE, ST_DELETE, ST_STOP, and val.

void st_free_table | ( | st_table * | ) |  |

Definition at line 334 of file st.c.

References st_table::bins, st_table::num_bins, st_clear(), st_dealloc_table, and st_free_bins.

int st_get_key | ( | st_table * | ,
|  | st_data_t | ,
|  | st_data_t * |
| ) |  |

st_index_t st_hash | ( | const void * | ptr,
|  | size_t | len,
|  | st_index_t | h
| ) |  |

Definition at line 1313 of file st.c.

References CHAR_BIT, murmur_finish(), murmur_step, MurmurMagic, SIZEOF_ST_INDEX_T, and UNALIGNED_ADD_ALL.

st_index_t st_hash_end | ( | st_index_t | h) |  |

Definition at line 1477 of file st.c.

References murmur_step.

st_index_t st_hash_start | ( | st_index_t | h) |  |

Definition at line 1486 of file st.c.

References st_hash_start.

st_index_t st_hash_uint | ( | st_index_t | h,
|  | st_index_t | i
| ) |  |

Definition at line 1446 of file st.c.

References i, murmur1, and v.

st_index_t st_hash_uint32 | ( | st_index_t | h,
|  | uint32_t | i
| ) |  |

Definition at line 1440 of file st.c.

References murmur_step.

st_table* st_init_numtable | ( | void | ) |  |

Definition at line 272 of file st.c.

References st_init_table(), and type_numhash.

st_table* st_init_numtable_with_size | ( | st_index_t | ) |  |

Definition at line 278 of file st.c.

References st_init_table_with_size(), and type_numhash.

st_table* st_init_strcasetable | ( | void | ) |  |

Definition at line 296 of file st.c.

References st_init_table().

st_table* st_init_strcasetable_with_size | ( | st_index_t | ) |  |

Definition at line 302 of file st.c.

References st_init_table_with_size().

st_table* st_init_strtable | ( | void | ) |  |

Definition at line 284 of file st.c.

References st_init_table().

st_table* st_init_strtable_with_size | ( | st_index_t | ) |  |

Definition at line 290 of file st.c.

References st_init_table_with_size().

st_table* st_init_table | ( | const struct st_hash_type * | ) |  |

Definition at line 266 of file st.c.

References st_init_table_with_size().

st_table* st_init_table_with_size | ( | const struct st_hash_type * | ,
|  | st_index_t |
| ) |  |

Definition at line 229 of file st.c.

References st_table::bins, st_table::entries_packed, getenv(), st_table::head, MAX_PACKED_HASH, new_size(), st_table::num_bins, st_table::num_entries, size, st_alloc_bins, st_alloc_table, ST_DEFAULT_PACKED_TABLE_SIZE, st_table::tail, st_table::type, and type.

int st_insert | ( | st_table * | ,
|  | st_data_t | ,
|  | st_data_t |
| ) |  |

int st_insert2 | ( | st_table * | ,
|  | st_data_t | ,
|  | st_data_t | ,
|  | st_data_t(*)(st_data_t) |
| ) |  |

int st_lookup | ( | st_table * | ,
|  | st_data_t | ,
|  | st_data_t * |
| ) |  |

size_t st_memsize | ( | const st_table * | ) |  |

Definition at line 342 of file st.c.

References st_table::entries_packed, st_table::num_bins, and st_table::num_entries.

int st_numcmp | ( | st_data_t | ,
|  | st_data_t |
| ) |  |

Definition at line 1569 of file st.c.

st_index_t st_numhash | ( | st_data_t | ) |  |

Definition at line 1575 of file st.c.

int st_reverse_foreach | ( | st_table * | ,
|  | int(*)(ANYARGS) | ,
|  | st_data_t |
| ) |  |

int st_strcasecmp | ( | const char * | s1,
|  | const char * | s2
| ) |  |

Definition at line 1500 of file st.c.

int st_strncasecmp | ( | const char * | s1,
|  | const char * | s2,
|  | size_t | n
| ) |  |

Definition at line 1524 of file st.c.

int st_update | ( | st_table * | table,
|  | st_data_t | key,
|  | st_update_callback_func * | func,
|  | st_data_t | arg
| ) |  |

Definition at line 834 of file st.c.

References add_direct(), add_packed_direct(), arg, st_table::bins, do_hash, st_table::entries_packed, FIND_ENTRY, find_packed_index(), st_table_entry::fore, i, st_table_entry::key, key, last, st_table_entry::next, st_table::num_bins, PKEY, PVAL, PVAL_SET, real_entries, st_table_entry::record, remove_entry(), remove_packed_entry(), ST_CONTINUE, ST_DELETE, and st_free_entry.