[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Anubis cannot be built with a recent gdbm
From: |
Sergey Poznyakoff |
Subject: |
Re: Anubis cannot be built with a recent gdbm |
Date: |
Sat, 06 Jun 2020 12:39:18 +0300 |
Hi, Maxim
Thanks for reporting. Please, apply the attached patch.
> By the way, is there a reason why this project isn't accessible via
> Debbugs?
No special reason, excepting lack of time, perhaps.
Best regards,
Sergey
>From fef44cc1074d71a6cd942ffaf50837cd7054485e Mon Sep 17 00:00:00 2001
From: Sergey Poznyakoff <gray@gnu.org>
Date: Sat, 6 Jun 2020 12:33:27 +0300
Subject: [PATCH] Fix compilation with gdbm 1.18.1
* src/gdbm.c: Rename functions to avoid name clashes with
symbols from libgdbm.
* src/headers.h (gdbm_db_init): Rename to db_gdbm_init.
* src/anubisadm.c: Use db_gdbm_init.
* src/main.c: Likewise.
---
src/anubisadm.c | 2 +-
src/gdbm.c | 28 ++++++++++++++--------------
src/headers.h | 2 +-
src/main.c | 2 +-
4 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/anubisadm.c b/src/anubisadm.c
index 1eff9cb..863b856 100644
--- a/src/anubisadm.c
+++ b/src/anubisadm.c
@@ -353,7 +353,7 @@ main (int argc, char **argv)
dbtext_init ();
# ifdef HAVE_LIBGDBM
- gdbm_db_init ();
+ db_gdbm_init ();
# endif
# ifdef WITH_MYSQL
mysql_db_init ();
diff --git a/src/gdbm.c b/src/gdbm.c
index 58153f8..31dc7cb 100644
--- a/src/gdbm.c
+++ b/src/gdbm.c
@@ -33,7 +33,7 @@
The last two items are optional */
static int
-gdbm_db_open (void **dp, ANUBIS_URL * url, enum anubis_db_mode mode,
+db_gdbm_open (void **dp, ANUBIS_URL * url, enum anubis_db_mode mode,
char const **errp)
{
GDBM_FILE dbf;
@@ -67,7 +67,7 @@ gdbm_db_open (void **dp, ANUBIS_URL * url, enum
anubis_db_mode mode,
}
static int
-gdbm_db_close (void *d)
+db_gdbm_close (void *d)
{
gdbm_close (d);
return ANUBIS_DB_SUCCESS;
@@ -101,7 +101,7 @@ gdbm_content_to_record (char *keystr, datum content,
ANUBIS_USER * rec)
}
static int
-gdbm_db_get (void *d, const char *keystr, ANUBIS_USER * rec, int *errp)
+db_gdbm_get (void *d, const char *keystr, ANUBIS_USER * rec, int *errp)
{
datum key, content;
@@ -118,7 +118,7 @@ gdbm_db_get (void *d, const char *keystr, ANUBIS_USER *
rec, int *errp)
}
static int
-gdbm_db_list (void *d, ANUBIS_LIST list, int *ecode)
+db_gdbm_list (void *d, ANUBIS_LIST list, int *ecode)
{
datum key, content;
@@ -147,7 +147,7 @@ gdbm_db_list (void *d, ANUBIS_LIST list, int *ecode)
}
static int
-gdbm_db_put (void *d, const char *keystr, ANUBIS_USER * rec, int *errp)
+db_gdbm_put (void *d, const char *keystr, ANUBIS_USER * rec, int *errp)
{
size_t size, n;
char *text;
@@ -191,7 +191,7 @@ gdbm_db_put (void *d, const char *keystr, ANUBIS_USER *
rec, int *errp)
}
static int
-gdbm_db_delete (void *d, const char *keystr, int *ecode)
+db_gdbm_delete (void *d, const char *keystr, int *ecode)
{
int rc;
datum key;
@@ -208,21 +208,21 @@ gdbm_db_delete (void *d, const char *keystr, int *ecode)
return rc;
}
-const char *
-gdbm_db_strerror (void *d, int rc)
+static const char *
+db_gdbm_strerror (void *d, int rc)
{
return gdbm_strerror (rc);
}
void
-gdbm_db_init (void)
+db_gdbm_init (void)
{
anubis_db_register ("gdbm",
- gdbm_db_open,
- gdbm_db_close,
- gdbm_db_get,
- gdbm_db_put,
- gdbm_db_delete, gdbm_db_list, gdbm_db_strerror);
+ db_gdbm_open,
+ db_gdbm_close,
+ db_gdbm_get,
+ db_gdbm_put,
+ db_gdbm_delete, db_gdbm_list, db_gdbm_strerror);
}
#endif /* HAVE_LIBGDBM */
diff --git a/src/headers.h b/src/headers.h
index 55665e2..c514429 100644
--- a/src/headers.h
+++ b/src/headers.h
@@ -604,7 +604,7 @@ void anubis_db_free_record (ANUBIS_USER * rec);
void dbtext_init (void);
/* gdbm.c */
-void gdbm_db_init (void);
+void db_gdbm_init (void);
/* mysql.c */
void mysql_db_init (void);
diff --git a/src/main.c b/src/main.c
index 708f859..0f24143 100644
--- a/src/main.c
+++ b/src/main.c
@@ -98,7 +98,7 @@ main (int argc, char *argv[])
#ifdef WITH_GSASL
dbtext_init ();
# ifdef HAVE_LIBGDBM
- gdbm_db_init ();
+ db_gdbm_init ();
# endif
# ifdef WITH_MYSQL
mysql_db_init ();
--
2.9.0