当前位置: 首页>>代码示例>>C++>>正文


C++ xdr_bool函数代码示例

本文整理汇总了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;
}
开发者ID:DaveSinclair,项目名称:DAF,代码行数:29,代码来源:daf_protocol_xdr.c

示例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;
}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:39,代码来源:kadm_rpc_xdr.c

示例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;
}
开发者ID:epicsdeb,项目名称:sdds,代码行数:56,代码来源:agilentcomm.cpp

示例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;
}
开发者ID:DaveSinclair,项目名称:DAF,代码行数:54,代码来源:daf_protocol_xdr.c

示例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;
}
开发者ID:ArmstrongJ,项目名称:MiNTLib,代码行数:54,代码来源:xklm_prot.c

示例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);
}
开发者ID:GSchiaffonati,项目名称:OmegaFreeBSD,代码行数:12,代码来源:klm_prot_xdr.c

示例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;
}
开发者ID:ArmstrongJ,项目名称:MiNTLib,代码行数:13,代码来源:xklm_prot.c

示例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;
}
开发者ID:rsevero,项目名称:glusterfs,代码行数:13,代码来源:nlm4-xdr.c

示例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);
}
开发者ID:kouui,项目名称:rh,代码行数:49,代码来源:writeinput_xdr.c

示例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;
}
开发者ID:DaveSinclair,项目名称:DAF,代码行数:15,代码来源:daf_protocol_xdr.c

示例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;
}
开发者ID:ArmstrongJ,项目名称:MiNTLib,代码行数:15,代码来源:xnlm_prot.c

示例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);
}
开发者ID:BjoKaSH,项目名称:ZCE-CDDL-FILES,代码行数:57,代码来源:xdr_rdma.c

示例13: xdr_getquota_rslt

static int xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
{
	if (!xdr_int(xdrsp, &quotastat)) {
		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);
}
开发者ID:livebox,项目名称:livebox2,代码行数:28,代码来源:quotas.c

示例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;
}
开发者ID:DaveSinclair,项目名称:DAF,代码行数:27,代码来源:daf_protocol_xdr.c

示例15: my_xdr_getquota_rslt

static int my_xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
{
	int quotastat;

	if (!xdr_int(xdrsp, &quotastat)) {
		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);
}
开发者ID:DanilKorotenko,项目名称:samba,代码行数:32,代码来源:sysquotas_nfs.c


注:本文中的xdr_bool函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。