Bug 198597 - dbopen man page is broken
Summary: dbopen man page is broken
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: db4
Version: 5
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ivana Varekova
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-07-12 07:38 UTC by Nigel Horne
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-07-13 06:54:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
db4-devel demonstration program (702 bytes, text/x-csrc)
2006-07-13 08:10 UTC, Nigel Horne
no flags Details

Description Nigel Horne 2006-07-12 07:38:12 UTC
Description of problem:

I wrote the following program as per the dbopen man page:

#include <sys/types.h>
#include <limits.h>
#include <db.h>
#include <fcntl.h>
#include <errno.h>

int
main()
{
        DB *db = dbopen("/etc/aliases.db", O_RDONLY, O_RDONLY, DB_HASH, NULL);

        if(db == NULL) {
                perror("/etc/aliases.db");
                return errno;
        }
        return db->close(db);
}

However it fails to compile:

dbopen.c: In function âmainâ:
dbopen.c:10: warning: initialization makes pointer from integer without a cast
dbopen.c:16: error: too few arguments to function âdb->closeâ



Version-Release number of selected component (if applicable):
db4-4.3.29-3.fc5

How reproducible:
Every time

Steps to Reproduce:
1. cc file.c
2.
3.
  
Actual results:
As above

Expected results:
Should compile

Additional info:
The man page is the real problem here

Comment 1 Jindrich Novy 2006-07-12 11:28:08 UTC
Yes, the man page qualifies in the most-obsolete top ten hitparade. It's
generally better to look into the c_api HTML documentation db4-devel have in
/usr/share/doc which is much more recent.

The original dbopen man page comes from man-pages package so I'll try to
convince the man-pages maintainer (Ivana) to remove all db4 related man pages so
that I can package it as part of db4-devel.

Ivana, is that ok?

Thanks.

Comment 2 Ivana Varekova 2006-07-12 12:52:00 UTC
Yes, of course. 
Which man-pages do you want to remove?


Comment 3 Jindrich Novy 2006-07-12 12:57:59 UTC
These for now:

btree.3  dbopen.3  hash.3  mpool.3  recno.3

They are mostly identical to the ones in man-pages, but it's better to keep them
with db4, where I'm going to patch it to keep them more recent.

Comment 4 Jindrich Novy 2006-07-12 13:52:54 UTC
While looking a bit more into it I found that the noted man pages are for a
pretty ancient db-1.85, so it makes sense to let them be removed as db4 ships
only HTML information about its API what also caused your man page confusion.

Comment 5 Ivana Varekova 2006-07-13 06:54:23 UTC
The man pages are removed from the version man-pages-2.34-2.

Comment 6 Nigel Horne 2006-07-13 08:10:30 UTC
Created attachment 132354 [details]
db4-devel demonstration program

This is a simple program demonstrating how to use db4 which you may wish to add
to the documentation.


Note You need to log in before you can comment on or make changes to this bug.