ether_hostton (const char *hostname, struct ether_addr *addr)
{
nss_action_list nip;
- union
- {
- lookup_function f;
- void *ptr;
- } fct;
+ void *fct;
int no_more;
enum nss_status status = NSS_STATUS_UNAVAIL;
struct etherent etherent;
- no_more = __nss_ethers_lookup2 (&nip, "gethostton_r", NULL, &fct.ptr);
+ no_more = __nss_ethers_lookup2 (&nip, "gethostton_r", NULL, &fct);
while (no_more == 0)
{
char buffer[1024];
- status = (*fct.f) (hostname, ðerent, buffer, sizeof buffer, &errno);
+ status = ((lookup_function) fct) (hostname, ðerent, buffer,
+ sizeof buffer, &errno);
- no_more = __nss_next2 (&nip, "gethostton_r", NULL, &fct.ptr, status, 0);
+ no_more = __nss_next2 (&nip, "gethostton_r", NULL, &fct, status, 0);
}
if (status == NSS_STATUS_SUCCESS)
ether_ntohost (char *hostname, const struct ether_addr *addr)
{
nss_action_list nip;
- union
- {
- lookup_function f;
- void *ptr;
- } fct;
+ void *fct;
int no_more;
enum nss_status status = NSS_STATUS_UNAVAIL;
struct etherent etherent;
- no_more = __nss_ethers_lookup2 (&nip, "getntohost_r", NULL, &fct.ptr);
+ no_more = __nss_ethers_lookup2 (&nip, "getntohost_r", NULL, &fct);
while (no_more == 0)
{
char buffer[1024];
- status = (*fct.f) (addr, ðerent, buffer, sizeof buffer, &errno);
+ status = ((lookup_function) fct) (addr, ðerent, buffer,
+ sizeof buffer, &errno);
- no_more = __nss_next2 (&nip, "getntohost_r", NULL, &fct.ptr, status, 0);
+ no_more = __nss_next2 (&nip, "getntohost_r", NULL, &fct, status, 0);
}
if (status == NSS_STATUS_SUCCESS)
LOOKUP_TYPE mergegrp;
char *mergebuf = NULL;
char *endptr = NULL;
- union
- {
- lookup_function l;
- void *ptr;
- } fct;
+ void *fct;
int no_more, err;
enum nss_status status = NSS_STATUS_UNAVAIL;
#ifdef USE_NSCD
#endif
no_more = DB_LOOKUP_FCT (&nip, REENTRANT_NAME_STRING,
- REENTRANT2_NAME_STRING, &fct.ptr);
+ REENTRANT2_NAME_STRING, &fct);
while (no_more == 0)
{
any_service = true;
#endif
- status = DL_CALL_FCT (fct.l, (ADD_VARIABLES, resbuf, buffer, buflen,
- &errno H_ERRNO_VAR EXTRA_VARIABLES));
+ status = DL_CALL_FCT (((lookup_function) fct),
+ (ADD_VARIABLES, resbuf, buffer, buflen,
+ &errno H_ERRNO_VAR EXTRA_VARIABLES));
/* The status is NSS_STATUS_TRYAGAIN and errno is ERANGE the
provided buffer is too small. In this case we should give
}
no_more = __nss_next2 (&nip, REENTRANT_NAME_STRING,
- REENTRANT2_NAME_STRING, &fct.ptr, status, 0);
+ REENTRANT2_NAME_STRING, &fct, status, 0);
}
free (mergebuf);
mergebuf = NULL;
__internal_setnetgrent_reuse (const char *group, struct __netgrent *datap,
int *errnop)
{
- union
- {
- enum nss_status (*f) (const char *, struct __netgrent *);
- void *ptr;
- } fct;
+ void *fct;
enum nss_status status = NSS_STATUS_UNAVAIL;
struct name_list *new_elem;
endnetgrent_hook (datap);
/* Cycle through all the services and run their setnetgrent functions. */
- int no_more = setup (&fct.ptr, &datap->nip);
+ int no_more = setup (&fct, &datap->nip);
while (! no_more)
{
assert (datap->data == NULL);
/* Ignore status, we force check in `__nss_next2'. */
- status = DL_CALL_FCT (*fct.f, (group, datap));
+ status = DL_CALL_FCT (((enum nss_status (*) (const char *,
+ struct __netgrent *)) fct),
+ (group, datap));
nss_action_list old_nip = datap->nip;
- no_more = __nss_next2 (&datap->nip, "setnetgrent", NULL, &fct.ptr,
+ no_more = __nss_next2 (&datap->nip, "setnetgrent", NULL, &fct,
status, 0);
if (status == NSS_STATUS_SUCCESS && ! no_more)
}
#endif
- union
- {
- enum nss_status (*f) (const char *, struct __netgrent *);
- void *ptr;
- } setfct;
+ void *setfct;
void (*endfct) (struct __netgrent *);
int (*getfct) (struct __netgrent *, char *, size_t, int *);
struct __netgrent entry;
the work during one walk through the service list. */
while (1)
{
- int no_more = setup (&setfct.ptr, &entry.nip);
+ int no_more = setup (&setfct, &entry.nip);
while (! no_more)
{
assert (entry.data == NULL);
/* Open netgroup. */
- enum nss_status status = DL_CALL_FCT (*setfct.f,
- (current_group, &entry));
+ enum nss_status status
+ = DL_CALL_FCT (((enum nss_status (*) (const char *,
+ struct __netgrent *))
+ setfct), (current_group, &entry));
if (status == NSS_STATUS_SUCCESS
&& (getfct = __nss_lookup_function (entry.nip, "getnetgrent_r"))
/* Look for the next service. */
no_more = __nss_next2 (&entry.nip, "setnetgrent", NULL,
- &setfct.ptr, status, 0);
+ &setfct, status, 0);
}
if (result == 0 && entry.needed_groups != NULL)
nss_action_list *last_nip, int stayopen, int *stayopen_tmp,
int res)
{
- union
- {
- setent_function f;
- void *ptr;
- } fct;
+ void *fct;
int no_more;
struct resolv_context *res_ctx = NULL;
/* Cycle through the services and run their `setXXent' functions until
we find an available service. */
- no_more = setup (func_name, lookup_fct, &fct.ptr, nip,
+ no_more = setup (func_name, lookup_fct, &fct, nip,
startp, 1);
while (! no_more)
{
enum nss_status status;
if (stayopen_tmp)
- status = DL_CALL_FCT (fct.f, (*stayopen_tmp));
+ status = DL_CALL_FCT (((setent_function) fct), (*stayopen_tmp));
else
- status = DL_CALL_FCT (fct.f, (0));
+ status = DL_CALL_FCT (((setent_function) fct), (0));
/* This is a special-case. When [SUCCESS=merge] is in play,
if (nss_next_action (*nip, status) == NSS_ACTION_MERGE)
no_more = 1;
else
- no_more = __nss_next2 (nip, func_name, NULL, &fct.ptr, status, 0);
+ no_more = __nss_next2 (nip, func_name, NULL, &fct, status, 0);
if (is_last_nip)
*last_nip = *nip;
nss_action_list *nip, nss_action_list *startp,
nss_action_list *last_nip, int res)
{
- union
- {
- endent_function f;
- void *ptr;
- } fct;
+ void *fct;
int no_more;
struct resolv_context *res_ctx = NULL;
}
/* Cycle through all the services and run their endXXent functions. */
- no_more = setup (func_name, lookup_fct, &fct.ptr, nip, startp, 1);
+ no_more = setup (func_name, lookup_fct, &fct, nip, startp, 1);
while (! no_more)
{
/* Ignore status, we force check in __NSS_NEXT. */
- DL_CALL_FCT (fct.f, ());
+ DL_CALL_FCT (((endent_function) fct), ());
if (*nip == *last_nip)
/* We have processed all services which were used. */
break;
- no_more = __nss_next2 (nip, func_name, NULL, &fct.ptr, 0, 1);
+ no_more = __nss_next2 (nip, func_name, NULL, &fct, 0, 1);
}
*last_nip = *nip = NULL;
void *resbuf, char *buffer, size_t buflen,
void **result, int *h_errnop)
{
- union
- {
- getent_function f;
- void *ptr;
- } fct;
+ void *fct;
int no_more;
enum nss_status status;
/* Run through available functions, starting with the same function last
run. We will repeat each function as long as it succeeds, and then go
on to the next service action. */
- no_more = setup (getent_func_name, lookup_fct, &fct.ptr, nip,
+ no_more = setup (getent_func_name, lookup_fct, &fct, nip,
startp, 0);
while (! no_more)
{
int is_last_nip = *nip == *last_nip;
- status = DL_CALL_FCT (fct.f,
+ status = DL_CALL_FCT (((getent_function) fct),
(resbuf, buffer, buflen, &errno, &h_errno));
/* The status is NSS_STATUS_TRYAGAIN and errno is ERANGE the
&& nss_next_action (*nip, status) == NSS_ACTION_MERGE)
no_more = 1;
else
- no_more = __nss_next2 (nip, getent_func_name, NULL, &fct.ptr,
+ no_more = __nss_next2 (nip, getent_func_name, NULL, &fct,
status, 0);
if (is_last_nip)
if (! no_more)
{
/* Call the `setXXent' function. This wasn't done before. */
- union
- {
- setent_function f;
- void *ptr;
- } sfct;
+ void *sfct;
- no_more = __nss_lookup (nip, setent_func_name, NULL, &sfct.ptr);
+ no_more = __nss_lookup (nip, setent_func_name, NULL, &sfct);
if (! no_more)
{
if (stayopen_tmp)
- status = DL_CALL_FCT (sfct.f, (*stayopen_tmp));
+ status = DL_CALL_FCT (((setent_function) sfct), (*stayopen_tmp));
else
- status = DL_CALL_FCT (sfct.f, (0));
+ status = DL_CALL_FCT (((setent_function) sfct), (0));
}
else
status = NSS_STATUS_NOTFOUND;
int *gidlenp, gid_t * gidlist)
{
nss_action_list nip;
- union
- {
- netname2user_function f;
- void *ptr;
- } fct;
+ void *fct;
enum nss_status status = NSS_STATUS_UNAVAIL;
int no_more;
- no_more = __nss_publickey_lookup2 (&nip, "netname2user", NULL, &fct.ptr);
+ no_more = __nss_publickey_lookup2 (&nip, "netname2user", NULL, &fct);
while (!no_more)
{
- status = (*fct.f) (netname, uidp, gidp, gidlenp, gidlist);
+ status = ((netname2user_function) fct) (netname, uidp, gidp, gidlenp,
+ gidlist);
- no_more = __nss_next2 (&nip, "netname2user", NULL, &fct.ptr, status, 0);
+ no_more = __nss_next2 (&nip, "netname2user", NULL, &fct, status, 0);
}
return status == NSS_STATUS_SUCCESS;
getpublickey (const char *name, char *key)
{
nss_action_list nip;
- union
- {
- public_function f;
- void *ptr;
- } fct;
+ void *fct;
enum nss_status status = NSS_STATUS_UNAVAIL;
int no_more;
- no_more = __nss_publickey_lookup2 (&nip, "getpublickey", NULL, &fct.ptr);
+ no_more = __nss_publickey_lookup2 (&nip, "getpublickey", NULL, &fct);
while (! no_more)
{
- status = (*fct.f) (name, key, &errno);
+ status = ((public_function) fct) (name, key, &errno);
- no_more = __nss_next2 (&nip, "getpublickey", NULL, &fct.ptr, status, 0);
+ no_more = __nss_next2 (&nip, "getpublickey", NULL, &fct, status, 0);
}
return status == NSS_STATUS_SUCCESS;
getsecretkey (const char *name, char *key, const char *passwd)
{
nss_action_list nip;
- union
- {
- secret_function f;
- void *ptr;
- } fct;
+ void *fct;
enum nss_status status = NSS_STATUS_UNAVAIL;
int no_more;
- no_more = __nss_publickey_lookup2 (&nip, "getsecretkey", NULL, &fct.ptr);
+ no_more = __nss_publickey_lookup2 (&nip, "getsecretkey", NULL, &fct);
while (! no_more)
{
- status = (*fct.f) (name, key, passwd, &errno);
+ status = ((secret_function) fct) (name, key, passwd, &errno);
- no_more = __nss_next2 (&nip, "getsecretkey", NULL, &fct.ptr, status, 0);
+ no_more = __nss_next2 (&nip, "getsecretkey", NULL, &fct, status, 0);
}
return status == NSS_STATUS_SUCCESS;