~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mf_keycaches.c

  • Committer: Monty Taylor
  • Date: 2008-08-02 01:03:15 UTC
  • mto: (236.1.42 codestyle)
  • mto: This revision was merged to the branch mainline in revision 261.
  • Revision ID: monty@inaugust.com-20080802010315-65h5938pymg9d99z
Moved m4 macros to top-level m4 dir, per GNU standards (and where gettext wanted it :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
/* Get key and length for a SAFE_HASH_ENTRY */
79
79
 
80
80
static uchar *safe_hash_entry_get(SAFE_HASH_ENTRY *entry, size_t *length,
81
 
                                  bool not_used __attribute__((unused)))
 
81
                                  my_bool not_used __attribute__((unused)))
82
82
{
83
83
  *length=entry->length;
84
84
  return (uchar*) entry->key;
103
103
    1  error
104
104
*/
105
105
 
106
 
static bool safe_hash_init(SAFE_HASH *hash, uint elements,
 
106
static my_bool safe_hash_init(SAFE_HASH *hash, uint elements,
107
107
                              uchar *default_value)
108
108
{
109
109
  if (hash_init(&hash->hash, &my_charset_bin, elements,
179
179
    1  error (Can only be EOM). In this case my_message() is called.
180
180
*/
181
181
 
182
 
static bool safe_hash_set(SAFE_HASH *hash, const uchar *key, uint length,
 
182
static my_bool safe_hash_set(SAFE_HASH *hash, const uchar *key, uint length,
183
183
                             uchar *data)
184
184
{
185
185
  SAFE_HASH_ENTRY *entry;
186
 
  bool error= 0;
 
186
  my_bool error= 0;
187
187
 
188
188
  rw_wrlock(&hash->mutex);
189
189
  entry= (SAFE_HASH_ENTRY*) hash_search(&hash->hash, key, length);
217
217
      goto end;
218
218
    }
219
219
    entry->key= (uchar*) (entry +1);
220
 
    memcpy(entry->key, key, length);
 
220
    memcpy((char*) entry->key, (char*) key, length);
221
221
    entry->length= length;
222
222
    entry->data= data;
223
223
    /* Link entry to list */
290
290
static SAFE_HASH key_cache_hash;
291
291
 
292
292
 
293
 
bool multi_keycache_init(void)
 
293
my_bool multi_keycache_init(void)
294
294
{
295
295
  return safe_hash_init(&key_cache_hash, 16, (uchar*) dflt_key_cache);
296
296
}
342
342
*/
343
343
 
344
344
 
345
 
bool multi_key_cache_set(const uchar *key, uint length,
 
345
my_bool multi_key_cache_set(const uchar *key, uint length,
346
346
                            KEY_CACHE *key_cache)
347
347
{
348
348
  return safe_hash_set(&key_cache_hash, key, length, (uchar*) key_cache);