本文整理汇总了C++中xdr_bool函数的典型用法代码示例。如果您正苦于以下问题:C++ xdr_bool函数的具体用法?C++ xdr_bool怎么用?C++ xdr_bool使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xdr_bool函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xdr_remote_client_cmd_args
bool_t
xdr_remote_client_cmd_args (XDR *xdrs, remote_client_cmd_args *objp)
{
register int32_t *buf;
if (!xdr_string (xdrs, &objp->cmdstring, MAX_CMD_LEN))
return FALSE;
if (!xdr_stringlist (xdrs, &objp->environment_settings))
return FALSE;
if (!xdr_string (xdrs, &objp->identstring, MAX_IDENT_LEN))
return FALSE;
if (!xdr_int (xdrs, &objp->run_in_background))
return FALSE;
if (!xdr_int (xdrs, &objp->run_in_shell))
return FALSE;
if (!xdr_Iu32 (xdrs, &objp->timeout))
return FALSE;
if (!xdr_bool (xdrs, &objp->fail_on_timeout))
return FALSE;
if (!xdr_bool (xdrs, &objp->workqueueID_flag))
return FALSE;
if (!xdr_Iu32 (xdrs, &objp->workqueueID))
return FALSE;
if (!xdr_Iu32 (xdrs, &objp->actionresultID))
return FALSE;
if (!xdr_int (xdrs, &objp->msglevel))
return FALSE;
return TRUE;
}
示例2: xdr_nulltype
/*
* Function: xdr_nulltype
*
* Purpose: XDR function for arbitrary pointer types that are either
* NULL or contain data.
*/
bool_t xdr_nulltype(XDR *xdrs, void **objp, xdrproc_t proc)
{
bool_t null;
switch (xdrs->x_op) {
case XDR_DECODE:
if (!xdr_bool(xdrs, &null))
return FALSE;
if (null) {
*objp = NULL;
return TRUE;
}
return (*proc)(xdrs, objp);
case XDR_ENCODE:
if (*objp == NULL)
null = TRUE;
else
null = FALSE;
if (!xdr_bool(xdrs, &null))
return FALSE;
if (null == FALSE)
return (*proc)(xdrs, objp);
return TRUE;
case XDR_FREE:
if (*objp)
return (*proc)(xdrs, objp);
return TRUE;
}
return FALSE;
}
示例3: xdr_Create_LinkParms
bool_t xdr_Create_LinkParms (XDR *xdrs, Create_LinkParms *objp)
{
#if defined(SOLARIS) && !defined(_LP64)
register long *buf;
#else
register int32_t *buf;
#endif
if (xdrs->x_op == XDR_ENCODE) {
buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
if (buf == NULL) {
if (!xdr_long (xdrs, &objp->clientId))
return FALSE;
if (!xdr_bool (xdrs, &objp->lockDevice))
return FALSE;
if (!xdr_u_long (xdrs, &objp->lock_timeout))
return FALSE;
} else {
IXDR_PUT_INT32(buf, objp->clientId);
IXDR_PUT_BOOL(buf, objp->lockDevice);
IXDR_PUT_U_INT32(buf, objp->lock_timeout);
}
if (!xdr_string (xdrs, &objp->device, ~0))
return FALSE;
return TRUE;
} else if (xdrs->x_op == XDR_DECODE) {
buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
if (buf == NULL) {
if (!xdr_long (xdrs, &objp->clientId))
return FALSE;
if (!xdr_bool (xdrs, &objp->lockDevice))
return FALSE;
if (!xdr_u_long (xdrs, &objp->lock_timeout))
return FALSE;
} else {
objp->clientId = IXDR_GET_INT32(buf);
objp->lockDevice = IXDR_GET_BOOL(buf);
objp->lock_timeout = IXDR_GET_U_INT32(buf);
}
if (!xdr_string (xdrs, &objp->device, ~0))
return FALSE;
return TRUE;
}
if (!xdr_long (xdrs, &objp->clientId))
return FALSE;
if (!xdr_bool (xdrs, &objp->lockDevice))
return FALSE;
if (!xdr_u_long (xdrs, &objp->lock_timeout))
return FALSE;
if (!xdr_string (xdrs, &objp->device, ~0))
return FALSE;
return TRUE;
}
示例4: xdr_remote_client_query_tag_outcome
bool_t
xdr_remote_client_query_tag_outcome (XDR *xdrs, remote_client_query_tag_outcome *objp)
{
register int32_t *buf;
if (xdrs->x_op == XDR_ENCODE) {
buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
if (buf == NULL) {
if (!xdr_bool (xdrs, &objp->valid))
return FALSE;
if (!xdr_u_int (xdrs, &objp->state))
return FALSE;
if (!xdr_int (xdrs, &objp->cmd_exit_code))
return FALSE;
if (!xdr_int (xdrs, &objp->cmd_exit_signal))
return FALSE;
} else {
IXDR_PUT_BOOL(buf, objp->valid);
IXDR_PUT_U_LONG(buf, objp->state);
IXDR_PUT_LONG(buf, objp->cmd_exit_code);
IXDR_PUT_LONG(buf, objp->cmd_exit_signal);
}
return TRUE;
} else if (xdrs->x_op == XDR_DECODE) {
buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
if (buf == NULL) {
if (!xdr_bool (xdrs, &objp->valid))
return FALSE;
if (!xdr_u_int (xdrs, &objp->state))
return FALSE;
if (!xdr_int (xdrs, &objp->cmd_exit_code))
return FALSE;
if (!xdr_int (xdrs, &objp->cmd_exit_signal))
return FALSE;
} else {
objp->valid = IXDR_GET_BOOL(buf);
objp->state = IXDR_GET_U_LONG(buf);
objp->cmd_exit_code = IXDR_GET_LONG(buf);
objp->cmd_exit_signal = IXDR_GET_LONG(buf);
}
return TRUE;
}
if (!xdr_bool (xdrs, &objp->valid))
return FALSE;
if (!xdr_u_int (xdrs, &objp->state))
return FALSE;
if (!xdr_int (xdrs, &objp->cmd_exit_code))
return FALSE;
if (!xdr_int (xdrs, &objp->cmd_exit_signal))
return FALSE;
return TRUE;
}
示例5: xdr_klm_holder
bool_t
xdr_klm_holder (XDR *xdrs, klm_holder *objp)
{
register int32_t *buf;
if (xdrs->x_op == XDR_ENCODE) {
buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
if (buf == NULL) {
if (!xdr_bool (xdrs, &objp->exclusive))
return FALSE;
if (!xdr_int (xdrs, &objp->svid))
return FALSE;
if (!xdr_u_int (xdrs, &objp->l_offset))
return FALSE;
if (!xdr_u_int (xdrs, &objp->l_len))
return FALSE;
} else {
IXDR_PUT_BOOL(buf, objp->exclusive);
IXDR_PUT_LONG(buf, objp->svid);
IXDR_PUT_U_LONG(buf, objp->l_offset);
IXDR_PUT_U_LONG(buf, objp->l_len);
}
return TRUE;
} else if (xdrs->x_op == XDR_DECODE) {
buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
if (buf == NULL) {
if (!xdr_bool (xdrs, &objp->exclusive))
return FALSE;
if (!xdr_int (xdrs, &objp->svid))
return FALSE;
if (!xdr_u_int (xdrs, &objp->l_offset))
return FALSE;
if (!xdr_u_int (xdrs, &objp->l_len))
return FALSE;
} else {
objp->exclusive = IXDR_GET_BOOL(buf);
objp->svid = IXDR_GET_LONG(buf);
objp->l_offset = IXDR_GET_U_LONG(buf);
objp->l_len = IXDR_GET_U_LONG(buf);
}
return TRUE;
}
if (!xdr_bool (xdrs, &objp->exclusive))
return FALSE;
if (!xdr_int (xdrs, &objp->svid))
return FALSE;
if (!xdr_u_int (xdrs, &objp->l_offset))
return FALSE;
if (!xdr_u_int (xdrs, &objp->l_len))
return FALSE;
return TRUE;
}
示例6: xdr_klm_lockargs
bool_t
xdr_klm_lockargs(XDR *xdrs, klm_lockargs *objp)
{
if (!xdr_bool(xdrs, &objp->block))
return (FALSE);
if (!xdr_bool(xdrs, &objp->exclusive))
return (FALSE);
if (!xdr_klm_lock(xdrs, &objp->alock))
return (FALSE);
return (TRUE);
}
示例7: xdr_klm_lockargs
bool_t
xdr_klm_lockargs (XDR *xdrs, klm_lockargs *objp)
{
register int32_t *buf;
if (!xdr_bool (xdrs, &objp->block))
return FALSE;
if (!xdr_bool (xdrs, &objp->exclusive))
return FALSE;
if (!xdr_klm_lock (xdrs, &objp->alock))
return FALSE;
return TRUE;
}
示例8: xdr_nlm4_cancargs
bool_t
xdr_nlm4_cancargs (XDR *xdrs, nlm4_cancargs *objp)
{
if (!xdr_netobj (xdrs, &objp->cookie))
return FALSE;
if (!xdr_bool (xdrs, &objp->block))
return FALSE;
if (!xdr_bool (xdrs, &objp->exclusive))
return FALSE;
if (!xdr_nlm4_lock (xdrs, &objp->alock))
return FALSE;
return TRUE;
}
示例9: writeInput
void writeInput(void)
{
const char routineName[] = "writeInput";
bool_t result=TRUE, PRD_angle_dep, XRD, big_endian;
FILE *fp_out;
XDR xdrs;
if (!strcmp(INPUT_DOT_OUT, "none")) return;
if ((fp_out = fopen(INPUT_DOT_OUT, "w")) == NULL) {
sprintf(messageStr, "Unable to open output file %s",
INPUT_DOT_OUT);
Error(ERROR_LEVEL_1, routineName, messageStr);
return;
}
xdrstdio_create(&xdrs, fp_out, XDR_ENCODE);
PRD_angle_dep = (input.PRD_angle_dep != PRD_ANGLE_INDEP && atmos.NPRDactive > 0);
XRD = (input.XRD && atmos.NPRDactive > 0);
/* --- Write various input parameters to file -- -------------- */
result &= xdr_bool(&xdrs, &input.magneto_optical);
result &= xdr_bool(&xdrs, &PRD_angle_dep);
result &= xdr_bool(&xdrs, &XRD);
result &= xdr_enum(&xdrs, (enum_t *) &input.startJ);
result &= xdr_enum(&xdrs, (enum_t *) &input.StokesMode);
result &= xdr_double(&xdrs, &input.metallicity);
result &= xdr_bool(&xdrs, &input.backgr_pol);
/* --- Write Endianness of compute architecture so that J can be
read properly in the analysis -- -------------- */
big_endian = is_big_endian();
result &= xdr_bool(&xdrs, &big_endian);
if (!result) {
sprintf(messageStr, "Unable to write proper amount to output file %s",
INPUT_DOT_OUT);
Error(ERROR_LEVEL_1, routineName, messageStr);
}
xdr_destroy(&xdrs);
fclose(fp_out);
}
示例10: xdr_remote_client_copyfile_outcome
bool_t
xdr_remote_client_copyfile_outcome (XDR *xdrs, remote_client_copyfile_outcome *objp)
{
register int32_t *buf;
if (!xdr_bool (xdrs, &objp->valid_copyfile))
return FALSE;
if (!xdr_int (xdrs, &objp->num_bytes_in_transfer))
return FALSE;
if (!xdr_bytes (xdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, ~0))
return FALSE;
if (!xdr_bool (xdrs, &objp->eof))
return FALSE;
return TRUE;
}
示例11: xdr_nlm_cancargs
bool_t
xdr_nlm_cancargs (XDR *xdrs, nlm_cancargs *objp)
{
register int32_t *buf;
if (!xdr_netobj (xdrs, &objp->cookie))
return FALSE;
if (!xdr_bool (xdrs, &objp->block))
return FALSE;
if (!xdr_bool (xdrs, &objp->exclusive))
return FALSE;
if (!xdr_nlm_lock (xdrs, &objp->alock))
return FALSE;
return TRUE;
}
示例12: xdr_decode_wlist
/*
* Conditionally decode a RDMA WRITE chunk list from XDR stream.
*
* If the next boolean in the XDR stream is false there is no
* RDMA WRITE chunk list present. Otherwise iterate over the
* array and for each entry: allocate a struct clist and decode.
* Pass back an indication via wlist_exists if we have seen a
* RDMA WRITE chunk list.
*/
bool_t
xdr_decode_wlist(XDR *xdrs, struct clist **w, bool_t *wlist_exists)
{
struct clist *tmp;
bool_t more = FALSE;
uint32_t seg_array_len;
uint32_t i;
if (!xdr_bool(xdrs, &more))
return (FALSE);
/* is there a wlist? */
if (more == FALSE) {
*wlist_exists = FALSE;
return (TRUE);
}
*wlist_exists = TRUE;
if (!xdr_uint32(xdrs, &seg_array_len))
return (FALSE);
tmp = *w = clist_alloc();
for (i = 0; i < seg_array_len; i++) {
if (!xdr_uint32(xdrs, &tmp->c_dmemhandle.mrc_rmr))
return (FALSE);
if (!xdr_uint32(xdrs, &tmp->c_len))
return (FALSE);
DTRACE_PROBE1(krpc__i__xdr_decode_wlist_len,
uint_t, tmp->c_len);
if (!xdr_uint64(xdrs, &tmp->u.c_daddr))
return (FALSE);
if (i < seg_array_len - 1) {
tmp->c_next = clist_alloc();
tmp = tmp->c_next;
} else {
tmp->c_next = NULL;
}
}
more = FALSE;
if (!xdr_bool(xdrs, &more))
return (FALSE);
return (TRUE);
}
示例13: xdr_getquota_rslt
static int xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
{
if (!xdr_int(xdrsp, "astat)) {
DEBUG(6,("nfs_quotas: Status bad or zero\n"));
return 0;
}
if (!xdr_int(xdrsp, &gqr->getquota_rslt_u.gqr_rquota.rq_bsize)) {
DEBUG(6,("nfs_quotas: Block size bad or zero\n"));
return 0;
}
if (!xdr_bool(xdrsp, &gqr->getquota_rslt_u.gqr_rquota.rq_active)) {
DEBUG(6,("nfs_quotas: Active bad or zero\n"));
return 0;
}
if (!xdr_int(xdrsp, &gqr->getquota_rslt_u.gqr_rquota.rq_bhardlimit)) {
DEBUG(6,("nfs_quotas: Hardlimit bad or zero\n"));
return 0;
}
if (!xdr_int(xdrsp, &gqr->getquota_rslt_u.gqr_rquota.rq_bsoftlimit)) {
DEBUG(6,("nfs_quotas: Softlimit bad or zero\n"));
return 0;
}
if (!xdr_int(xdrsp, &gqr->getquota_rslt_u.gqr_rquota.rq_curblocks)) {
DEBUG(6,("nfs_quotas: Currentblocks bad or zero\n"));
return 0;
}
return (1);
}
示例14: xdr_remote_client_query_version_outcome
bool_t
xdr_remote_client_query_version_outcome (XDR *xdrs, remote_client_query_version_outcome *objp)
{
register int32_t *buf;
if (!xdr_u_int (xdrs, &objp->agent_major_version))
return FALSE;
if (!xdr_u_int (xdrs, &objp->agent_minor_version))
return FALSE;
if (!xdr_string (xdrs, &objp->agent_version_string, 128))
return FALSE;
if (!xdr_string (xdrs, &objp->agent_build_machine, 128))
return FALSE;
if (!xdr_bool (xdrs, &objp->p_osdata_is_valid))
return FALSE;
if (!xdr_string (xdrs, &objp->p_name, 128))
return FALSE;
if (!xdr_string (xdrs, &objp->p_os_type, 128))
return FALSE;
if (!xdr_string (xdrs, &objp->p_os_version, 128))
return FALSE;
if (!xdr_string (xdrs, &objp->p_os_description, 128))
return FALSE;
if (!xdr_string (xdrs, &objp->p_cpu_architecture, 128))
return FALSE;
return TRUE;
}
示例15: my_xdr_getquota_rslt
static int my_xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
{
int quotastat;
if (!xdr_int(xdrsp, "astat)) {
DEBUG(6,("nfs_quotas: Status bad or zero\n"));
return 0;
}
gqr->GQR_STATUS = quotastat;
if (!xdr_int(xdrsp, &gqr->GQR_RQUOTA.rq_bsize)) {
DEBUG(6,("nfs_quotas: Block size bad or zero\n"));
return 0;
}
if (!xdr_bool(xdrsp, &gqr->GQR_RQUOTA.rq_active)) {
DEBUG(6,("nfs_quotas: Active bad or zero\n"));
return 0;
}
if (!xdr_int(xdrsp, (int *)&gqr->GQR_RQUOTA.rq_bhardlimit)) {
DEBUG(6,("nfs_quotas: Hardlimit bad or zero\n"));
return 0;
}
if (!xdr_int(xdrsp, (int *)&gqr->GQR_RQUOTA.rq_bsoftlimit)) {
DEBUG(6,("nfs_quotas: Softlimit bad or zero\n"));
return 0;
}
if (!xdr_int(xdrsp, (int *)&gqr->GQR_RQUOTA.rq_curblocks)) {
DEBUG(6,("nfs_quotas: Currentblocks bad or zero\n"));
return 0;
}
return (1);
}