---
name: "xdr_init_encode"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/xdr_init_encode"
---

# xdr\_init\_encode(9)

Initialize a struct xdr\_stream for sending data.

## NAME

xdr\_init\_encode - Initialize a struct xdr\_stream for sending data.

## SYNOPSIS

**void xdr\_init\_encode(struct xdr\_stream \*** *xdr***, struct xdr\_buf \*** *buf***, \_\_be32 \*** *p***);**

## ARGUMENTS

*xdr*

pointer to xdr\_stream struct

*buf*

pointer to XDR buffer in which to encode data

*p*

current pointer inside XDR buffer

## NOTE

at the moment the RPC client only passes the length of our scratch buffer in the xdr\_buf's header kvec. Previously this meant we needed to call **xdr\_adjust\_iovec** after encoding the data. With the new scheme, the xdr\_stream manages the details of the buffer length, and takes care of adjusting the kvec length for us.

## COPYRIGHT
