Changeset 318 in openpam for trunk


Ignore:
Timestamp:
Sep 20, 2005, 3:58:54 PM (14 years ago)
Author:
Dag-Erling Smørgrav
Message:

Centralize macros used for hiding GCC-specific attributes.
Use attributes for publicly exported functions.

Submitted by: "Dmitry V. Levin" <ldv@…>

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MANIFEST

    r305 r318  
    11#
    2 # $P4: //depot/projects/openpam/MANIFEST#21 $
     2# $P4: //depot/projects/openpam/MANIFEST#22 $
    33#
    44CREDITS
     
    9191include/security/openpam_version.h
    9292include/security/pam_appl.h
     93include/security/pam_attributes.h
    9394include/security/pam_constants.h
    9495include/security/pam_modules.h
  • trunk/include/security/Makefile.am

    r309 r318  
    1 # $P4: //depot/projects/openpam/include/security/Makefile.am#3 $
     1# $P4: //depot/projects/openpam/include/security/Makefile.am#4 $
    22
    33openpamdir = $(includedir)/security
     
    77        openpam_version.h \
    88        pam_appl.h \
     9        pam_attributes.h \
    910        pam_constants.h \
    1011        pam_modules.h \
  • trunk/include/security/openpam.h

    r289 r318  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/include/security/openpam.h#28 $
     34 * $P4: //depot/projects/openpam/include/security/openpam.h#29 $
    3535 */
    3636
     
    4343#include <stdarg.h>
    4444
     45#include <security/pam_attributes.h>
     46
    4547#ifdef __cplusplus
    4648extern "C" {
     
    5456int
    5557openpam_borrow_cred(pam_handle_t *_pamh,
    56         const struct passwd *_pwd);
     58        const struct passwd *_pwd)
     59        OPENPAM_NONNULL((1,2));
    5760
    5861void
     
    6972
    7073int
    71 openpam_restore_cred(pam_handle_t *_pamh);
     74openpam_restore_cred(pam_handle_t *_pamh)
     75        OPENPAM_NONNULL((1));
    7276
    7377int
     
    7983pam_error(pam_handle_t *_pamh,
    8084        const char *_fmt,
    81         ...);
     85        ...)
     86        OPENPAM_FORMAT ((__printf__, 2, 3))
     87        OPENPAM_NONNULL((1,2));
    8288
    8389int
     
    8591        int _item,
    8692        const char **_authtok,
    87         const char *_prompt);
     93        const char *_prompt)
     94        OPENPAM_NONNULL((1,3));
    8895
    8996int
    9097pam_info(pam_handle_t *_pamh,
    9198        const char *_fmt,
    92         ...);
     99        ...)
     100        OPENPAM_FORMAT ((__printf__, 2, 3))
     101        OPENPAM_NONNULL((1,2));
    93102
    94103int
     
    97106        char **_resp,
    98107        const char *_fmt,
    99         ...);
     108        ...)
     109        OPENPAM_FORMAT ((__printf__, 4, 5))
     110        OPENPAM_NONNULL((1,4));
    100111
    101112int
     
    103114        const char *_name,
    104115        const char *_value,
    105         int _overwrite);
     116        int _overwrite)
     117        OPENPAM_NONNULL((1,2,3));
    106118
    107119int
    108120pam_vinfo(pam_handle_t *_pamh,
    109121        const char *_fmt,
    110         va_list _ap);
     122        va_list _ap)
     123        OPENPAM_FORMAT ((__printf__, 2, 0))
     124        OPENPAM_NONNULL((1,2));
    111125
    112126int
    113127pam_verror(pam_handle_t *_pamh,
    114128        const char *_fmt,
    115         va_list _ap);
     129        va_list _ap)
     130        OPENPAM_FORMAT ((__printf__, 2, 0))
     131        OPENPAM_NONNULL((1,2));
    116132
    117133int
     
    120136        char **_resp,
    121137        const char *_fmt,
    122         va_list _ap);
     138        va_list _ap)
     139        OPENPAM_FORMAT ((__printf__, 4, 0))
     140        OPENPAM_NONNULL((1,4));
    123141
    124142/*
     
    131149openpam_readline(FILE *_f,
    132150        int *_lineno,
    133         size_t *_lenp);
     151        size_t *_lenp)
     152        OPENPAM_NONNULL((1));
    134153#endif
    135154
     
    152171        const char *_fmt,
    153172        ...)
    154 #if defined(__GNUC__)
    155         __attribute__((__format__(__printf__, 3, 4)))
    156 #endif
    157         ;
     173        OPENPAM_FORMAT ((__printf__, 3, 4))
     174        OPENPAM_NONNULL((3));
    158175
    159176#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
     
    173190openpam_log(int _level,
    174191        const char *_format,
    175         ...);
     192        ...)
     193        OPENPAM_FORMAT ((__printf__, 2, 3))
     194        OPENPAM_NONNULL((2));
    176195#endif
    177196
  • trunk/include/security/pam_appl.h

    r277 r318  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/include/security/pam_appl.h#14 $
     34 * $P4: //depot/projects/openpam/include/security/pam_appl.h#15 $
    3535 */
    3636
     
    4040#include <security/pam_types.h>
    4141#include <security/pam_constants.h>
     42#include <security/pam_attributes.h>
    4243
    4344#ifdef __cplusplus
     
    5152int
    5253pam_acct_mgmt(pam_handle_t *_pamh,
    53         int _flags);
     54        int _flags)
     55        OPENPAM_NONNULL((1));
    5456
    5557int
    5658pam_authenticate(pam_handle_t *_pamh,
    57         int _flags);
     59        int _flags)
     60        OPENPAM_NONNULL((1));
    5861
    5962int
    6063pam_chauthtok(pam_handle_t *_pamh,
    61         int _flags);
     64        int _flags)
     65        OPENPAM_NONNULL((1));
    6266
    6367int
    6468pam_close_session(pam_handle_t *_pamh,
    65         int _flags);
     69        int _flags)
     70        OPENPAM_NONNULL((1));
    6671
    6772int
    6873pam_end(pam_handle_t *_pamh,
    69         int _status);
     74        int _status)
     75        OPENPAM_NONNULL((1));
    7076
    7177int
    7278pam_get_data(pam_handle_t *_pamh,
    7379        const char *_module_data_name,
    74         void **_data);
     80        void **_data)
     81        OPENPAM_NONNULL((1,2,3));
    7582
    7683int
    7784pam_get_item(pam_handle_t *_pamh,
    7885        int _item_type,
    79         const void **_item);
     86        const void **_item)
     87        OPENPAM_NONNULL((1,3));
    8088
    8189int
    8290pam_get_user(pam_handle_t *_pamh,
    8391        const char **_user,
    84         const char *_prompt);
     92        const char *_prompt)
     93        OPENPAM_NONNULL((1,2));
    8594
    8695const char *
    8796pam_getenv(pam_handle_t *_pamh,
    88         const char *_name);
     97        const char *_name)
     98        OPENPAM_NONNULL((1,2));
    8999
    90100char **
    91 pam_getenvlist(pam_handle_t *_pamh);
     101pam_getenvlist(pam_handle_t *_pamh)
     102        OPENPAM_NONNULL((1));
    92103
    93104int
    94105pam_open_session(pam_handle_t *_pamh,
    95         int _flags);
     106        int _flags)
     107        OPENPAM_NONNULL((1));
    96108
    97109int
    98110pam_putenv(pam_handle_t *_pamh,
    99         const char *_namevalue);
     111        const char *_namevalue)
     112        OPENPAM_NONNULL((1,2));
    100113
    101114int
     
    105118        void (*_cleanup)(pam_handle_t *_pamh,
    106119                void *_data,
    107                 int _pam_end_status));
     120                int _pam_end_status))
     121        OPENPAM_NONNULL((1,2));
    108122
    109123int
    110124pam_set_item(pam_handle_t *_pamh,
    111125        int _item_type,
    112         const void *_item);
     126        const void *_item)
     127        OPENPAM_NONNULL((1));
    113128
    114129int
    115130pam_setcred(pam_handle_t *_pamh,
    116         int _flags);
     131        int _flags)
     132        OPENPAM_NONNULL((1));
    117133
    118134int
     
    120136        const char *_user,
    121137        const struct pam_conv *_pam_conv,
    122         pam_handle_t **_pamh);
     138        pam_handle_t **_pamh)
     139        OPENPAM_NONNULL((4));
    123140
    124141const char *
Note: See TracChangeset for help on using the changeset viewer.