The OpenNET Project / Index page

[ новости /+++ | форум | wiki | теги | ]

Интерактивная система просмотра системных руководств (man-ов)

 ТемаНаборКатегория 
 
 [Cписок руководств | Печать]

dbm_open (3)
  • >> dbm_open (3) ( FreeBSD man: Библиотечные вызовы )
  • dbm_open (3) ( POSIX man: Библиотечные вызовы )

  • BSD mandoc
     

    NAME

    
    
    dbm_clearerr
    
     
    dbm_close
    
     
    dbm_delete
    
     
    dbm_dirfno
    
     
    dbm_error
    
     
    dbm_fetch
    
     
    dbm_firstkey
    
     
    dbm_nextkey
    
     
    dbm_open
    
     
    dbm_store
    
     - database access functions
    
     
    

    SYNOPSIS

       #include <fcntl.h>
       #include <ndbm.h>
    DBM * dbm_open (const char *base int flags int mode);
    void dbm_close (DBM *db);
    int dbm_store (DBM *db datum key datum data int flags);
    datum dbm_fetch (DBM *db datum key);
    int dbm_delete (DBM *db datum key);
    datum dbm_firstkey (DBM *db);
    datum dbm_nextkey (DBM *db);
    int dbm_error (DBM *db);
    int dbm_clearerr (DBM *db);
    int dbm_dirfno (DBM *db);
     

    DESCRIPTION

    Database access functions. These functions are implemented using dbopen(3) with a hash(3) database.

    Vt datum is declared in In ndbm.h :

    typedef struct {
            char *dptr;
            int dsize;
    } datum;
    

    The dbm_open (base flags mode);
    function opens or creates a database. The Fa base argument is the basename of the file containing the database; the actual database has a .db suffix. I.e., if Fa base is Qq Li /home/me/mystuff then the actual database is in the file /home/me/mystuff.db The Fa flags and Fa mode arguments are passed to open(2). (O_RDWR | O_CREAT ) is a typical value for Fa flags ; 0660 is a typical value for Fa mode . O_WRONLY is not allowed in Fa flags . The pointer returned by dbm_open ();
    identifies the database and is the Fa db argument to the other functions. The dbm_open ();
    function returns NULL and sets errno if there were any errors.

    The dbm_close (db);
    function closes the database.

    The dbm_store (db key data flags);
    function inserts or replaces an entry in the database. The Fa flags argument is either DBM_INSERT or DBM_REPLACE If Fa flags is DBM_INSERT and the database already contains an entry for Fa key , that entry is not replaced. Otherwise the entry is replaced or inserted. The dbm_store ();
    function normally returns zero but returns 1 if the entry could not be inserted (because Fa flags is DBM_INSERT and an entry with Fa key already exists) or returns -1 and sets errno if there were any errors.

    The dbm_fetch (db key);
    function returns NULL or the Fa data corresponding to Fa key .

    The dbm_delete (db key);
    function deletes the entry for Fa key . The dbm_delete ();
    function normally returns zero but returns 1 if there was no entry with Fa key in the database or returns -1 and sets errno if there were any errors.

    The dbm_firstkey (db);
    function returns the first key in the database. The dbm_nextkey (db);
    function returns subsequent keys. The db_firstkey ();
    function must be called before dbm_nextkey (.);
    The order in which keys are returned is unspecified and may appear random. The dbm_nextkey ();
    function returns NULL after all keys have been returned.

    The dbm_error (db);
    function returns the errno value of the most recent error. The dbm_clearerr (db);
    function resets this value to 0 and returns 0.

    The dbm_dirfno (db);
    function returns the file descriptor to the database.  

    SEE ALSO

    open(2), dbopen(3), hash(3)  

    STANDARDS

    These functions (except dbm_dirfno ());
    are included in the St -susv2 .


     

    Index

    NAME
    SYNOPSIS
    DESCRIPTION
    SEE ALSO
    STANDARDS


    Поиск по тексту MAN-ов: 




    Партнёры:
    PostgresPro
    Inferno Solutions
    Hosting by Hoster.ru
    Хостинг:

    Закладки на сайте
    Проследить за страницей
    Created 1996-2024 by Maxim Chirkov
    Добавить, Поддержать, Вебмастеру