Bug 198597

Summary: dbopen man page is broken
Product: [Fedora] Fedora Reporter: Nigel Horne <njh>
Component: db4Assignee: Ivana Varekova <varekova>
Status: CLOSED RAWHIDE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 5CC: jnovy, varekova
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-07-13 06:54:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
db4-devel demonstration program none

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.