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


C++ xdr_u_long函数代码示例

本文整理汇总了C++中xdr_u_long函数的典型用法代码示例。如果您正苦于以下问题:C++ xdr_u_long函数的具体用法?C++ xdr_u_long怎么用?C++ xdr_u_long使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了xdr_u_long函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: xdr_rmtcall_args

/*
 * XDR remote call arguments
 * written for XDR_ENCODE direction only
 */
bool_t
xdr_rmtcall_args(
	register XDR *xdrs,
	register struct rmtcallargs *cap)
{
	unsigned lenposition, argposition, position;

	if (xdr_u_long(xdrs, &(cap->prog)) &&
	    xdr_u_long(xdrs, &(cap->vers)) &&
	    xdr_u_long(xdrs, &(cap->proc))) {
		lenposition = XDR_GETPOS(xdrs);
		if (! xdr_u_long(xdrs, &(cap->arglen)))
		    return (FALSE);
		argposition = XDR_GETPOS(xdrs);
		if (! (*(cap->xdr_args))(xdrs, cap->args_ptr))
		    return (FALSE);
		position = XDR_GETPOS(xdrs);
		cap->arglen = (unsigned long)position - (unsigned long)argposition;
		XDR_SETPOS(xdrs, lenposition);
		if (! xdr_u_long(xdrs, &(cap->arglen)))
		    return (FALSE);
		XDR_SETPOS(xdrs, position);
		return (TRUE);
	}
	return (FALSE);
}
开发者ID:KeithLatteri,项目名称:awips2,代码行数:30,代码来源:pmap_rmt.c

示例2: xdr_rmtcall_args

/*
 * XDR remote call arguments
 * written for XDR_ENCODE direction only
 */
bool_t
xdr_rmtcall_args (XDR *xdrs, struct rmtcallargs *cap)
{
  u_int lenposition, argposition, position;

  if (xdr_u_long (xdrs, &(cap->prog)) &&
      xdr_u_long (xdrs, &(cap->vers)) &&
      xdr_u_long (xdrs, &(cap->proc)))
    {
      u_long dummy_arglen = 0;
      lenposition = XDR_GETPOS (xdrs);
      if (!xdr_u_long (xdrs, &dummy_arglen))
	return FALSE;
      argposition = XDR_GETPOS (xdrs);
      if (!(*(cap->xdr_args)) (xdrs, cap->args_ptr))
	return FALSE;
      position = XDR_GETPOS (xdrs);
      cap->arglen = (u_long) position - (u_long) argposition;
      XDR_SETPOS (xdrs, lenposition);
      if (!xdr_u_long (xdrs, &(cap->arglen)))
	return FALSE;
      XDR_SETPOS (xdrs, position);
      return TRUE;
    }
  return FALSE;
}
开发者ID:Jaden-J,项目名称:uClibc,代码行数:30,代码来源:pmap_rmt.c

示例3: xdr_ndmp3_mover_get_state_reply

bool_t
xdr_ndmp3_mover_get_state_reply (XDR *xdrs, ndmp3_mover_get_state_reply *objp)
{
	if (!xdr_ndmp3_error (xdrs, &objp->error))
		return FALSE;
	if (!xdr_ndmp3_mover_state (xdrs, &objp->state))
		return FALSE;
	if (!xdr_ndmp3_mover_pause_reason (xdrs, &objp->pause_reason))
		return FALSE;
	if (!xdr_ndmp3_mover_halt_reason (xdrs, &objp->halt_reason))
		return FALSE;
	if (!xdr_u_long (xdrs, &objp->record_size))
		return FALSE;
	if (!xdr_u_long (xdrs, &objp->record_num))
		return FALSE;
	if (!xdr_ndmp3_u_quad (xdrs, &objp->data_written))
		return FALSE;
	if (!xdr_ndmp3_u_quad (xdrs, &objp->seek_position))
		return FALSE;
	if (!xdr_ndmp3_u_quad (xdrs, &objp->bytes_left_to_read))
		return FALSE;
	if (!xdr_ndmp3_u_quad (xdrs, &objp->window_offset))
		return FALSE;
	if (!xdr_ndmp3_u_quad (xdrs, &objp->window_length))
		return FALSE;
	if (!xdr_ndmp3_addr (xdrs, &objp->data_connection_addr))
		return FALSE;
	return TRUE;
}
开发者ID:TonyChiang,项目名称:amanda,代码行数:29,代码来源:ndmp3_xdr.c

示例4: xdr_rmtcall_args

/*
 * XDR remote call arguments
 * written for XDR_ENCODE direction only
 */
bool
xdr_rmtcall_args(XDR *xdrs, struct rmtcallargs *cap)
{
	u_int lenposition, argposition, position;

	assert(xdrs != NULL);
	assert(cap != NULL);

	if (xdr_u_long(xdrs, &(cap->prog)) && xdr_u_long(xdrs, &(cap->vers))
	    && xdr_u_long(xdrs, &(cap->proc))) {
		lenposition = XDR_GETPOS(xdrs);
		if (!xdr_u_long(xdrs, &(cap->arglen)))
			return (false);
		argposition = XDR_GETPOS(xdrs);
		if (!(*(cap->xdr_args)) (xdrs, cap->args_ptr))
			return (false);
		position = XDR_GETPOS(xdrs);
		cap->arglen = (u_long) position - (u_long) argposition;
		XDR_SETPOS(xdrs, lenposition);
		if (!xdr_u_long(xdrs, &(cap->arglen)))
			return (false);
		XDR_SETPOS(xdrs, position);
		return (true);
	}
	return (false);
}
开发者ID:hkoehler,项目名称:ntirpc,代码行数:30,代码来源:pmap_rmt.c

示例5: xdr_rmtcall_args

/*
 * XDR remote call arguments
 * written for XDR_ENCODE direction only
 */
bool_t
xdr_rmtcall_args(
	register XDR *xdrs,
	register struct rmtcallargs *cap)
{
	uint32 lenposition, argposition, position;

	if (xdr_prog_t(xdrs, &(cap->prog)) &&
	    xdr_vers_t(xdrs, &(cap->vers)) &&
	    xdr_proc_t(xdrs, &(cap->proc))) {
		/*
		 * All the jugglery for just getting the size of the arguments
		 */
		lenposition = XDR_GETPOS(xdrs);
		if (! xdr_u_long(xdrs, &(cap->arglen)))
		    return (FALSE);
		argposition = XDR_GETPOS(xdrs);
		if (! (*(cap->xdr_args))(xdrs, cap->args_ptr))
		    return (FALSE);
		position = XDR_GETPOS(xdrs);
		cap->arglen = position - argposition;
		XDR_SETPOS(xdrs, lenposition);
		if (! xdr_u_long(xdrs, &(cap->arglen)))
		    return (FALSE);
		XDR_SETPOS(xdrs, position);
		return (TRUE);
	}
	return (FALSE);
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:33,代码来源:pmappro.c

示例6: xdr_ndmp3_data_get_state_reply

bool_t
xdr_ndmp3_data_get_state_reply (XDR *xdrs, ndmp3_data_get_state_reply *objp)
{
	if (!xdr_u_long (xdrs, &objp->invalid))
		return FALSE;
	if (!xdr_ndmp3_error (xdrs, &objp->error))
		return FALSE;
	if (!xdr_ndmp3_data_operation (xdrs, &objp->operation))
		return FALSE;
	if (!xdr_ndmp3_data_state (xdrs, &objp->state))
		return FALSE;
	if (!xdr_ndmp3_data_halt_reason (xdrs, &objp->halt_reason))
		return FALSE;
	if (!xdr_ndmp3_u_quad (xdrs, &objp->bytes_processed))
		return FALSE;
	if (!xdr_ndmp3_u_quad (xdrs, &objp->est_bytes_remain))
		return FALSE;
	if (!xdr_u_long (xdrs, &objp->est_time_remain))
		return FALSE;
	if (!xdr_ndmp3_addr (xdrs, &objp->data_connection_addr))
		return FALSE;
	if (!xdr_ndmp3_u_quad (xdrs, &objp->read_offset))
		return FALSE;
	if (!xdr_ndmp3_u_quad (xdrs, &objp->read_length))
		return FALSE;
	return TRUE;
}
开发者ID:TonyChiang,项目名称:amanda,代码行数:27,代码来源:ndmp3_xdr.c

示例7: xdr_uint64

bool_t
xdr_uint64(register XDR *xdrs,
           uint64 *objp)
{
    if (!xdr_u_long(xdrs,(u_long *) &(objp->most)))
        return (FALSE);
    return (xdr_u_long(xdrs,(u_long *) &(objp->least)));
} /* xdr_uint64 */
开发者ID:shuowen,项目名称:OpenNT,代码行数:8,代码来源:xdr.c

示例8: xdr_ipgmsg

/************************************************************************
*									*
*  Convert the Ipgmsg into XDR format.					*
*									*/
static bool_t
xdr_ipgmsg(XDR *xdrs, Ipgmsg *msg)
{
   if (!xdr_u_long(xdrs, &msg->major_id) ||
       !xdr_u_long(xdrs, &msg->minor_id) ||
       !xdr_string(xdrs, &msg->msgbuf, IPG_MAX_BYTES))
      return(FALSE);
   return(TRUE);
}
开发者ID:timburrow,项目名称:ovj3,代码行数:13,代码来源:ipgwin.c

示例9: xdr__ndmp3_u_quad

bool_t
xdr__ndmp3_u_quad (XDR *xdrs, _ndmp3_u_quad *objp)
{
	if (!xdr_u_long (xdrs, &objp->high))
		return FALSE;
	if (!xdr_u_long (xdrs, &objp->low))
		return FALSE;
	return TRUE;
}
开发者ID:TonyChiang,项目名称:amanda,代码行数:9,代码来源:ndmp3_xdr.c

示例10: 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

示例11: xdr_portmap

bool_t
xdr_portmap(XDR *xdrs, struct portmap *regs)
{

	if (xdr_u_long(xdrs, &regs->pm_prog) &&
		xdr_u_long(xdrs, &regs->pm_vers) &&
		xdr_u_long(xdrs, &regs->pm_prot))
		return (xdr_u_long(xdrs, &regs->pm_port));
	return (FALSE);
}
开发者ID:coyizumi,项目名称:cs111,代码行数:10,代码来源:rpcb_prot.c

示例12: xdr_nodst

bool_t xdr_nodst(XDR *xdrs, struct mknod_st *nodst)
{
    if(!xdr_vector(xdrs, (char *)&nodst->path, 100 ,sizeof(char), (xdrproc_t)xdr_char))
        return (FALSE);
    if(!xdr_u_long(xdrs, &nodst->mode))
        return (FALSE);
    if(!xdr_u_long(xdrs, &nodst->rdev))
        return (FALSE);
    return (TRUE);
}
开发者ID:eukeka,项目名称:p2pfs-VNODE,代码行数:10,代码来源:server.c

示例13: xdr_ndmp3_execute_cdb_request

bool_t
xdr_ndmp3_execute_cdb_request (XDR *xdrs, ndmp3_execute_cdb_request *objp)
{
	register int32_t *buf;

	if (xdrs->x_op == XDR_ENCODE) {
		buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
		if (buf == NULL) {
			if (!xdr_u_long (xdrs, &objp->flags))
				return FALSE;
			if (!xdr_u_long (xdrs, &objp->timeout))
				return FALSE;
			if (!xdr_u_long (xdrs, &objp->datain_len))
				return FALSE;

		} else {
		IXDR_PUT_U_LONG(buf, objp->flags);
		IXDR_PUT_U_LONG(buf, objp->timeout);
		IXDR_PUT_U_LONG(buf, objp->datain_len);
		}
		if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
			return FALSE;
		if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~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_u_long (xdrs, &objp->flags))
				return FALSE;
			if (!xdr_u_long (xdrs, &objp->timeout))
				return FALSE;
			if (!xdr_u_long (xdrs, &objp->datain_len))
				return FALSE;

		} else {
		objp->flags = IXDR_GET_U_LONG(buf);
		objp->timeout = IXDR_GET_U_LONG(buf);
		objp->datain_len = IXDR_GET_U_LONG(buf);
		}
		if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
			return FALSE;
		if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
			return FALSE;
		return TRUE;
	}

	if (!xdr_u_long (xdrs, &objp->flags))
		return FALSE;
	if (!xdr_u_long (xdrs, &objp->timeout))
		return FALSE;
	if (!xdr_u_long (xdrs, &objp->datain_len))
		return FALSE;
	if (!xdr_bytes (xdrs, (char **)&objp->cdb.cdb_val, (u_int *) &objp->cdb.cdb_len, ~0))
		return FALSE;
	if (!xdr_bytes (xdrs, (char **)&objp->dataout.dataout_val, (u_int *) &objp->dataout.dataout_len, ~0))
		return FALSE;
	return TRUE;
}
开发者ID:TonyChiang,项目名称:amanda,代码行数:59,代码来源:ndmp3_xdr.c

示例14: xdr_pmap

bool
xdr_pmap(XDR *xdrs, struct pmap *regs)
{

    assert(xdrs != NULL);
    assert(regs != NULL);

    if (xdr_u_long(xdrs, &regs->pm_prog) &&
        xdr_u_long(xdrs, &regs->pm_vers) &&
        xdr_u_long(xdrs, &regs->pm_prot))
        return (xdr_u_long(xdrs, &regs->pm_port));
    return (FALSE);
}
开发者ID:bongiojp,项目名称:libtirpc-lbx,代码行数:13,代码来源:pmap_prot.c

示例15: xdr_callhdr

/*
 * Serializes the "static part" of a call message header.
 * The fields include: rm_xid, rm_direction, rpcvers, prog, and vers.
 * The rm_xid is not really static, but the user can easily munge on the fly.
 */
bool_t xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg)
{

	cmsg->rm_direction = CALL;
	cmsg->rm_call.cb_rpcvers = RPC_MSG_VERSION;
	if (
		(xdrs->x_op == XDR_ENCODE) &&
		xdr_u_long(xdrs, &(cmsg->rm_xid)) &&
		xdr_enum(xdrs, (enum_t *) & (cmsg->rm_direction)) &&
		xdr_u_long(xdrs, &(cmsg->rm_call.cb_rpcvers)) &&
		xdr_u_long(xdrs, &(cmsg->rm_call.cb_prog)))
			return (xdr_u_long(xdrs, &(cmsg->rm_call.cb_vers)));
	return (FALSE);
}
开发者ID:AdrianHuang,项目名称:rt-thread-for-vmm,代码行数:19,代码来源:rpc_prot.c


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