예제 #1
0
/* Cleans up global resources */
void delta_cleanup()
{
	if (hashes_created) {
		rhash_clear(md5_hash);
		rhash_clear(delta_hash);
		rhash_clear(prop_hash);

		hashes_created = 0;
	}
}
예제 #2
0
파일: mukv.c 프로젝트: epu/rsvndump
/* Closes the storage and sends it into oblivion */
int mukv_close(mukv_t *kv)
{
	rhash_clear(kv->index);

	/* Goodbye, data */
	if (fclose(kv->file) != 0 || unlink(kv->path) != 0) {
		return errno;
	}
	return 0;
}
예제 #3
0
파일: hash.c 프로젝트: Jaharmi/MacRuby
static VALUE
rhash_replace(VALUE hash, SEL sel, VALUE hash2)
{
    rhash_modify(hash);
    hash2 = to_hash(hash2);
    if (hash == hash2) {
	return hash;
    }

    // Copy RubyHash properties.
    if (IS_RHASH(hash2)) {
	if (RHASH(hash2)->tbl->type == &identhash) {
	    RHASH(hash)->tbl->type = &identhash;
	}
	GC_WB(&RHASH(hash)->ifnone, RHASH(hash2)->ifnone);
	RHASH(hash)->has_proc_default = RHASH(hash2)->has_proc_default;
    }

    rhash_clear(hash, 0);
    rb_hash_foreach(hash2, replace_i, hash);
    return hash;
}