diff --git a/include/cdbw.h b/include/cdbw.h index 67e27de70c41..763dcbd60011 100644 --- a/include/cdbw.h +++ b/include/cdbw.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdbw.h,v 1.2 2012/06/03 21:21:45 joerg Exp $ */ +/* $NetBSD: cdbw.h,v 1.3 2023/08/08 10:34:08 riastradh Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. * All rights reserved. @@ -50,7 +50,7 @@ int cdbw_put_data(struct cdbw *, const void *, size_t, int cdbw_put_key(struct cdbw *, const void *, size_t, uint32_t); uint32_t cdbw_stable_seeder(void); -int cdbw_output(struct cdbw *, int, const char[16], +int cdbw_output(struct cdbw *, int, const char *, uint32_t (*)(void)); void cdbw_close(struct cdbw *); diff --git a/lib/libc/cdb/cdbw.3 b/lib/libc/cdb/cdbw.3 index 3d3a09d3f93e..4f7994a6d18d 100644 --- a/lib/libc/cdb/cdbw.3 +++ b/lib/libc/cdb/cdbw.3 @@ -1,4 +1,4 @@ -.\" $NetBSD: cdbw.3,v 1.8 2014/02/06 15:50:40 rmind Exp $ +.\" $NetBSD: cdbw.3,v 1.9 2023/08/08 10:34:08 riastradh Exp $ .\" .\" Copyright (c) 2010 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -74,7 +74,7 @@ .Fo cdbw_output .Fa "struct cdbw *cdbw" .Fa "int output" -.Fa "const char descr[16]" +.Fa "const char *descr" .Fa "uint32_t (*seedgen)(void)" .Fc .Ft void @@ -113,7 +113,8 @@ computes the database file and writes it to the given descriptor. The function returns an error if the file cannot be written correctly. The .Fa descr -parameter provides a human readable description of the database content. +parameter, a string of up to 16 bytes, provides a human readable +description of the database content. The .Fa seedgen parameter can be used to override the default PRNG. diff --git a/lib/libc/cdb/cdbw.c b/lib/libc/cdb/cdbw.c index 7162fba22eb2..9d65bafe83ab 100644 --- a/lib/libc/cdb/cdbw.c +++ b/lib/libc/cdb/cdbw.c @@ -1,4 +1,4 @@ -/* $NetBSD: cdbw.c,v 1.8 2022/04/19 20:32:14 rillig Exp $ */ +/* $NetBSD: cdbw.c,v 1.9 2023/08/08 10:34:08 riastradh Exp $ */ /*- * Copyright (c) 2009, 2010, 2015 The NetBSD Foundation, Inc. * All rights reserved. @@ -36,7 +36,7 @@ #endif #include -__RCSID("$NetBSD: cdbw.c,v 1.8 2022/04/19 20:32:14 rillig Exp $"); +__RCSID("$NetBSD: cdbw.c,v 1.9 2023/08/08 10:34:08 riastradh Exp $"); #include "namespace.h" @@ -602,7 +602,7 @@ print_hash(struct cdbw *cdbw, struct state *state, int fd, const char *descr) } int -cdbw_output(struct cdbw *cdbw, int fd, const char descr[16], +cdbw_output(struct cdbw *cdbw, int fd, const char *descr, uint32_t (*seedgen)(void)) { struct state state;