Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Sep 2005 13:59:00 GMT
From:      Dag-Erling Smorgrav <des@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 83978 for review
Message-ID:  <200509201359.j8KDx0tn063469@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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" <ldv@altlinux.org>

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 <stdarg.h>
 
+#include <security/pam_attributes.h>
+
 #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 <security/pam_types.h>
 #include <security/pam_constants.h>
+#include <security/pam_attributes.h>
 
 #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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200509201359.j8KDx0tn063469>