summaryrefslogtreecommitdiff
path: root/dbm
diff options
context:
space:
mode:
authorIvan Zhakov <ivan@apache.org>2022-11-20 07:14:38 +0000
committerIvan Zhakov <ivan@apache.org>2022-11-20 07:14:38 +0000
commit4f9b76b6f2acc4030ce9ef164322514c5d0e761b (patch)
tree9b993b3753affcbf164056826f9d568d8760b3a1 /dbm
parent961caf5f46055483fa72ab02f5e8baa16c209e2f (diff)
downloadapr-4f9b76b6f2acc4030ce9ef164322514c5d0e761b.tar.gz
Remove trailing whitespaces in *.c.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905414 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dbm')
-rw-r--r--dbm/apr_dbm.c24
-rw-r--r--dbm/apr_dbm_berkeleydb.c6
-rw-r--r--dbm/sdbm/sdbm.c48
-rw-r--r--dbm/sdbm/sdbm_hash.c2
-rw-r--r--dbm/sdbm/sdbm_lock.c2
-rw-r--r--dbm/sdbm/sdbm_pair.c10
6 files changed, 46 insertions, 46 deletions
diff --git a/dbm/apr_dbm.c b/dbm/apr_dbm.c
index 904543bf6..942573644 100644
--- a/dbm/apr_dbm.c
+++ b/dbm/apr_dbm.c
@@ -36,7 +36,7 @@
#include "apr_dbm_private.h"
/* ### note: the setting of DBM_VTABLE will go away once we have multiple
- ### DBMs in here.
+ ### DBMs in here.
### Well, that day is here. So, do we remove DBM_VTABLE and the old
### API entirely? Oh, what to do. We need an APU_DEFAULT_DBM #define.
### Sounds like a job for autoconf. */
@@ -143,9 +143,9 @@ APR_DECLARE(apr_status_t) apr_dbm_get_driver(const apr_dbm_driver_t **vtable,
if (!strcasecmp(type, "default")) type = DBM_NAME;
else if (!strcasecmp(type, "db")) type = "db";
else if (*type && !strcasecmp(type + 1, "dbm")) {
- if (*type == 'G' || *type == 'g') type = "gdbm";
- else if (*type == 'N' || *type == 'n') type = "ndbm";
- else if (*type == 'S' || *type == 's') type = "sdbm";
+ if (*type == 'G' || *type == 'g') type = "gdbm";
+ else if (*type == 'N' || *type == 'n') type = "ndbm";
+ else if (*type == 'S' || *type == 's') type = "sdbm";
}
else usertype = 1;
@@ -232,8 +232,8 @@ APR_DECLARE(apr_status_t) apr_dbm_get_driver(const apr_dbm_driver_t **vtable,
#endif /* APR_HAVE_MODULAR_DSO */
}
-APR_DECLARE(apr_status_t) apr_dbm_open_ex(apr_dbm_t **pdb, const char *type,
- const char *pathname,
+APR_DECLARE(apr_status_t) apr_dbm_open_ex(apr_dbm_t **pdb, const char *type,
+ const char *pathname,
apr_int32_t mode,
apr_fileperms_t perm,
apr_pool_t *pool)
@@ -245,9 +245,9 @@ APR_DECLARE(apr_status_t) apr_dbm_open_ex(apr_dbm_t **pdb, const char *type,
rv = (vtable->open)(pdb, pathname, mode, perm, pool);
}
return rv;
-}
+}
-APR_DECLARE(apr_status_t) apr_dbm_open(apr_dbm_t **pdb, const char *pathname,
+APR_DECLARE(apr_status_t) apr_dbm_open(apr_dbm_t **pdb, const char *pathname,
apr_int32_t mode, apr_fileperms_t perm,
apr_pool_t *pool)
{
@@ -319,8 +319,8 @@ APR_DECLARE(char *) apr_dbm_geterror(apr_dbm_t *dbm, int *errcode,
return errbuf;
}
-APR_DECLARE(apr_status_t) apr_dbm_get_usednames_ex(apr_pool_t *p,
- const char *type,
+APR_DECLARE(apr_status_t) apr_dbm_get_usednames_ex(apr_pool_t *p,
+ const char *type,
const char *pathname,
const char **used1,
const char **used2)
@@ -333,14 +333,14 @@ APR_DECLARE(apr_status_t) apr_dbm_get_usednames_ex(apr_pool_t *p,
return APR_SUCCESS;
}
return rv;
-}
+}
APR_DECLARE(void) apr_dbm_get_usednames(apr_pool_t *p,
const char *pathname,
const char **used1,
const char **used2)
{
- apr_dbm_get_usednames_ex(p, DBM_NAME, pathname, used1, used2);
+ apr_dbm_get_usednames_ex(p, DBM_NAME, pathname, used1, used2);
}
/* Most DBM libraries take a POSIX mode for creating files. Don't trust
diff --git a/dbm/apr_dbm_berkeleydb.c b/dbm/apr_dbm_berkeleydb.c
index 6c9457fae..0693b7d81 100644
--- a/dbm/apr_dbm_berkeleydb.c
+++ b/dbm/apr_dbm_berkeleydb.c
@@ -28,7 +28,7 @@
#include "apu.h"
#include "apr_private.h"
-#if APU_HAVE_DB
+#if APU_HAVE_DB
#include "apr_dbm_private.h"
/*
@@ -169,8 +169,8 @@ static apr_status_t vt_db_open(apr_dbm_t **pdb, const char *pathname,
#if DB_VER == 4
NULL,
#endif
- pathname, NULL,
- DB_HASH, dbmode,
+ pathname, NULL,
+ DB_HASH, dbmode,
apr_posix_perms2mode(perm))) != 0) {
/* close the DB handler */
(void) (*file.bdb->close)(file.bdb, 0);
diff --git a/dbm/sdbm/sdbm.c b/dbm/sdbm/sdbm.c
index 9ad9d20ff..0156359ca 100644
--- a/dbm/sdbm/sdbm.c
+++ b/dbm/sdbm/sdbm.c
@@ -98,7 +98,7 @@ static apr_status_t prep(apr_sdbm_t **pdb, const char *dirname, const char *pagn
db->pool = p;
/*
- * adjust user flags so that WRONLY becomes RDWR,
+ * adjust user flags so that WRONLY becomes RDWR,
* as required by this package. Also set our internal
* flag for RDONLY if needed.
*/
@@ -132,7 +132,7 @@ static apr_status_t prep(apr_sdbm_t **pdb, const char *dirname, const char *pagn
!= APR_SUCCESS)
goto error;
- if ((status = apr_sdbm_lock(db, (db->flags & SDBM_RDONLY)
+ if ((status = apr_sdbm_lock(db, (db->flags & SDBM_RDONLY)
? APR_FLOCK_SHARED
: APR_FLOCK_EXCLUSIVE))
!= APR_SUCCESS)
@@ -143,7 +143,7 @@ static apr_status_t prep(apr_sdbm_t **pdb, const char *dirname, const char *pagn
*/
/*
- * if we are opened in SHARED mode, unlock ourself
+ * if we are opened in SHARED mode, unlock ourself
*/
if (db->flags & SDBM_SHARED)
if ((status = apr_sdbm_unlock(db)) != APR_SUCCESS)
@@ -168,13 +168,13 @@ error:
return status;
}
-APR_DECLARE(apr_status_t) apr_sdbm_open(apr_sdbm_t **db, const char *file,
- apr_int32_t flags,
+APR_DECLARE(apr_status_t) apr_sdbm_open(apr_sdbm_t **db, const char *file,
+ apr_int32_t flags,
apr_fileperms_t perms, apr_pool_t *p)
{
char *dirname = apr_pstrcat(p, file, APR_SDBM_DIRFEXT, NULL);
char *pagname = apr_pstrcat(p, file, APR_SDBM_PAGFEXT, NULL);
-
+
return prep(db, dirname, pagname, flags, perms, p);
}
@@ -187,7 +187,7 @@ APR_DECLARE(apr_status_t) apr_sdbm_fetch(apr_sdbm_t *db, apr_sdbm_datum_t *val,
apr_sdbm_datum_t key)
{
apr_status_t status;
-
+
if (db == NULL || bad(key))
return APR_EINVAL;
@@ -208,23 +208,23 @@ static apr_status_t write_page(apr_sdbm_t *db, const char *buf, long pagno)
{
apr_status_t status;
apr_off_t off = OFF_PAG(pagno);
-
+
if ((status = apr_file_seek(db->pagf, APR_SET, &off)) == APR_SUCCESS)
status = apr_file_write_full(db->pagf, buf, PBLKSIZ, NULL);
return status;
}
-APR_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db,
+APR_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db,
const apr_sdbm_datum_t key)
{
apr_status_t status;
-
+
if (db == NULL || bad(key))
return APR_EINVAL;
if (apr_sdbm_rdonly(db))
return APR_EINVAL;
-
+
if ((status = apr_sdbm_lock(db, APR_FLOCK_EXCLUSIVE)) != APR_SUCCESS)
return status;
@@ -247,7 +247,7 @@ APR_DECLARE(apr_status_t) apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key,
int need;
register long hash;
apr_status_t status;
-
+
if (db == NULL || bad(key))
return APR_EINVAL;
if (apr_sdbm_rdonly(db))
@@ -290,7 +290,7 @@ APR_DECLARE(apr_status_t) apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key,
}
error:
- (void) apr_sdbm_unlock(db);
+ (void) apr_sdbm_unlock(db);
return status;
}
@@ -328,10 +328,10 @@ static apr_status_t makroom(apr_sdbm_t *db, long hash, int need)
* here, as sdbm_store will do so, after it inserts the incoming pair.
*/
if (hash & (db->hmask + 1)) {
- if ((status = write_page(db, db->pagbuf, db->pagbno))
+ if ((status = write_page(db, db->pagbuf, db->pagbno))
!= APR_SUCCESS)
return status;
-
+
db->pagbno = newp;
(void) memcpy(pag, new, PBLKSIZ);
}
@@ -356,11 +356,11 @@ static apr_status_t makroom(apr_sdbm_t *db, long hash, int need)
db->curbit = 2 * db->curbit
+ ((hash & (db->hmask + 1)) ? 2 : 1);
db->hmask |= db->hmask + 1;
-
+
if ((status = write_page(db, db->pagbuf, db->pagbno))
!= APR_SUCCESS)
return status;
-
+
} while (--smax);
/*
@@ -380,7 +380,7 @@ static apr_status_t makroom(apr_sdbm_t *db, long hash, int need)
* If 'create' is asked and EOF is returned while reading, this is taken
* as success (i.e. a cleared buffer is returned).
*/
-static apr_status_t read_from(apr_file_t *f, void *buf,
+static apr_status_t read_from(apr_file_t *f, void *buf,
apr_off_t off, apr_size_t len,
int create)
{
@@ -402,11 +402,11 @@ static apr_status_t read_from(apr_file_t *f, void *buf,
* the following two routines will break if
* deletions aren't taken into account. (ndbm bug)
*/
-APR_DECLARE(apr_status_t) apr_sdbm_firstkey(apr_sdbm_t *db,
+APR_DECLARE(apr_status_t) apr_sdbm_firstkey(apr_sdbm_t *db,
apr_sdbm_datum_t *key)
{
apr_status_t status;
-
+
if ((status = apr_sdbm_lock(db, APR_FLOCK_SHARED)) != APR_SUCCESS)
return status;
@@ -424,11 +424,11 @@ APR_DECLARE(apr_status_t) apr_sdbm_firstkey(apr_sdbm_t *db,
return status;
}
-APR_DECLARE(apr_status_t) apr_sdbm_nextkey(apr_sdbm_t *db,
+APR_DECLARE(apr_status_t) apr_sdbm_nextkey(apr_sdbm_t *db,
apr_sdbm_datum_t *key)
{
apr_status_t status;
-
+
if ((status = apr_sdbm_lock(db, APR_FLOCK_SHARED)) != APR_SUCCESS)
return status;
@@ -468,7 +468,7 @@ static apr_status_t getpage(apr_sdbm_t *db, long hash, int by_num, int create)
* see if the block we need is already in memory.
* note: this lookaside cache has about 10% hit rate.
*/
- if (pagb != db->pagbno) {
+ if (pagb != db->pagbno) {
/*
* note: here, we assume a "hole" is read as 0s.
* if not, must zero pagbuf first.
@@ -529,7 +529,7 @@ static apr_status_t setdbit(apr_sdbm_t *db, long dbit)
return status;
db->dirbno = dirb;
-
+
debug(("dir read: %d\n", dirb));
}
diff --git a/dbm/sdbm/sdbm_hash.c b/dbm/sdbm/sdbm_hash.c
index e4d751794..a3c6492b5 100644
--- a/dbm/sdbm/sdbm_hash.c
+++ b/dbm/sdbm/sdbm_hash.c
@@ -31,7 +31,7 @@
* [this seems to work remarkably well, in fact better
* then the ndbm hash function. Replace at your own risk]
* use: 65599 nice.
- * 65587 even better.
+ * 65587 even better.
*/
long sdbm_hash(const char *str, int len)
{
diff --git a/dbm/sdbm/sdbm_lock.c b/dbm/sdbm/sdbm_lock.c
index 9241c1fb6..d5e3df851 100644
--- a/dbm/sdbm/sdbm_lock.c
+++ b/dbm/sdbm/sdbm_lock.c
@@ -48,7 +48,7 @@ APR_DECLARE(apr_status_t) apr_sdbm_lock(apr_sdbm_t *db, int type)
* zero size: either a fresh database, or one with a single,
* unsplit data page: dirpage is all zeros.
*/
- if ((status = apr_file_lock(db->dirf, type)) == APR_SUCCESS)
+ if ((status = apr_file_lock(db->dirf, type)) == APR_SUCCESS)
{
apr_finfo_t finfo;
if ((status = apr_file_info_get(&finfo, APR_FINFO_SIZE, db->dirf))
diff --git a/dbm/sdbm/sdbm_pair.c b/dbm/sdbm/sdbm_pair.c
index 50d7965b1..3277d69dd 100644
--- a/dbm/sdbm/sdbm_pair.c
+++ b/dbm/sdbm/sdbm_pair.c
@@ -34,8 +34,8 @@
#define exhash(item) sdbm_hash((item).dptr, (item).dsize)
-/*
- * forward
+/*
+ * forward
*/
static int seepair(char *, int, char *, int);
@@ -270,7 +270,7 @@ long sbit;
n = ino[0];
for (ino++; n > 0; ino += 2) {
- key.dptr = cur + ino[0];
+ key.dptr = cur + ino[0];
key.dsize = off - ino[0];
val.dptr = cur + ino[1];
val.dsize = ino[0] - ino[1];
@@ -283,13 +283,13 @@ long sbit;
n -= 2;
}
- debug(("%d split %d/%d\n", ((short *) cur)[0] / 2,
+ debug(("%d split %d/%d\n", ((short *) cur)[0] / 2,
((short *) new)[0] / 2,
((short *) pag)[0] / 2));
}
/*
- * check page sanity:
+ * check page sanity:
* number of entries should be something
* reasonable, and all offsets in the index should be in order.
* this could be made more rigorous.