Ruby: ext/dbm/dbm.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Data Structures | Macros | Functions
dbm.c File Reference
`#include "ruby.h"`
`#include <DBM_HDR>`
`#include <fcntl.h>`
`#include <errno.h>`

Go to the source code of this file.

## Data Structures
struct | dbmdata

## Macros
#define | DSIZE_TYPE TYPEOF_DATUM_DSIZE
#define | RSTRING_DSIZE(s) RSTRING_LENINT(s)
#define | TOO_LONG(n) ((long)(+(DSIZE_TYPE)(n)) != (n))
#define | RUBY_DBM_RW_BIT 0x20000000
#define | GetDBM(obj, dbmp)
#define | GetDBM2(obj, dbmp, dbm)
#define | O_CLOEXEC 0

## Functions
void | Init_dbm (void)

## Macro Definition Documentation

## ◆ DSIZE_TYPE

#define DSIZE_TYPE TYPEOF_DATUM_DSIZE

Definition at line 24 of file dbm.c.

## ◆ GetDBM

#define GetDBM | ( |  | obj,
|  |  | dbmp
| ) |  |

Value:
do {\
TypedData_Get_Struct((obj), struct dbmdata, &dbm_type, (dbmp));\
if ((dbmp)->di_dbm == 0) closed_dbm();\
} while (0)
dbmdata
Definition: dbm.c:37

Definition at line 50 of file dbm.c.

## ◆ GetDBM2

#define GetDBM2 | ( |  | obj,
|  |  | dbmp,
|  |  | dbm
| ) |  |

Value:
do {\
GetDBM((obj), (dbmp));\
(dbm) = (dbmp)->di_dbm;\
} while (0)

Definition at line 55 of file dbm.c.

## ◆ O_CLOEXEC

#define O_CLOEXEC 0

## ◆ RSTRING_DSIZE

#define RSTRING_DSIZE | ( |  | s | ) | RSTRING_LENINT(s)

Definition at line 29 of file dbm.c.

## ◆ RUBY_DBM_RW_BIT

#define RUBY_DBM_RW_BIT 0x20000000

Definition at line 35 of file dbm.c.

## ◆ TOO_LONG

#define TOO_LONG | ( |  | n | ) | ((long)(+(DSIZE_TYPE)(n)) != (n))

Definition at line 30 of file dbm.c.

## Function Documentation

## ◆ Init_dbm()

void Init_dbm | ( | void |  | ) |

Definition at line 1041 of file dbm.c.

References INT2FIX, NULL, rb_cObject, rb_define_alloc_func(), rb_define_class(), rb_define_const(), rb_define_method, rb_define_singleton_method, rb_eStandardError, rb_include_module(), rb_mEnumerable, rb_sprintf(), rb_str_new2, RUBY_DBM_RW_BIT, and RUBY_EXTERN.