Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man3c/./xdr_admin.3c
Real path: /usr/share/man/man3c/xdr_admin.3c
Zurück
'\" te .\" Copyright (c) 1989, AT&T. All rights reserved. .\" Copyright (c) 1997, 2021, Oracle and/or its affiliates. .TH xdr_admin 3C "11 May 2021" "Oracle Solaris 11.4" "Standard C Library Functions" .SH NAME xdr_admin, xdr_control, xdr_getpos, xdr_inline, xdrrec_endofrecord, xdrrec_eof, xdrrec_readbytes, xdrrec_skiprecord, xdr_setpos, xdr_sizeof \- library routines for external data representation .SH DESCRIPTION .sp .LP \fBXDR\fR library routines allow C programmers to describe arbitrary data structures in a machine-independent fashion. Protocols such as remote procedure calls (\fBRPC\fR) use these routines to describe the format of the data. .sp .LP These routines deal specifically with the management of the \fBXDR\fR stream. .SS "Routines" .sp .LP See \fBrpc\fR(3C) for the definition of the \fBXDR\fR data structure. Note that any buffers passed to the \fBXDR\fR routines must be properly aligned. It is suggested either that \fBmalloc\fR(3C) be used to allocate these buffers, or that the programmer ensure that the buffer address is evenly divisible by four. .sp .LP \fB#include <rpc/xdr.h>\fR .sp .ne 2 .mk .na \fB\fBbool_t xdr_control(XDR *\fR\fIxdrs\fR\fB, int\fR\fI req\fR\fB, void *\fR\fIinfo\fR\fB);\fR\fR .ad .br .sp .6 .RS 4n A function macro to change or retrieve various information about an \fBXDR\fR stream. \fIreq\fR indicates the type of operation and \fIinfo\fR is a pointer to the information. The supported values of \fIreq\fR is \fBXDR_GET_BYTES_AVAIL\fR and its argument type is \fBxdr_bytesrec *\fR. They return the number of bytes left unconsumed in the stream and a flag indicating whether or not this is the last fragment. .RE .sp .ne 2 .mk .na \fB\fBuint_t xdr_getpos(const XDR *\fR\fIxdrs\fR\fB);\fR\fR .ad .br .sp .6 .RS 4n A macro that invokes the get-position routine associated with the \fBXDR\fR stream, \fIxdrs\fR. The routine returns an unsigned integer, which indicates the position of the \fBXDR\fR byte stream. A desirable feature of \fBXDR\fR streams is that simple arithmetic works with this number, although the \fBXDR\fR stream instances need not guarantee this. Therefore, applications written for portability should not depend on this feature. .RE .sp .ne 2 .mk .na \fB\fBlong *xdr_inline(XDR *\fR\fIxdrs\fR\fB, const int\fR \fIlen\fR\fB);\fR\fR .ad .br .sp .6 .RS 4n A macro that invokes the in-line routine associated with the \fBXDR\fR stream, \fIxdrs\fR. The routine returns a pointer to a contiguous piece of the stream's buffer; \fIlen\fR is the byte length of the desired buffer. Note: pointer is cast to \fBlong *\fR. .sp Warning: \fBxdr_inline()\fR may return \fINULL\fR (\fB0\fR) if it cannot allocate a contiguous piece of a buffer. Therefore the behavior may vary among stream instances; it exists for the sake of efficiency, and applications written for portability should not depend on this feature. .RE .sp .ne 2 .mk .na \fB\fBbool_t xdrrec_endofrecord(XDR *\fR\fIxdrs\fR\fB, int\fR \fIsendnow\fR\fB);\fR\fR .ad .br .sp .6 .RS 4n This routine can be invoked only on streams created by \fBxdrrec_create()\fR. See \fBxdr_create\fR(3C). The data in the output buffer is marked as a completed record, and the output buffer is optionally written out if \fIsendnow\fR is non-zero. This routine returns \fBTRUE\fR if it succeeds, \fBFALSE\fR otherwise. .RE .sp .ne 2 .mk .na \fB\fBbool_t xdrrec_eof(XDR *\fR\fIxdrs\fR\fB);\fR\fR .ad .br .sp .6 .RS 4n This routine can be invoked only on streams created by \fBxdrrec_create()\fR. After consuming the rest of the current record in the stream, this routine returns \fBTRUE\fR if there is no more data in the stream's input buffer. It returns \fBFALSE\fR if there is additional data in the stream's input buffer. .RE .sp .ne 2 .mk .na \fB\fBint xdrrec_readbytes(XDR *\fR\fIxdrs\fR\fB, caddr_t\fR\fI addr\fR\fB, uint_t\fR\fI nbytes\fR\fB);\fR\fR .ad .br .sp .6 .RS 4n This routine can be invoked only on streams created by \fBxdrrec_create()\fR. It attempts to read \fInbytes\fR bytes from the \fBXDR\fR stream into the buffer pointed to by \fIaddr\fR. Upon success this routine returns the number of bytes read. Upon failure, it returns \fB\(mi1\fR. A return value of \fB0\fR indicates an end of record. .RE .sp .ne 2 .mk .na \fB\fBbool_t xdrrec_skiprecord(XDR *\fR\fIxdrs\fR\fB);\fR\fR .ad .br .sp .6 .RS 4n This routine can be invoked only on streams created by \fBxdrrec_create()\fR. See \fBxdr_create\fR(3C). It tells the \fBXDR\fR implementation that the rest of the current record in the stream's input buffer should be discarded. This routine returns \fBTRUE\fR if it succeeds, \fBFALSE\fR otherwise. .RE .sp .ne 2 .mk .na \fB\fBbool_t xdr_setpos(XDR *\fR\fIxdrs\fR\fB, const uint_t\fR \fIpos\fR\fB);\fR\fR .ad .br .sp .6 .RS 4n A macro that invokes the set position routine associated with the \fBXDR\fR stream \fIxdrs\fR. The parameter \fIpos\fR is a position value obtained from \fBxdr_getpos()\fR. This routine returns \fBTRUE\fR if the \fBXDR\fR stream was repositioned, and \fBFALSE\fR otherwise. .sp Warning: it is difficult to reposition some types of \fBXDR\fR streams, so this routine may fail with one type of stream and succeed with another. Therefore, applications written for portability should not depend on this feature. .RE .sp .ne 2 .mk .na \fB\fBunsigned long xdr_sizeof(xdrproc_t\fR \fIfunc\fR\fB, void *\fR\fIdata\fR\fB);\fR\fR .ad .br .sp .6 .RS 4n This routine returns the number of bytes required to encode \fIdata\fR using the \fBXDR\fR filter function \fIfunc\fR, excluding potential overhead such as \fBRPC\fR headers or record markers. \fB0\fR is returned on error. This information might be used to select between transport protocols, or to determine the buffer size for various lower levels of \fBRPC\fR client and server creation routines, or to allocate storage when \fBXDR\fR is used outside of the \fBRPC\fR subsystem. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ MT-Level Safe .TE .sp .SH SEE ALSO .sp .LP \fBrpc\fR(3C), \fBmalloc\fR(3C), \fBxdr_complex\fR(3C), \fBxdr_create\fR(3C), \fBxdr_simple\fR(3C), \fBattributes\fR(7)