key?(p1)
Returns true if the database contains the specified key, false otherwise.
static VALUE fdbm_has_key(VALUE obj, VALUE keystr) { datum key, val; struct dbmdata *dbmp; DBM *dbm; long len; ExportStringValue(keystr); len = RSTRING_LEN(keystr); if (TOO_LONG(len)) return Qfalse; key.dptr = RSTRING_PTR(keystr); key.dsize = (DSIZE_TYPE)len; GetDBM2(obj, dbmp, dbm); val = dbm_fetch(dbm, key); if (val.dptr) return Qtrue; return Qfalse; }