Print this page
7126 NSS_XbyY_FINI has too much logic for a function-like macro


 652         (str)->stayopen  = 0,                                \
 653         (str)->str2ent  = (func),                    \
 654         (str)->key2str  = NULL,                              \
 655         (str)->returnval = 0,                                \
 656         (str)->returnlen = 0,                                \
 657         (str)->h_errno    = 0,                               \
 658         (str)->erange    = 0)
 659 
 660 #define NSS_XbyY_INIT_EXT(str, res, bufp, len, func, kfunc)     (\
 661         (str)->buf.result = (res),                   \
 662         (str)->buf.buffer = (bufp),                  \
 663         (str)->buf.buflen = (len),                   \
 664         (str)->stayopen  = 0,                                \
 665         (str)->str2ent  = (func),                    \
 666         (str)->key2str  = (kfunc),                   \
 667         (str)->returnval = 0,                                \
 668         (str)->returnlen = 0,                                \
 669         (str)->h_errno    = 0,                               \
 670         (str)->erange    = 0)
 671 
 672 #define NSS_XbyY_FINI(str)                              (\
 673         (str)->returnval == 0 && (str)->erange && (errno = ERANGE), \
 674         (str)->returnval)
 675 
 676 #define NSS_PACKED_CRED_CHECK(buf, ruid, euid)          (\
 677         ((nss_pheader_t *)(buf))->p_ruid == (ruid) && \
 678         ((nss_pheader_t *)(buf))->p_euid == (euid))
 679 

 680 extern char             **_nss_netdb_aliases(const char *, int, char *, int);
 681 extern nss_status_t     nss_default_key2str(void *, size_t, nss_XbyY_args_t *,
 682                                         const char *, int, size_t *);
 683 extern nss_status_t     nss_packed_arg_init(void *, size_t, nss_db_root_t *,
 684                                         nss_db_initf_t *, int *,
 685                                         nss_XbyY_args_t *);
 686 extern nss_status_t     nss_packed_context_init(void *, size_t, nss_db_root_t *,
 687                                         nss_db_initf_t *, nss_getent_t **,
 688                                         nss_XbyY_args_t *);
 689 extern void             nss_packed_set_status(void *, size_t, nss_status_t,
 690                                         nss_XbyY_args_t *);
 691 extern nss_status_t     nss_packed_getkey(void *, size_t, char **, int *,
 692                                         nss_XbyY_args_t *);
 693 
 694 /*
 695  * nss_dbop_t values for searches with various keys;  values for
 696  * destructor/endent/setent/getent are defined in <nss_common.h>
 697  */
 698 
 699 /*




 652         (str)->stayopen  = 0,                                \
 653         (str)->str2ent  = (func),                    \
 654         (str)->key2str  = NULL,                              \
 655         (str)->returnval = 0,                                \
 656         (str)->returnlen = 0,                                \
 657         (str)->h_errno    = 0,                               \
 658         (str)->erange    = 0)
 659 
 660 #define NSS_XbyY_INIT_EXT(str, res, bufp, len, func, kfunc)     (\
 661         (str)->buf.result = (res),                   \
 662         (str)->buf.buffer = (bufp),                  \
 663         (str)->buf.buflen = (len),                   \
 664         (str)->stayopen  = 0,                                \
 665         (str)->str2ent  = (func),                    \
 666         (str)->key2str  = (kfunc),                   \
 667         (str)->returnval = 0,                                \
 668         (str)->returnlen = 0,                                \
 669         (str)->h_errno    = 0,                               \
 670         (str)->erange    = 0)
 671 
 672 #define NSS_XbyY_FINI(str)      _nss_XbyY_fini(str)


 673 
 674 #define NSS_PACKED_CRED_CHECK(buf, ruid, euid)          (\
 675         ((nss_pheader_t *)(buf))->p_ruid == (ruid) && \
 676         ((nss_pheader_t *)(buf))->p_euid == (euid))
 677 
 678 extern void             *_nss_XbyY_fini(nss_XbyY_args_t *);
 679 extern char             **_nss_netdb_aliases(const char *, int, char *, int);
 680 extern nss_status_t     nss_default_key2str(void *, size_t, nss_XbyY_args_t *,
 681                                         const char *, int, size_t *);
 682 extern nss_status_t     nss_packed_arg_init(void *, size_t, nss_db_root_t *,
 683                                         nss_db_initf_t *, int *,
 684                                         nss_XbyY_args_t *);
 685 extern nss_status_t     nss_packed_context_init(void *, size_t, nss_db_root_t *,
 686                                         nss_db_initf_t *, nss_getent_t **,
 687                                         nss_XbyY_args_t *);
 688 extern void             nss_packed_set_status(void *, size_t, nss_status_t,
 689                                         nss_XbyY_args_t *);
 690 extern nss_status_t     nss_packed_getkey(void *, size_t, char **, int *,
 691                                         nss_XbyY_args_t *);
 692 
 693 /*
 694  * nss_dbop_t values for searches with various keys;  values for
 695  * destructor/endent/setent/getent are defined in <nss_common.h>
 696  */
 697 
 698 /*