diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2015-08-27 04:37:10 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2015-08-27 04:37:10 +0000 |
commit | 3f43515896b874f5a14e9f9ecb0f5a81ee36c1ac (patch) | |
tree | 61b4a7fdb78f64f4fc86d6c9a0522e0bc711f9d2 | |
parent | beb50e1c8dd60e053bc56c0c260ee76dffa3d996 (diff) |
Use static and __{BEGIN,ENV}_HIDDEN_DECLS to hide a bunch of internal
symbols that are not longer exported. (This improves the generated code.)
ok deraadt@
-rw-r--r-- | include/db.h | 6 | ||||
-rw-r--r-- | lib/libc/citrus/citrus_ctype.c | 4 | ||||
-rw-r--r-- | lib/libc/citrus/citrus_ctype.h | 4 | ||||
-rw-r--r-- | lib/libc/citrus/citrus_none.h | 4 | ||||
-rw-r--r-- | lib/libc/citrus/citrus_utf8.h | 4 | ||||
-rw-r--r-- | lib/libc/db/btree/extern.h | 6 | ||||
-rw-r--r-- | lib/libc/db/hash/extern.h | 4 | ||||
-rw-r--r-- | lib/libc/db/recno/extern.h | 4 | ||||
-rw-r--r-- | lib/libc/gen/telldir.h | 4 | ||||
-rw-r--r-- | lib/libc/include/atfork.h | 5 | ||||
-rw-r--r-- | lib/libc/include/ctype_private.h | 6 | ||||
-rw-r--r-- | lib/libc/stdio/findfp.c | 4 | ||||
-rw-r--r-- | lib/libc/stdio/fvwrite.h | 4 | ||||
-rw-r--r-- | lib/libc/stdio/glue.h | 4 | ||||
-rw-r--r-- | lib/libc/stdio/local.h | 12 |
15 files changed, 50 insertions, 25 deletions
diff --git a/include/db.h b/include/db.h index 332452e5b19..2f1dbe5723e 100644 --- a/include/db.h +++ b/include/db.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db.h,v 1.9 2012/12/05 23:19:57 deraadt Exp $ */ +/* $OpenBSD: db.h,v 1.10 2015/08/27 04:37:09 guenther Exp $ */ /* $NetBSD: db.h,v 1.13 1994/10/26 00:55:48 cgd Exp $ */ /*- @@ -207,12 +207,14 @@ typedef struct { __BEGIN_DECLS DB *dbopen(const char *, int, int, DBTYPE, const void *); +__END_DECLS #ifdef __DBINTERFACE_PRIVATE +__BEGIN_HIDDEN_DECLS DB *__bt_open(const char *, int, int, const BTREEINFO *, int); DB *__hash_open(const char *, int, int, const HASHINFO *, int); DB *__rec_open(const char *, int, int, const RECNOINFO *, int); void __dbpanic(DB *dbp); +__END_HIDDEN_DECLS #endif -__END_DECLS #endif /* !_DB_H_ */ diff --git a/lib/libc/citrus/citrus_ctype.c b/lib/libc/citrus/citrus_ctype.c index cb187c5e9a1..125428210ca 100644 --- a/lib/libc/citrus/citrus_ctype.c +++ b/lib/libc/citrus/citrus_ctype.c @@ -1,4 +1,4 @@ -/* $OpenBSD: citrus_ctype.c,v 1.4 2013/05/03 13:53:49 stsp Exp $ */ +/* $OpenBSD: citrus_ctype.c,v 1.5 2015/08/27 04:37:09 guenther Exp $ */ /* $NetBSD: citrus_ctype.c,v 1.5 2008/06/14 16:01:07 tnozaki Exp $ */ /*- @@ -41,7 +41,7 @@ struct _citrus_ctype_rec _citrus_ctype_none = { 1 /* cc_mb_cur_max */ }; -struct _citrus_ctype_rec _citrus_ctype_utf8 = { +static struct _citrus_ctype_rec _citrus_ctype_utf8 = { &_citrus_utf8_ctype_ops, /* cc_ops */ _CITRUS_UTF8_MB_CUR_MAX /* cc_mb_cur_max */ }; diff --git a/lib/libc/citrus/citrus_ctype.h b/lib/libc/citrus/citrus_ctype.h index df67e09c155..5949111216a 100644 --- a/lib/libc/citrus/citrus_ctype.h +++ b/lib/libc/citrus/citrus_ctype.h @@ -1,4 +1,4 @@ -/* $OpenBSD: citrus_ctype.h,v 1.3 2010/08/01 02:49:07 chl Exp $ */ +/* $OpenBSD: citrus_ctype.h,v 1.4 2015/08/27 04:37:09 guenther Exp $ */ /* $NetBSD: citrus_ctype.h,v 1.2 2003/03/05 20:18:15 tshiozak Exp $ */ /*- @@ -33,8 +33,10 @@ #include "citrus_ctype_local.h" +__BEGIN_HIDDEN_DECLS extern struct _citrus_ctype_rec _citrus_ctype_none; int _citrus_ctype_open(struct _citrus_ctype_rec **, char const *); +__END_HIDDEN_DECLS #endif diff --git a/lib/libc/citrus/citrus_none.h b/lib/libc/citrus/citrus_none.h index 096e3794177..6f74784b5a5 100644 --- a/lib/libc/citrus/citrus_none.h +++ b/lib/libc/citrus/citrus_none.h @@ -1,4 +1,4 @@ -/* $OpenBSD: citrus_none.h,v 1.1 2010/07/27 16:59:03 stsp Exp $ */ +/* $OpenBSD: citrus_none.h,v 1.2 2015/08/27 04:37:09 guenther Exp $ */ /* $NetBSD: citrus_none.h,v 1.3 2003/06/25 09:51:38 tshiozak Exp $ */ /*- @@ -30,8 +30,10 @@ #ifndef _CITRUS_NONE_H_ #define _CITRUS_NONE_H_ +__BEGIN_HIDDEN_DECLS extern struct _citrus_ctype_ops_rec _citrus_none_ctype_ops; _CITRUS_CTYPE_DECLS(none); +__END_HIDDEN_DECLS #endif diff --git a/lib/libc/citrus/citrus_utf8.h b/lib/libc/citrus/citrus_utf8.h index 4c79fecf8eb..ee6634c76b6 100644 --- a/lib/libc/citrus/citrus_utf8.h +++ b/lib/libc/citrus/citrus_utf8.h @@ -1,4 +1,4 @@ -/* $OpenBSD: citrus_utf8.h,v 1.2 2010/07/29 00:50:10 stsp Exp $ */ +/* $OpenBSD: citrus_utf8.h,v 1.3 2015/08/27 04:37:09 guenther Exp $ */ /* $NetBSD: citrus_utf8.h,v 1.2 2003/06/25 09:51:49 tshiozak Exp $ */ /*- @@ -30,10 +30,12 @@ #ifndef _CITRUS_UTF8_H_ #define _CITRUS_UTF8_H_ +__BEGIN_HIDDEN_DECLS extern struct _citrus_ctype_ops_rec _citrus_utf8_ctype_ops; #define _CITRUS_UTF8_MB_CUR_MAX 4 _CITRUS_CTYPE_DECLS(utf8); +__END_HIDDEN_DECLS #endif diff --git a/lib/libc/db/btree/extern.h b/lib/libc/db/btree/extern.h index 7b5f32bcedc..9a6896565b1 100644 --- a/lib/libc/db/btree/extern.h +++ b/lib/libc/db/btree/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.7 2003/06/02 20:18:33 millert Exp $ */ +/* $OpenBSD: extern.h,v 1.8 2015/08/27 04:37:09 guenther Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -31,9 +31,9 @@ * @(#)extern.h 8.10 (Berkeley) 7/20/94 */ +__BEGIN_HIDDEN_DECLS int __bt_close(DB *); int __bt_cmp(BTREE *, const DBT *, EPG *); -int __bt_crsrdel(BTREE *, EPGNO *); int __bt_defcmp(const DBT *, const DBT *); size_t __bt_defpfx(const DBT *, const DBT *); int __bt_delete(const DB *, const DBT *, u_int); @@ -44,7 +44,6 @@ int __bt_get(const DB *, const DBT *, DBT *, u_int); PAGE *__bt_new(BTREE *, pgno_t *); void __bt_pgin(void *, pgno_t, void *); void __bt_pgout(void *, pgno_t, void *); -int __bt_push(BTREE *, pgno_t, int); int __bt_put(const DB *dbp, DBT *, const DBT *, u_int); int __bt_ret(BTREE *, EPG *, DBT *, DBT *, DBT *, DBT *, int); EPG *__bt_search(BTREE *, const DBT *, int *); @@ -66,3 +65,4 @@ void __bt_dump(DB *); #ifdef STATISTICS void __bt_stat(DB *); #endif +__END_HIDDEN_DECLS diff --git a/lib/libc/db/hash/extern.h b/lib/libc/db/hash/extern.h index 7f837ffacbc..3d496169e13 100644 --- a/lib/libc/db/hash/extern.h +++ b/lib/libc/db/hash/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.7 2003/06/02 20:18:33 millert Exp $ */ +/* $OpenBSD: extern.h,v 1.8 2015/08/27 04:37:09 guenther Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -31,6 +31,7 @@ * @(#)extern.h 8.4 (Berkeley) 6/16/94 */ +__BEGIN_HIDDEN_DECLS BUFHEAD *__add_ovflpage(HTAB *, BUFHEAD *); int __addel(HTAB *, BUFHEAD *, const DBT *, const DBT *); int __big_delete(HTAB *, BUFHEAD *); @@ -61,3 +62,4 @@ extern u_int32_t (*__default_hash)(const void *, size_t); #ifdef HASH_STATISTICS extern int hash_accesses, hash_collisions, hash_expansions, hash_overflows; #endif +__END_HIDDEN_DECLS diff --git a/lib/libc/db/recno/extern.h b/lib/libc/db/recno/extern.h index 85017d29cb5..634bab3e0a7 100644 --- a/lib/libc/db/recno/extern.h +++ b/lib/libc/db/recno/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.6 2003/06/02 20:18:34 millert Exp $ */ +/* $OpenBSD: extern.h,v 1.7 2015/08/27 04:37:09 guenther Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -33,6 +33,7 @@ #include "../btree/extern.h" +__BEGIN_HIDDEN_DECLS int __rec_close(DB *); int __rec_delete(const DB *, const DBT *, u_int); int __rec_dleaf(BTREE *, PAGE *, u_int32_t); @@ -50,3 +51,4 @@ int __rec_sync(const DB *, u_int); int __rec_vmap(BTREE *, recno_t); int __rec_vout(BTREE *); int __rec_vpipe(BTREE *, recno_t); +__END_HIDDEN_DECLS diff --git a/lib/libc/gen/telldir.h b/lib/libc/gen/telldir.h index a87fe75852f..591a601fa0a 100644 --- a/lib/libc/gen/telldir.h +++ b/lib/libc/gen/telldir.h @@ -1,4 +1,4 @@ -/* $OpenBSD: telldir.h,v 1.9 2014/03/10 07:54:14 schwarze Exp $ */ +/* $OpenBSD: telldir.h,v 1.10 2015/08/27 04:37:09 guenther Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -48,6 +48,8 @@ struct _dirdesc { void *dd_lock; /* mutex to protect struct */ }; +__BEGIN_HIDDEN_DECLS int _readdir_unlocked(DIR *, struct dirent **); +__END_HIDDEN_DECLS #endif diff --git a/lib/libc/include/atfork.h b/lib/libc/include/atfork.h index 8ec611098c1..f09de4892af 100644 --- a/lib/libc/include/atfork.h +++ b/lib/libc/include/atfork.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atfork.h,v 1.1 2015/04/07 01:27:07 guenther Exp $ */ +/* $OpenBSD: atfork.h,v 1.2 2015/08/27 04:37:09 guenther Exp $ */ /* * Copyright (c) 2008 Kurt Miller <kurt@openbsd.org> @@ -40,5 +40,6 @@ struct atfork_fn { void *fn_dso; }; +__BEGIN_HIDDEN_DECLS extern TAILQ_HEAD(atfork_listhead, atfork_fn) _atfork_list; - +__END_HIDDEN_DECLS diff --git a/lib/libc/include/ctype_private.h b/lib/libc/include/ctype_private.h index 39cc792ea44..cbe1b204758 100644 --- a/lib/libc/include/ctype_private.h +++ b/lib/libc/include/ctype_private.h @@ -1,7 +1,9 @@ -/* $OpenBSD: ctype_private.h,v 1.1 2005/08/08 05:53:00 espie Exp $ */ +/* $OpenBSD: ctype_private.h,v 1.2 2015/08/27 04:37:09 guenther Exp $ */ /* Written by Marc Espie, public domain */ #define CTYPE_NUM_CHARS 256 + +__BEGIN_HIDDEN_DECLS extern const char _C_ctype_[]; extern const short _C_toupper_[]; extern const short _C_tolower_[]; - +__END_HIDDEN_DECLS diff --git a/lib/libc/stdio/findfp.c b/lib/libc/stdio/findfp.c index ee866fa26ce..0cdd1faf3a0 100644 --- a/lib/libc/stdio/findfp.c +++ b/lib/libc/stdio/findfp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: findfp.c,v 1.17 2015/01/16 16:48:51 deraadt Exp $ */ +/* $OpenBSD: findfp.c,v 1.18 2015/08/27 04:37:09 guenther Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -58,7 +58,7 @@ static struct glue uglue = { 0, FOPEN_MAX - 3, usual }; static struct glue *lastglue = &uglue; _THREAD_PRIVATE_MUTEX(__sfp_mutex); -struct __sfileext __sFext[3]; +static struct __sfileext __sFext[3]; FILE __sF[3] = { std(__SRD, STDIN_FILENO), /* stdin */ std(__SWR, STDOUT_FILENO), /* stdout */ diff --git a/lib/libc/stdio/fvwrite.h b/lib/libc/stdio/fvwrite.h index d3a309b2938..f04565bc28a 100644 --- a/lib/libc/stdio/fvwrite.h +++ b/lib/libc/stdio/fvwrite.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fvwrite.h,v 1.6 2013/11/12 07:04:35 deraadt Exp $ */ +/* $OpenBSD: fvwrite.h,v 1.7 2015/08/27 04:37:09 guenther Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -45,5 +45,7 @@ struct __suio { int uio_resid; }; +__BEGIN_HIDDEN_DECLS extern int __sfvwrite(FILE *, struct __suio *); wint_t __fputwc_unlock(wchar_t wc, FILE *fp); +__END_HIDDEN_DECLS diff --git a/lib/libc/stdio/glue.h b/lib/libc/stdio/glue.h index 73cef63273b..530a70e6d1a 100644 --- a/lib/libc/stdio/glue.h +++ b/lib/libc/stdio/glue.h @@ -1,4 +1,4 @@ -/* $OpenBSD: glue.h,v 1.4 2004/01/11 21:39:51 millert Exp $ */ +/* $OpenBSD: glue.h,v 1.5 2015/08/27 04:37:09 guenther Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -42,4 +42,6 @@ struct glue { FILE *iobs; }; +__BEGIN_HIDDEN_DECLS extern struct glue __sglue; +__END_HIDDEN_DECLS diff --git a/lib/libc/stdio/local.h b/lib/libc/stdio/local.h index 0ebe1158116..56cdf22d9f1 100644 --- a/lib/libc/stdio/local.h +++ b/lib/libc/stdio/local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: local.h,v 1.20 2011/11/08 18:30:42 guenther Exp $ */ +/* $OpenBSD: local.h,v 1.21 2015/08/27 04:37:09 guenther Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,6 +41,12 @@ #include "wcio.h" #include "fileext.h" +void _cleanup(void); +int _fwalk(int (*)(FILE *)); + +extern void __atexit_register_cleanup(void (*)(void)); + +__BEGIN_HIDDEN_DECLS int __sflush(FILE *); int __sflush_locked(FILE *); FILE *__sfp(void); @@ -50,10 +56,8 @@ int __swrite(void *, const char *, int); fpos_t __sseek(void *, fpos_t, int); int __sclose(void *); void __sinit(void); -void _cleanup(void); void __smakebuf(FILE *); int __swhatbuf(FILE *, size_t *, int *); -int _fwalk(int (*)(FILE *)); int __swsetup(FILE *); int __sflags(const char *, int *); wint_t __fgetwc_unlock(FILE *); @@ -63,8 +67,8 @@ int __svfscanf(FILE * __restrict, const char * __restrict, __va_list); int __vfwprintf(FILE * __restrict, const wchar_t * __restrict, __va_list); int __vfwscanf(FILE * __restrict, const wchar_t * __restrict, __va_list); -extern void __atexit_register_cleanup(void (*)(void)); extern int __sdidinit; +__END_HIDDEN_DECLS /* * Return true if the given FILE cannot be written now. |