ndbm.h(0P)

🌸 ndbm.h β€” the bestie of database headers πŸ’Ύβœ¨

okay so real talk β€” this page is from the POSIX Programmer's Manual (0P section, iykyk). Heads up bestie: the Linux implementation of this interface may differ from what's written here (so like, go check the corresponding Linux manual page for the actual Linux tea β˜•), or honestly the interface might just not be implemented on Linux at all. πŸ™ˆ


✨ NAME ✨

ndbm.h β€” definitions for ndbm database operations πŸ—‚οΈπŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <ndbm.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

So the <ndbm.h> header shall define the datum type as a structure, and that structure shall include at least these members:

void   *dptr  A pointer to the application's data.
size_t  dsize The size of the object pointed to by dptr.

Like, dptr is the pointer to your data, and dsize is how big the thing that dptr points to actually is. slay. πŸ’…

The <ndbm.h> header shall define the size_t type as described in <stddef.h>. 🫢

The <ndbm.h> header shall define the DBM type. (iconic, no notes.)

The <ndbm.h> header shall define these symbolic constants as possible values for the store_mode argument to dbm_store():

  • DBM_INSERT β€” insertion of new entries only. no replacing, we're just adding, periodt. ✨
  • DBM_REPLACE β€” allow replacing existing entries. out with the old, in with the new πŸ’…

And these shall be declared as functions, and may also be defined as macros (yes bestie, either one). Function prototypes shall be provided:

int     dbm_clearerr(DBM *);
void    dbm_close(DBM *);
int     dbm_delete(DBM *, datum);
int     dbm_error(DBM *);
datum   dbm_fetch(DBM *, datum);
datum   dbm_firstkey(DBM *);
datum   dbm_nextkey(DBM *);
DBM    *dbm_open(const char *, int, mode_t);
int     dbm_store(DBM *, datum, datum, int);

The <ndbm.h> header shall define the mode_t type through typedef, as described in <sys/types.h>. 🧚

The following sections are informative β€” so like, they're the vibes section, not the rules section. πŸ’€

🌈 APPLICATION USAGE 🌈

None. literally nothing. we're all caught up bestie πŸ’€βœ¨


⭐ RATIONALE ⭐

None. again, nothing. the reasoning is giving mystery πŸ•΅οΈβ™€οΈπŸ’œ


πŸ¦„ FUTURE DIRECTIONS πŸ¦„

None. the future is lowkey unwritten, no cap. 🌸


πŸ‘‘ SEE ALSO πŸ‘‘

  • <stddef.h>
  • <sys_types.h>
  • The System Interfaces volume of POSIX.1‐2017, dbm_clearerr()

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the whole page bestie 🫢 β€” brought to you by IEEE/The Open Group, 2017, filed under ndbm.h(0P) (POSIX Programmer's Manual, section 0P). go forth and #include <ndbm.h> responsibly, mwah πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from