Changeset 200 in openpam for trunk/lib/openpam_impl.h


Ignore:
Timestamp:
Feb 2, 2003, 1:10:00 PM (18 years ago)
Author:
Dag-Erling Smørgrav
Message:

More debugging macros: ENTERI() (item type), ENTERN() (int),
ENTERS() (string). Rename RETURNI() to RETURNN() for consistency.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/openpam_impl.h

    r191 r200  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/openpam_impl.h#19 $
     34 * $P4: //depot/projects/openpam/lib/openpam_impl.h#20 $
    3535 */
    3636
     
    4343extern const char *_pam_sm_func_name[PAM_NUM_PRIMITIVES];
    4444extern const char *_pam_err_name[PAM_NUM_ERRORS];
     45extern const char *_pam_item_name[PAM_NUM_ITEMS];
    4546
    4647/*
     
    124125#ifdef DEBUG
    125126#define ENTER() openpam_log(PAM_LOG_DEBUG, "entering")
     127#define ENTERI(i) do { \
     128        if ((i) > 0 && (i) < PAM_NUM_ITEMS) \
     129                openpam_log(PAM_LOG_DEBUG, "entering: %s", _pam_item_name[i]); \
     130        else \
     131                openpam_log(PAM_LOG_DEBUG, "entering: %d", (i)); \
     132} while (0);
     133#define ENTERN(n) do { \
     134        openpam_log(PAM_LOG_DEBUG, "entering: %d", (n)); \
     135} while (0);
     136#define ENTERS(s) do { \
     137        if ((s) == NULL) \
     138                openpam_log(PAM_LOG_DEBUG, "entering: NULL"); \
     139        else \
     140                openpam_log(PAM_LOG_DEBUG, "entering: '%s'", (s)); \
     141} while (0);
    126142#define RETURNV() openpam_log(PAM_LOG_DEBUG, "returning")
    127143#define RETURNC(c) do { \
     
    132148        return (c); \
    133149} while (0)
    134 #define RETURNI(i) do { \
    135         openpam_log(PAM_LOG_DEBUG, "returning %d", (i)); \
    136         return (i); \
     150#define RETURNN(n) do { \
     151        openpam_log(PAM_LOG_DEBUG, "returning %d", (n)); \
     152        return (n); \
    137153} while (0)
    138154#define RETURNP(p) do { \
     
    152168#else
    153169#define ENTER()
     170#define ENTERI(i)
     171#define ENTERN(n)
     172#define ENTERS(s)
    154173#define RETURNV() return
    155174#define RETURNC(c) return (c)
    156 #define RETURNI(i) return (i)
     175#define RETURNN(n) return (n)
    157176#define RETURNP(p) return (p)
    158177#define RETURNS(s) return (s)
Note: See TracChangeset for help on using the changeset viewer.