* libc/xdr/README: Correct grammatical errors.

* libc/include/rpc/types.h: Add public types used
	by RPC implementations.
	* libc/include/rpc/xdr.h: Add defines used by RPC
	implementations.
	* libc/xdr/Makefile.am: Eliminate automake warning.
	* libc/xdr/Makefile.in: Regenerate.
This commit is contained in:
Corinna Vinschen 2010-03-02 14:29:36 +00:00
parent 8acb1969b5
commit 180044b386
6 changed files with 49 additions and 21 deletions

View File

@ -1,3 +1,13 @@
2010-03-02 Charles Wilson <cygwin@cwilson.fastmail.fm>
* libc/xdr/README: Correct grammatical errors.
* libc/include/rpc/types.h: Add public types used
by RPC implementations.
* libc/include/rpc/xdr.h: Add defines used by RPC
implementations.
* libc/xdr/Makefile.am: Eliminate automake warning.
* libc/xdr/Makefile.in: Regenerate.
2010-03-02 Corinna Vinschen <corinna@vinschen.de>
* libc/xdr/Makefile.in: Regenerate.

View File

@ -52,6 +52,12 @@ typedef int64_t quad_t;
typedef int32_t bool_t;
typedef int32_t enum_t;
typedef u_int32_t rpcprog_t;
typedef u_int32_t rpcvers_t;
typedef u_int32_t rpcproc_t;
typedef u_int32_t rpcprot_t;
typedef u_int32_t rpcport_t;
typedef int32_t rpc_inline_t;
#ifndef NULL
# define NULL 0

View File

@ -223,6 +223,16 @@ typedef bool_t _EXFNPTR(xdrproc_t, (XDR *, ...));
(*(xdrs)->x_ops->x_destroy)(xdrs); \
} while (0)
/*
* Solaris strips the '_t' from these types -- not sure why.
* But, let's be compatible.
*/
#define xdr_rpcvers(xdrs, versp) xdr_u_int32(xdrs, versp)
#define xdr_rpcprog(xdrs, progp) xdr_u_int32(xdrs, progp)
#define xdr_rpcproc(xdrs, procp) xdr_u_int32(xdrs, procp)
#define xdr_rpcprot(xdrs, protp) xdr_u_int32(xdrs, protp)
#define xdr_rpcport(xdrs, portp) xdr_u_int32(xdrs, portp)
/*
* Support struct for discriminated unions.
* You create an array of xdrdiscrim structures, terminated with

View File

@ -17,7 +17,7 @@ GENERAL_SOURCES = \
STDIO_SOURCES = \
xdr_stdio.c
EXTRA_SOURCES = \
EXTRA_SRC = \
xdr_float_vax.c
## None of these functions are specified by EL/IX
@ -43,7 +43,7 @@ endif
endif
endif
EXTRA_DIST = README $(EXTRA_SOURCES)
EXTRA_DIST = README $(EXTRA_SRC)
libxdr_la_LDFLAGS = -Xcompiler -nostdlib

View File

@ -253,7 +253,7 @@ GENERAL_SOURCES = \
STDIO_SOURCES = \
xdr_stdio.c
EXTRA_SOURCES = \
EXTRA_SRC = \
xdr_float_vax.c
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@ELIX_LEVEL_4_FALSE@@HAVE_STDIO_DIR_FALSE@ELIX_SOURCES = $(GENERAL_SOURCES)
@ -262,7 +262,7 @@ EXTRA_SOURCES = \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@ELIX_SOURCES =
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@ELIX_SOURCES =
@ELIX_LEVEL_1_TRUE@ELIX_SOURCES =
EXTRA_DIST = README $(EXTRA_SOURCES)
EXTRA_DIST = README $(EXTRA_SRC)
libxdr_la_LDFLAGS = -Xcompiler -nostdlib
@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libxdr.la
@USE_LIBTOOL_TRUE@libxdr_la_SOURCES = dummy.c $(ELIX_SOURCES)

View File

@ -1,9 +1,10 @@
INTRODUCTION
======================
This directory contains a port of the Sun RPC code (derived
from the relicensed -- to 3-clause BSD -- implementation in
Fedora 11's libtirpc package version 0.1.10-7). It has been
adapted for newlib in the following ways:
This directory contains a port of eXternal Data Representation
(XDR) code from SunRPC (derived from the relicensed -- to
3-clause BSD -- implementation in Fedora 11's libtirpc package
version 0.1.10-7). It has been adapted for newlib in the
following ways:
1) xdr_* functions for fixed-width integral types have been
added, such as xdr_int32_t() and similar. The implementation
@ -58,7 +59,7 @@ xdr_float.c:
...
#elif defined(__vax__)
#include "xdr_float_vax.c"
+#else defined(__my_platform__)
+#elif defined(__my_platform__)
+#include "xdr_float_my_platform.c"
#endif
@ -121,7 +122,7 @@ The desired callback can be registered by calling:
The return value is the "old" function pointer, which may
be NULL.
However, neither the typedef or the registration function
However, neither the typedef nor the registration function
are declared in the public headers. Clients wishing to use
them must either declare the necessary symbols manually,
or #include "xdr_private.h". More on this point, below.
@ -143,13 +144,13 @@ For instance:
...
}
Will cause xdr-generated error messages to go to stderr.
will cause xdr-generated error messages to go to stderr.
It is not expected that end-user applications will make use
of this facility. Rather, it is expected that IF certain
*platforms* desire that these error messages be recorded,
rather expecting client apps print error messages as
necessary, then those platforms will, in their startup
instead of expecting client apps to print error messages as
necessary (*), then those platforms will, in their startup
objects or static initialization, direct these messages to
a logging facility, strace debug facility, etc.
@ -158,14 +159,15 @@ Therefore, the platform startup code, if part of newlib, can
from that file.
However, most newlib targets will probably be satisfied with
the default (silent) behavior. Note that the original Sun RPC,
as well as the glibc implementation, print these error messages
to stderr. Cygwin, for greater similarity to glibc, registers
an error message handler similar to the example above, within
its startup code.
the default (silent) behavior. Note that the original Sun RPC
implementation of XDR, as well as the glibc implementation,
print these error messages to stderr. Cygwin, for greater
similarity to glibc, registers an error message handler similar
to the example above, within its startup code.
(*) Client apps should already check for FALSE return values;
in this case they would then check errno and act appropriately.
(*) Client apps should already check for FALSE return values.
In this case when xdr function return FALSE, the client
app would then check errno and act appropriately.
LICENSING AND PEDIGREE
@ -185,7 +187,7 @@ As documented in the libtirpc rpm.spec file from Fedora 11:
So, in the XDR implementation from Fedora 11's libtirpc package,
after the modification above by Tom Callaway, each file carries
the 3-clause BSD license, and not the so-called "SunRPC" license.
the 3-clause BSD license and not the so-called "SunRPC" license.
It is from this version that the newlib implementation here was
derived, with the modifications described in the introduction,
above.