本文整理汇总了C++中INTUSE函数的典型用法代码示例。如果您正苦于以下问题:C++ INTUSE函数的具体用法?C++ INTUSE怎么用?C++ INTUSE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了INTUSE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load_dw
/* Try to start up libdw on DEBUGFILE. */
static Dwfl_Error
load_dw (Dwfl_Module *mod, struct dwfl_file *debugfile)
{
if (mod->e_type == ET_REL && !debugfile->relocated)
{
const Dwfl_Callbacks *const cb = mod->dwfl->callbacks;
/* The debugging sections have to be relocated. */
if (cb->section_address == NULL)
return DWFL_E_NOREL;
Dwfl_Error error = __libdwfl_module_getebl (mod);
if (error != DWFL_E_NOERROR)
return error;
find_symtab (mod);
Dwfl_Error result = mod->symerr;
if (result == DWFL_E_NOERROR)
result = __libdwfl_relocate (mod, debugfile->elf, true);
if (result != DWFL_E_NOERROR)
return result;
/* Don't keep the file descriptors around. */
if (mod->main.fd != -1 && elf_cntl (mod->main.elf, ELF_C_FDREAD) == 0)
{
close (mod->main.fd);
mod->main.fd = -1;
}
if (debugfile->fd != -1 && elf_cntl (debugfile->elf, ELF_C_FDREAD) == 0)
{
close (debugfile->fd);
debugfile->fd = -1;
}
}
mod->dw = INTUSE(dwarf_begin_elf) (debugfile->elf, DWARF_C_READ, NULL);
if (mod->dw == NULL)
{
int err = INTUSE(dwarf_errno) ();
return err == DWARF_E_NO_DWARF ? DWFL_E_NO_DWARF : DWFL_E (LIBDW, err);
}
/* Until we have iterated through all CU's, we might do lazy lookups. */
mod->lazycu = 1;
return DWFL_E_NOERROR;
}
示例2: xdr_keystatus
bool_t
xdr_keystatus (XDR * xdrs, keystatus * objp)
{
if (!INTUSE(xdr_enum) (xdrs, (enum_t *) objp))
return FALSE;
return TRUE;
}
示例3: xdr_netnamestr
bool_t
xdr_netnamestr (XDR * xdrs, netnamestr * objp)
{
if (!INTUSE(xdr_string) (xdrs, objp, MAXNETNAMELEN))
return FALSE;
return TRUE;
}
示例4: key_get_conv
int
key_get_conv (char *pkey, des_block *deskey)
{
cryptkeyres res;
if (!key_call ((u_long) KEY_GET_CONV, (xdrproc_t) INTUSE(xdr_keybuf), pkey,
(xdrproc_t) INTUSE(xdr_cryptkeyres), (char *) &res))
return -1;
if (res.status != KEY_SUCCESS)
{
debug ("get_conv status is nonzero");
return -1;
}
*deskey = res.cryptkeyres_u.deskey;
return 0;
}
示例5: xdr_keybuf
bool_t
xdr_keybuf (XDR * xdrs, keybuf objp)
{
if (!INTUSE(xdr_opaque) (xdrs, objp, HEXKEYBYTES))
return FALSE;
return TRUE;
}
示例6: key_setnet
int
key_setnet (struct key_netstarg *arg)
{
keystatus status;
if (!key_call ((u_long) KEY_NET_PUT, (xdrproc_t) INTUSE(xdr_key_netstarg),
(char *) arg,(xdrproc_t) INTUSE(xdr_keystatus),
(char *) &status))
return -1;
if (status != KEY_SUCCESS)
{
debug ("key_setnet status is nonzero");
return -1;
}
return 1;
}
示例7: __libdw_formptr
internal_function unsigned char *
__libdw_formptr (Dwarf_Attribute *attr, int sec_index,
int err_nodata, unsigned char **endpp,
Dwarf_Off *offsetp)
{
if (attr == NULL)
return NULL;
const Elf_Data *d = attr->cu->dbg->sectiondata[sec_index];
if (unlikely (d == NULL))
{
__libdw_seterrno (err_nodata);
return NULL;
}
Dwarf_Word offset;
if (attr->form == DW_FORM_sec_offset)
{
if (__libdw_read_offset (attr->cu->dbg, attr->cu->dbg,
cu_sec_idx (attr->cu), attr->valp,
attr->cu->offset_size, &offset, sec_index, 0))
return NULL;
}
else if (attr->cu->version > 3)
goto invalid;
else
switch (attr->form)
{
case DW_FORM_data4:
case DW_FORM_data8:
if (__libdw_read_offset (attr->cu->dbg, attr->cu->dbg,
cu_sec_idx (attr->cu),
attr->valp,
attr->form == DW_FORM_data4 ? 4 : 8,
&offset, sec_index, 0))
return NULL;
break;
default:
if (INTUSE(dwarf_formudata) (attr, &offset))
return NULL;
};
unsigned char *readp = d->d_buf + offset;
unsigned char *endp = d->d_buf + d->d_size;
if (unlikely (readp >= endp))
{
invalid:
__libdw_seterrno (DWARF_E_INVALID_DWARF);
return NULL;
}
if (endpp != NULL)
*endpp = endp;
if (offsetp != NULL)
*offsetp = offset;
return readp;
}
示例8: dwarf_begin
Dwarf *
dwarf_begin (int fd, Dwarf_Cmd cmd)
{
Elf *elf;
Elf_Cmd elfcmd;
Dwarf *result = NULL;
switch (cmd)
{
case DWARF_C_READ:
elfcmd = ELF_C_READ_MMAP;
break;
case DWARF_C_WRITE:
elfcmd = ELF_C_WRITE;
break;
case DWARF_C_RDWR:
elfcmd = ELF_C_RDWR;
break;
default:
/* No valid mode. */
__libdw_seterrno (DWARF_E_INVALID_CMD);
return NULL;
}
/* We have to call `elf_version' here since the user might have not
done it or initialized libelf with a different version. This
would break libdwarf since we are using the ELF data structures
in a certain way. */
elf_version (EV_CURRENT);
/* Get an ELF descriptor. */
elf = elf_begin (fd, elfcmd, NULL);
if (elf == NULL)
{
/* Test why the `elf_begin" call failed. */
struct stat64 st;
if (fstat64 (fd, &st) == 0 && ! S_ISREG (st.st_mode))
__libdw_seterrno (DWARF_E_NO_REGFILE);
else if (errno == EBADF)
__libdw_seterrno (DWARF_E_INVALID_FILE);
else
__libdw_seterrno (DWARF_E_IO_ERROR);
}
else
{
/* Do the real work now that we have an ELF descriptor. */
result = INTUSE(dwarf_begin_elf) (elf, cmd, NULL);
/* If this failed, free the resources. */
if (result == NULL)
elf_end (elf);
else
result->free_elf = true;
}
return result;
}
示例9: clntraw_create
/*
* Create a client handle for memory based rpc.
*/
CLIENT *
clntraw_create (u_long prog, u_long vers)
{
struct clntraw_private_s *clp = clntraw_private;
struct rpc_msg call_msg;
XDR *xdrs;
CLIENT *client;
if (clp == 0)
{
clp = (struct clntraw_private_s *) calloc (1, sizeof (*clp));
if (clp == 0)
return (0);
clntraw_private = clp;
}
xdrs = &clp->xdr_stream;
client = &clp->client_object;
/*
* pre-serialize the static part of the call msg and stash it away
*/
call_msg.rm_direction = CALL;
call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
call_msg.rm_call.cb_prog = prog;
call_msg.rm_call.cb_vers = vers;
INTUSE(xdrmem_create) (xdrs, clp->mashl_callmsg.msg, MCALL_MSG_SIZE,
XDR_ENCODE);
if (!INTUSE(xdr_callhdr) (xdrs, &call_msg))
{
perror (_ ("clnt_raw.c: fatal header serialization error"));
}
clp->mcnt = XDR_GETPOS (xdrs);
XDR_DESTROY (xdrs);
/*
* Set xdrmem for client/server shared buffer
*/
INTUSE(xdrmem_create) (xdrs, clp->_raw_buf, UDPMSGSIZE, XDR_FREE);
/*
* create client handle
*/
client->cl_ops = (struct clnt_ops *) &client_ops;
client->cl_auth = INTUSE(authnone_create) ();
return client;
}
示例10: xdr_rejected_reply
/*
* XDR the MSG_DENIED part of a reply message union
*/
bool_t
xdr_rejected_reply (XDR *xdrs, struct rejected_reply *rr)
{
/* personalized union, rather than calling xdr_union */
if (!INTUSE(xdr_enum) (xdrs, (enum_t *) & (rr->rj_stat)))
return FALSE;
switch (rr->rj_stat)
{
case RPC_MISMATCH:
if (!INTUSE(xdr_u_long) (xdrs, &(rr->rj_vers.low)))
return FALSE;
return INTUSE(xdr_u_long) (xdrs, &(rr->rj_vers.high));
case AUTH_ERROR:
return INTUSE(xdr_enum) (xdrs, (enum_t *) & (rr->rj_why));
}
return FALSE;
}
示例11: svc_getreq
void
svc_getreq (int rdfds)
{
fd_set readfds;
FD_ZERO (&readfds);
readfds.fds_bits[0] = rdfds;
INTUSE(svc_getreqset) (&readfds);
}
示例12: key_secretkey_is_set
/* key_secretkey_is_set() returns 1 if the keyserver has a secret key
* stored for the caller's effective uid; it returns 0 otherwise
*
* N.B.: The KEY_NET_GET key call is undocumented. Applications shouldn't
* be using it, because it allows them to get the user's secret key.
*/
int
key_secretkey_is_set (void)
{
struct key_netstres kres;
memset (&kres, 0, sizeof (kres));
if (key_call ((u_long) KEY_NET_GET, (xdrproc_t) INTUSE(xdr_void),
(char *) NULL, (xdrproc_t) INTUSE(xdr_key_netstres),
(char *) &kres) &&
(kres.status == KEY_SUCCESS) &&
(kres.key_netstres_u.knet.st_priv_key[0] != 0))
{
/* avoid leaving secret key in memory */
memset (kres.key_netstres_u.knet.st_priv_key, 0, HEXKEYBYTES);
return 1;
}
return 0;
}
示例13: module_callback
static int
module_callback (Dwfl_Module *mod, void **userdata,
const char *name, Dwarf_Addr start, void *arg)
{
const struct module_callback_info *info = arg;
Dwarf_Addr bias = 0;
Dwarf *dw = INTUSE(dwfl_module_getdwarf) (mod, &bias);
return (*info->callback) (mod, userdata, name, start, dw, bias, info->arg);
}
示例14: _IO_obstack_vprintf
int
_IO_obstack_vprintf (struct obstack *obstack, const char *format, va_list args)
{
struct obstack_FILE
{
struct _IO_obstack_file ofile;
} new_f;
int result;
int size;
int room;
#ifdef _IO_MTSAFE_IO
new_f.ofile.file.file._lock = NULL;
#endif
_IO_no_init (&new_f.ofile.file.file, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS (&new_f.ofile.file) = &_IO_obstack_jumps;
room = obstack_room (obstack);
size = obstack_object_size (obstack) + room;
if (size == 0)
{
/* We have to handle the allocation a bit different since the
`_IO_str_init_static' function would handle a size of zero
different from what we expect. */
/* Get more memory. */
obstack_make_room (obstack, 64);
/* Recompute how much room we have. */
room = obstack_room (obstack);
size = room;
assert (size != 0);
}
_IO_str_init_static_internal ((struct _IO_strfile_ *) &new_f.ofile,
obstack_base (obstack),
size, obstack_next_free (obstack));
/* Now allocate the rest of the current chunk. */
assert (size == (new_f.ofile.file.file._IO_write_end
- new_f.ofile.file.file._IO_write_base));
assert (new_f.ofile.file.file._IO_write_ptr
== (new_f.ofile.file.file._IO_write_base
+ obstack_object_size (obstack)));
obstack_blank_fast (obstack, room);
new_f.ofile.obstack = obstack;
result = INTUSE(_IO_vfprintf) (&new_f.ofile.file.file, format, args);
/* Shrink the buffer to the space we really currently need. */
obstack_blank_fast (obstack, (new_f.ofile.file.file._IO_write_ptr
- new_f.ofile.file.file._IO_write_end));
return result;
}
示例15: __nldbl_vfprintf
int
attribute_compat_text_section
__nldbl_vfprintf (FILE *s, const char *fmt, va_list ap)
{
int done;
set_no_long_double ();
done = INTUSE(_IO_vfprintf) (s, fmt, ap);
clear_no_long_double ();
return done;
}