Changeset 461 in openpam
- Timestamp:
- Nov 2, 2011, 2:00:38 PM (9 years ago)
- Location:
- trunk/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/openpam_impl.h
r460 r461 135 135 #define ENTER() openpam_log(PAM_LOG_DEBUG, "entering") 136 136 #define ENTERI(i) do { \ 137 int _i= (i); \138 if ( _i > 0 && _i< PAM_NUM_ITEMS) \139 openpam_log(PAM_LOG_DEBUG, "entering: %s", pam_item_name[ _i]); \137 int i_ = (i); \ 138 if (i_ > 0 && i_ < PAM_NUM_ITEMS) \ 139 openpam_log(PAM_LOG_DEBUG, "entering: %s", pam_item_name[i_]); \ 140 140 else \ 141 openpam_log(PAM_LOG_DEBUG, "entering: %d", _i); \141 openpam_log(PAM_LOG_DEBUG, "entering: %d", i_); \ 142 142 } while (0) 143 143 #define ENTERN(n) do { \ 144 int _n= (n); \145 openpam_log(PAM_LOG_DEBUG, "entering: %d", _n); \144 int n_ = (n); \ 145 openpam_log(PAM_LOG_DEBUG, "entering: %d", n_); \ 146 146 } while (0) 147 147 #define ENTERS(s) do { \ 148 const char * _s= (s); \149 if ( _s== NULL) \148 const char *s_ = (s); \ 149 if (s_ == NULL) \ 150 150 openpam_log(PAM_LOG_DEBUG, "entering: NULL"); \ 151 151 else \ 152 openpam_log(PAM_LOG_DEBUG, "entering: '%s'", _s); \152 openpam_log(PAM_LOG_DEBUG, "entering: '%s'", s_); \ 153 153 } while (0) 154 154 #define RETURNV() openpam_log(PAM_LOG_DEBUG, "returning") 155 155 #define RETURNC(c) do { \ 156 int _c= (c); \157 if ( _c >= 0 && _c< PAM_NUM_ERRORS) \158 openpam_log(PAM_LOG_DEBUG, "returning %s", pam_err_name[ _c]); \156 int c_ = (c); \ 157 if (c_ >= 0 && c_ < PAM_NUM_ERRORS) \ 158 openpam_log(PAM_LOG_DEBUG, "returning %s", pam_err_name[c_]); \ 159 159 else \ 160 openpam_log(PAM_LOG_DEBUG, "returning %d!", _c); \161 return ( _c); \160 openpam_log(PAM_LOG_DEBUG, "returning %d!", c_); \ 161 return (c_); \ 162 162 } while (0) 163 163 #define RETURNN(n) do { \ 164 int _n= (n); \165 openpam_log(PAM_LOG_DEBUG, "returning %d", _n); \166 return ( _n); \164 int n_ = (n); \ 165 openpam_log(PAM_LOG_DEBUG, "returning %d", n_); \ 166 return (n_); \ 167 167 } while (0) 168 168 #define RETURNP(p) do { \ 169 const void * _p= (p); \170 if ( _p== NULL) \169 const void *p_ = (p); \ 170 if (p_ == NULL) \ 171 171 openpam_log(PAM_LOG_DEBUG, "returning NULL"); \ 172 172 else \ 173 openpam_log(PAM_LOG_DEBUG, "returning %p", _p); \174 return ( _p); \173 openpam_log(PAM_LOG_DEBUG, "returning %p", p_); \ 174 return (p_); \ 175 175 } while (0) 176 176 #define RETURNS(s) do { \ 177 const char * _s= (s); \178 if ( _s== NULL) \177 const char *s_ = (s); \ 178 if (s_ == NULL) \ 179 179 openpam_log(PAM_LOG_DEBUG, "returning NULL"); \ 180 180 else \ 181 openpam_log(PAM_LOG_DEBUG, "returning '%s'", _s); \182 return ( _s); \181 openpam_log(PAM_LOG_DEBUG, "returning '%s'", s_); \ 182 return (s_); \ 183 183 } while (0) 184 184 #else -
trunk/lib/openpam_subst.c
r455 r461 37 37 38 38 #define subst_char(ch) do { \ 39 int _ch= (ch); \39 int ch_ = (ch); \ 40 40 if (buf && len < *bufsize) \ 41 *buf++ = _ch; \41 *buf++ = ch_; \ 42 42 ++len; \ 43 43 } while (0) 44 44 45 45 #define subst_string(s) do { \ 46 const char * _s= (s); \47 while (* _s) \48 subst_char(* _s++); \46 const char *s_ = (s); \ 47 while (*s_) \ 48 subst_char(*s_++); \ 49 49 } while (0) 50 50 51 51 #define subst_item(i) do { \ 52 int _i= (i); \53 const void * _p; \54 ret = pam_get_item(pamh, _i, &_p); \55 if (ret == PAM_SUCCESS && _p!= NULL) \56 subst_string( _p); \52 int i_ = (i); \ 53 const void *p_; \ 54 ret = pam_get_item(pamh, i_, &p_); \ 55 if (ret == PAM_SUCCESS && p_ != NULL) \ 56 subst_string(p_); \ 57 57 } while (0) 58 58
Note: See TracChangeset
for help on using the changeset viewer.