SHA256
3
0
forked from pool/gdbm
OBS User unknown 2008-02-29 22:56:31 +00:00 committed by Git OBS Bridge
parent 4055660b93
commit 2f84e1cf26
5 changed files with 321 additions and 38 deletions

138
gdbm-fix_testprogs.patch Normal file
View File

@ -0,0 +1,138 @@
--- testdbm.c
+++ testdbm.c
@@ -31,6 +31,9 @@
#include "autoconf.h"
#include <stdio.h>
+#if HAVE_STRING_H
+#include <string.h>
+#endif
#include <sys/types.h>
#if HAVE_STDLIB_H
#include <stdlib.h>
@@ -39,19 +42,15 @@
#include <sys/file.h>
#endif
#include <sys/stat.h>
+#ifdef GNU
+#include "dbm.h"
+#else
+#include <dbm.h>
+#endif
#define TRUE 1
#define FALSE 0
-typedef struct {
- char *dptr;
- int dsize;
-} datum;
-
-extern datum fetch ();
-extern datum firstkey ();
-extern datum nextkey ();
-
/* The test program allows one to call all the routines plus the hash function.
The commands are single letter commands. The user is prompted for all other
information. The commands are q (quit), f (fetch), s (store), d (delete),
@@ -123,7 +122,7 @@
case 'f':
printf ("key -> ");
- gets (key_line);
+ fgets (key_line, sizeof(key_line), stdin);
key_data.dptr = key_line;
key_data.dsize = strlen (key_line)+1;
return_data = fetch (key_data);
@@ -135,11 +134,11 @@
case 's':
printf ("key -> ");
- gets (key_line);
+ fgets (key_line, sizeof(key_line), stdin);
key_data.dptr = key_line;
key_data.dsize = strlen (key_line)+1;
printf ("data -> ");
- gets (data_line);
+ fgets (data_line, sizeof(data_line), stdin);
data_data.dsize = strlen (data_line)+1;
if (store (key_data, data_data) != 0)
printf ("Item not inserted. \n");
@@ -148,7 +147,7 @@
case 'd':
printf ("key -> ");
- gets (key_line);
+ fgets (key_line, sizeof(key_line), stdin);
key_data.dptr = key_line;
key_data.dsize = strlen (key_line)+1;
if (delete (key_data) != 0)
--- testgdbm.c
+++ testgdbm.c
@@ -37,10 +37,22 @@
#include "getopt.h"
+#if defined(__GNUC__) && __GNUC__ >=3
+# define NORETURN __attribute__((__noreturn__))
+#else
+# define NORETURN
+#endif
+
extern const char * gdbm_version;
extern const char *gdbm_strerror __P((gdbm_error));
+void print_bucket __P((hash_bucket *bucket, char *mesg));
+void _gdbm_print_avail_list __P((gdbm_file_info *dbf));
+void _gdbm_print_bucket_cache __P((gdbm_file_info *dbf));
+void usage __P((char *)) NORETURN;
+
+
gdbm_file_info *gdbm_file;
/* Debug procedure to print the contents of the current hash bucket. */
--- testndbm.c
+++ testndbm.c
@@ -42,6 +42,9 @@
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
#ifdef GNU
#include "ndbm.h"
#else
@@ -120,7 +123,7 @@
case 'f':
printf ("key -> ");
- gets (key_line);
+ fgets (key_line, sizeof(key_line), stdin);
key_data.dptr = key_line;
key_data.dsize = strlen (key_line)+1;
return_data = dbm_fetch (dbm_file, key_data);
@@ -132,11 +135,11 @@
case 's':
printf ("key -> ");
- gets (key_line);
+ fgets (key_line, sizeof(key_line), stdin);
key_data.dptr = key_line;
key_data.dsize = strlen (key_line)+1;
printf ("data -> ");
- gets (data_line);
+ fgets (data_line, sizeof(data_line), stdin);
data_data.dsize = strlen (data_line)+1;
if (dbm_store (dbm_file, key_data, data_data, DBM_REPLACE) != 0)
printf ("Item not inserted. \n");
@@ -145,7 +148,7 @@
case 'd':
printf ("key -> ");
- gets (key_line);
+ fgets (key_line, sizeof(key_line), stdin);
key_data.dptr = key_line;
key_data.dsize = strlen (key_line)+1;
if (dbm_delete (dbm_file, key_data) != 0)

View File

@ -0,0 +1,114 @@
--- dbm.h
+++ dbm.h
@@ -1,7 +1,7 @@
/* dbm.h - The include file for dbm users. */
/* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson.
- Copyright (C) 1990, 1991, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1991, 1993, 2008 Free Software Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,21 +32,31 @@
int dsize;
} datum;
+/* The file information header. This is good enough for most applications. */
+typedef struct {int dummy[10];} DBM;
-/* These are the routines in dbm. */
-extern int dbminit ();
+/* Determine if the C(++) compiler requires complete function prototype */
+#ifndef __P
+#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
+#define __P(x) x
+#else
+#define __P(x) ()
+#endif
+#endif
+
+/* These are the routines in dbm. */
-extern datum fetch ();
+extern int dbminit __P((char *file));
-extern int store ();
+extern datum fetch __P((datum key));
-extern int delete ();
+extern int store __P((datum key, datum content));
-extern int delete ();
+extern int delete __P((datum key));
-extern datum firstkey ();
+extern datum firstkey __P((void));
-extern datum nextkey ();
+extern datum nextkey __P((datum key));
-extern int dbmclose ();
+extern int dbmclose __P((DBM *));
--- ndbm.h
+++ ndbm.h
@@ -1,7 +1,7 @@
/* ndbm.h - The include file for ndbm users. */
/* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson.
- Copyright (C) 1990, 1991, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1991, 1993, 2008 Free Software Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,31 +41,39 @@
/* The file information header. This is good enough for most applications. */
typedef struct {int dummy[10];} DBM;
+/* Determine if the C(++) compiler requires complete function prototype */
+#ifndef __P
+#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
+#define __P(x) x
+#else
+#define __P(x) ()
+#endif
+#endif
/* These are the routines (with some macros defining them!) */
-extern DBM *dbm_open ();
+extern DBM *dbm_open __P((char *file, int flags, int mode));
-extern void dbm_close ();
+extern void dbm_close __P((DBM *dbf));
-extern datum dbm_fetch ();
+extern datum dbm_fetch __P((DBM *dbf, datum key));
-extern int dbm_store ();
+extern int dbm_store __P((DBM *dbf, datum key, datum content, int flags));
-extern int dbm_delete ();
+extern int dbm_delete __P((DBM *dbf, datum key));
-extern int dbm_delete ();
+extern int dbm_delete __P((DBM *dbf, datum key));
-extern datum dbm_firstkey ();
+extern datum dbm_firstkey __P((DBM *));
-extern datum dbm_nextkey ();
+extern datum dbm_nextkey __P((DBM *));
#define dbm_error(dbf) (0)
#define dbm_clearerr(dbf)
-extern int dbm_dirfno ();
+extern int dbm_dirfno __P((DBM *dbf));
-extern int dbm_pagfno ();
+extern int dbm_pagfno __P((DBM *dbf));
-extern int dbm_rdonly ();
+extern int dbm_rdonly __P((DBM *dbf));

View File

@ -0,0 +1,11 @@
--- gdbmseq.c
+++ gdbmseq.c
@@ -41,6 +41,8 @@
at ELEM_LOC of the current bucket and using RETURN_VAL as the place to
put the data that is found. */
+static void get_next_key __P((gdbm_file_info *, int, datum *));
+
static void
get_next_key (dbf, elem_loc, return_val)
gdbm_file_info *dbf;

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Feb 28 13:05:02 CET 2008 - pth@suse.de
- Add ANSI prototypes to dbm.h and ndbm.h (protected by macros)
- Provide full prototype for static function.
- Fix test* apps by including appropriate headers and calling
fgets instead of gets.
-------------------------------------------------------------------
Wed Dec 26 17:57:10 CET 2007 - crrodriguez@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package gdbm (Version 1.8.3)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@ -10,6 +10,7 @@
# norootforbuild
Name: gdbm
Url: http://directory.fsf.org/GNU/gdbm.html
#!BuildIgnore: man
@ -18,10 +19,13 @@ License: GPL v2 or later
Group: System/Libraries
AutoReqProv: on
Version: 1.8.3
Release: 313
Release: 327
Summary: GNU Database Routines
Source: ftp://prep.ai.mit.edu/gnu/gdbm/gdbm-%{version}.tar.bz2
Patch: gdbm-%{version}.dif
Patch1: gdbm-protoize_dbm_headers.patch
Patch2: gdbm-prototype_static_functions.patch
Patch3: gdbm-fix_testprogs.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -30,7 +34,7 @@ A static and dynamic library for the GNU database routines.
%package devel
Summary: Include Files and Libraries mandatory for Development.
Summary: Include Files and Libraries mandatory for Development
Group: Development/Libraries/C and C++
Requires: gdbm = %{version}
Provides: gdbm:/usr/lib/libgdbm.so
@ -51,6 +55,9 @@ Authors:
%prep
%setup -q
%patch
%patch1
%patch2
%patch3
%build
aclocal
@ -111,77 +118,82 @@ rm -rf $RPM_BUILD_ROOT
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%changelog
* Wed Dec 26 2007 - crrodriguez@suse.de
* Thu Feb 28 2008 pth@suse.de
- Add ANSI prototypes to dbm.h and ndbm.h (protected by macros)
- Provide full prototype for static function.
- Fix test* apps by including appropriate headers and calling
fgets instead of gets.
* Wed Dec 26 2007 crrodriguez@suse.de
- both libgdbm.la and libgdbm_compat.la had empty dependency_libs
and has been removed.
- fix library-without-ldconfig-post* errors
* Wed Jan 25 2006 - mls@suse.de
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Wed Aug 24 2005 - kukuk@suse.de
* Wed Aug 24 2005 kukuk@suse.de
- Don't reuse old temporary files in gdbm_reorganize [#105763]
* Mon Aug 30 2004 - schwab@suse.de
* Mon Aug 30 2004 schwab@suse.de
- Fix uses of libtool.
* Fri Nov 21 2003 - kukuk@suse.de
* Fri Nov 21 2003 kukuk@suse.de
- Compile with no execstack
- Build as normal user
* Wed Jul 02 2003 - kukuk@suse.de
* Wed Jul 02 2003 kukuk@suse.de
- Remove man from buildsystem
* Mon May 12 2003 - kukuk@suse.de
* Mon May 12 2003 kukuk@suse.de
- Use defattr
* Thu Apr 24 2003 - ro@suse.de
* Thu Apr 24 2003 ro@suse.de
- fix install_info --delete call and move from preun to postun
* Fri Feb 07 2003 - ro@suse.de
* Fri Feb 07 2003 ro@suse.de
- added install_info macros
* Fri Jan 10 2003 - kukuk@suse.de
* Fri Jan 10 2003 kukuk@suse.de
- Use fcntl instead of flock for locking
* Mon Dec 02 2002 - kukuk@suse.de
* Mon Dec 02 2002 kukuk@suse.de
- Update to gdbm 1.8.3 (lot of bug fixes)
* Fri Aug 09 2002 - kukuk@suse.de
* Fri Aug 09 2002 kukuk@suse.de
- Fix requires for gdbm-devel [Bug #17543]
* Thu May 30 2002 - olh@suse.de
* Thu May 30 2002 olh@suse.de
- use aclocal + autoreconf --force --install, fix for ppc64
* Wed Apr 17 2002 - kukuk@suse.de
* Wed Apr 17 2002 kukuk@suse.de
- Remove gdbm 1.7.3
* Tue Dec 11 2001 - froh@suse.de
* Tue Dec 11 2001 froh@suse.de
- the Makefile.in of gdbm 1.7 is missing @libdir@, instead of patching
that we follow sparc64 and ia64 and just ommit gdbm 1.7 on s390x.
* Thu Mar 22 2001 - ro@suse.de
* Thu Mar 22 2001 ro@suse.de
- added split-aliases as provides
* Fri Oct 27 2000 - kukuk@suse.de
* Fri Oct 27 2000 kukuk@suse.de
- Create devel subpackage
* Mon Sep 25 2000 - kukuk@suse.de
* Mon Sep 25 2000 kukuk@suse.de
- Use BuildRoot
* Thu Jun 01 2000 - kukuk@suse.de
* Thu Jun 01 2000 kukuk@suse.de
- Add group tag
* Tue Apr 04 2000 - kukuk@suse.de
* Tue Apr 04 2000 kukuk@suse.de
- Add ltconfig fix
* Tue Apr 04 2000 - kukuk@suse.de
* Tue Apr 04 2000 kukuk@suse.de
- Add automake to need for build
* Mon Apr 03 2000 - bk@suse.de
* Mon Apr 03 2000 bk@suse.de
- s390 team added config.{sub,guess} update macros for s390
* Thu Feb 03 2000 - schwab@suse.de
* Thu Feb 03 2000 schwab@suse.de
- Update config.{guess,sub} to latest version.
* Fri Jan 21 2000 - kukuk@suse.de
* Fri Jan 21 2000 kukuk@suse.de
- Move /usr/{info,man} -> /usr/share/{info,man}
* Mon Oct 18 1999 - kukuk@suse.de
* Mon Oct 18 1999 kukuk@suse.de
- gdbm 1.8.0: Fix memory leak
* Mon Sep 13 1999 - bs@suse.de
* Mon Sep 13 1999 bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Fri Aug 27 1999 - kukuk@suse.de
* Fri Aug 27 1999 kukuk@suse.de
- Fix file list
* Thu Aug 26 1999 - kukuk@suse.de
* Thu Aug 26 1999 kukuk@suse.de
- Add libgdbm 1.8.0 as default
* Mon Jun 28 1999 - kukuk@suse.de
* Mon Jun 28 1999 kukuk@suse.de
- Add libndbm.so and libndbm.a link
* Mon Mar 01 1999 - ro@suse.de
* Mon Mar 01 1999 ro@suse.de
- added ndbm.h for glibc-2.1
* Mon Feb 22 1999 - ro@suse.de
* Mon Feb 22 1999 ro@suse.de
- link explicitly with -lc
* Fri Dec 18 1998 - ro@suse.de
* Fri Dec 18 1998 ro@suse.de
- respect alpha in specfile
* Mon Dec 07 1998 - ro@suse.de
* Mon Dec 07 1998 ro@suse.de
- pack ndbm.h only for libc5
* Mon Oct 20 1997 - ro@suse.de
* Mon Oct 20 1997 ro@suse.de
- ready for autobuild
* Thu Jan 02 1997 - florian@suse.de
* Thu Jan 02 1997 florian@suse.de
- add ndbm.h header files