From owner-p4-projects@FreeBSD.ORG Tue Sep 20 13:59:04 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2EC8216A430; Tue, 20 Sep 2005 13:59:01 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C306516A420 for ; Tue, 20 Sep 2005 13:59:00 +0000 (GMT) (envelope-from des@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8319F43D46 for ; Tue, 20 Sep 2005 13:59:00 +0000 (GMT) (envelope-from des@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j8KDx07Y063474 for ; Tue, 20 Sep 2005 13:59:00 GMT (envelope-from des@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j8KDx0tn063469 for perforce@freebsd.org; Tue, 20 Sep 2005 13:59:00 GMT (envelope-from des@freebsd.org) Date: Tue, 20 Sep 2005 13:59:00 GMT Message-Id: <200509201359.j8KDx0tn063469@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to des@freebsd.org using -f From: Dag-Erling Smorgrav To: Perforce Change Reviews Cc: Subject: PERFORCE change 83978 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2005 13:59:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=83978 Change 83978 by des@des.at.des.no on 2005/09/20 13:58:54 Centralize macros used for hiding GCC-specific attributes. Use attributes for publicly exported functions. Submitted by: "Dmitry V. Levin" Affected files ... .. //depot/projects/openpam/MANIFEST#22 edit .. //depot/projects/openpam/include/security/Makefile.am#4 edit .. //depot/projects/openpam/include/security/openpam.h#29 edit .. //depot/projects/openpam/include/security/pam_appl.h#15 edit .. //depot/projects/openpam/include/security/pam_attributes.h#1 add Differences ... ==== //depot/projects/openpam/MANIFEST#22 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $P4: //depot/projects/openpam/MANIFEST#21 $ +# $P4: //depot/projects/openpam/MANIFEST#22 $ # CREDITS HISTORY @@ -90,6 +90,7 @@ include/security/openpam.h include/security/openpam_version.h include/security/pam_appl.h +include/security/pam_attributes.h include/security/pam_constants.h include/security/pam_modules.h include/security/pam_types.h ==== //depot/projects/openpam/include/security/Makefile.am#4 (text+ko) ==== @@ -1,4 +1,4 @@ -# $P4: //depot/projects/openpam/include/security/Makefile.am#3 $ +# $P4: //depot/projects/openpam/include/security/Makefile.am#4 $ openpamdir = $(includedir)/security @@ -6,6 +6,7 @@ openpam.h \ openpam_version.h \ pam_appl.h \ + pam_attributes.h \ pam_constants.h \ pam_modules.h \ pam_types.h ==== //depot/projects/openpam/include/security/openpam.h#29 (text+ko) ==== @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/openpam/include/security/openpam.h#28 $ + * $P4: //depot/projects/openpam/include/security/openpam.h#29 $ */ #ifndef _SECURITY_OPENPAM_H_INCLUDED @@ -42,6 +42,8 @@ */ #include +#include + #ifdef __cplusplus extern "C" { #endif @@ -53,7 +55,8 @@ */ int openpam_borrow_cred(pam_handle_t *_pamh, - const struct passwd *_pwd); + const struct passwd *_pwd) + OPENPAM_NONNULL((1,2)); void openpam_free_data(pam_handle_t *_pamh, @@ -68,7 +71,8 @@ const char *_option); int -openpam_restore_cred(pam_handle_t *_pamh); +openpam_restore_cred(pam_handle_t *_pamh) + OPENPAM_NONNULL((1)); int openpam_set_option(pam_handle_t *_pamh, @@ -78,48 +82,62 @@ int pam_error(pam_handle_t *_pamh, const char *_fmt, - ...); + ...) + OPENPAM_FORMAT ((__printf__, 2, 3)) + OPENPAM_NONNULL((1,2)); int pam_get_authtok(pam_handle_t *_pamh, int _item, const char **_authtok, - const char *_prompt); + const char *_prompt) + OPENPAM_NONNULL((1,3)); int pam_info(pam_handle_t *_pamh, const char *_fmt, - ...); + ...) + OPENPAM_FORMAT ((__printf__, 2, 3)) + OPENPAM_NONNULL((1,2)); int pam_prompt(pam_handle_t *_pamh, int _style, char **_resp, const char *_fmt, - ...); + ...) + OPENPAM_FORMAT ((__printf__, 4, 5)) + OPENPAM_NONNULL((1,4)); int pam_setenv(pam_handle_t *_pamh, const char *_name, const char *_value, - int _overwrite); + int _overwrite) + OPENPAM_NONNULL((1,2,3)); int pam_vinfo(pam_handle_t *_pamh, const char *_fmt, - va_list _ap); + va_list _ap) + OPENPAM_FORMAT ((__printf__, 2, 0)) + OPENPAM_NONNULL((1,2)); int pam_verror(pam_handle_t *_pamh, const char *_fmt, - va_list _ap); + va_list _ap) + OPENPAM_FORMAT ((__printf__, 2, 0)) + OPENPAM_NONNULL((1,2)); int pam_vprompt(pam_handle_t *_pamh, int _style, char **_resp, const char *_fmt, - va_list _ap); + va_list _ap) + OPENPAM_FORMAT ((__printf__, 4, 0)) + OPENPAM_NONNULL((1,4)); /* * Read cooked lines. @@ -130,7 +148,8 @@ char * openpam_readline(FILE *_f, int *_lineno, - size_t *_lenp); + size_t *_lenp) + OPENPAM_NONNULL((1)); #endif /* @@ -151,10 +170,8 @@ const char *_func, const char *_fmt, ...) -#if defined(__GNUC__) - __attribute__((__format__(__printf__, 3, 4))) -#endif - ; + OPENPAM_FORMAT ((__printf__, 3, 4)) + OPENPAM_NONNULL((3)); #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) #define openpam_log(lvl, ...) \ @@ -172,7 +189,9 @@ void openpam_log(int _level, const char *_format, - ...); + ...) + OPENPAM_FORMAT ((__printf__, 2, 3)) + OPENPAM_NONNULL((2)); #endif /* ==== //depot/projects/openpam/include/security/pam_appl.h#15 (text+ko) ==== @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/openpam/include/security/pam_appl.h#14 $ + * $P4: //depot/projects/openpam/include/security/pam_appl.h#15 $ */ #ifndef _PAM_APPL_H_INCLUDED @@ -39,6 +39,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { @@ -50,53 +51,65 @@ int pam_acct_mgmt(pam_handle_t *_pamh, - int _flags); + int _flags) + OPENPAM_NONNULL((1)); int pam_authenticate(pam_handle_t *_pamh, - int _flags); + int _flags) + OPENPAM_NONNULL((1)); int pam_chauthtok(pam_handle_t *_pamh, - int _flags); + int _flags) + OPENPAM_NONNULL((1)); int pam_close_session(pam_handle_t *_pamh, - int _flags); + int _flags) + OPENPAM_NONNULL((1)); int pam_end(pam_handle_t *_pamh, - int _status); + int _status) + OPENPAM_NONNULL((1)); int pam_get_data(pam_handle_t *_pamh, const char *_module_data_name, - void **_data); + void **_data) + OPENPAM_NONNULL((1,2,3)); int pam_get_item(pam_handle_t *_pamh, int _item_type, - const void **_item); + const void **_item) + OPENPAM_NONNULL((1,3)); int pam_get_user(pam_handle_t *_pamh, const char **_user, - const char *_prompt); + const char *_prompt) + OPENPAM_NONNULL((1,2)); const char * pam_getenv(pam_handle_t *_pamh, - const char *_name); + const char *_name) + OPENPAM_NONNULL((1,2)); char ** -pam_getenvlist(pam_handle_t *_pamh); +pam_getenvlist(pam_handle_t *_pamh) + OPENPAM_NONNULL((1)); int pam_open_session(pam_handle_t *_pamh, - int _flags); + int _flags) + OPENPAM_NONNULL((1)); int pam_putenv(pam_handle_t *_pamh, - const char *_namevalue); + const char *_namevalue) + OPENPAM_NONNULL((1,2)); int pam_set_data(pam_handle_t *_pamh, @@ -104,22 +117,26 @@ void *_data, void (*_cleanup)(pam_handle_t *_pamh, void *_data, - int _pam_end_status)); + int _pam_end_status)) + OPENPAM_NONNULL((1,2)); int pam_set_item(pam_handle_t *_pamh, int _item_type, - const void *_item); + const void *_item) + OPENPAM_NONNULL((1)); int pam_setcred(pam_handle_t *_pamh, - int _flags); + int _flags) + OPENPAM_NONNULL((1)); int pam_start(const char *_service, const char *_user, const struct pam_conv *_pam_conv, - pam_handle_t **_pamh); + pam_handle_t **_pamh) + OPENPAM_NONNULL((4)); const char * pam_strerror(pam_handle_t *_pamh,