home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-24 | 80.6 KB | 2,031 lines |
- Newsgroups: comp.sources.unix
- From: mnl@dtro.e-technik.th-darmstadt.de (Michael Lipp)
- Subject: v26i182: mnl-rpc++-2.3.1 - a C++ interface to Sun RPC, Part02/03
- Sender: unix-sources-moderator@vix.com
- Approved: paul@vix.com
-
- Submitted-By: mnl@dtro.e-technik.th-darmstadt.de (Michael Lipp)
- Posting-Number: Volume 26, Issue 182
- Archive-Name: mnl-rpc++-2.3.1/part02
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 2 (of 3)."
- # Contents: COPYING StdHdrs/rpc/clnt.h StdHdrs/rpc/svc.h
- # StdHdrs/rpc/xdr.h rpc++/callback.h
- # Wrapped by vixie@gw.home.vix.com on Sun Apr 25 00:49:47 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'COPYING' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'COPYING'\"
- else
- echo shar: Extracting \"'COPYING'\" \(25265 characters\)
- sed "s/^X//" >'COPYING' <<'END_OF_FILE'
- X GNU LIBRARY GENERAL PUBLIC LICENSE
- X Version 2, June 1991
- X
- X Copyright (C) 1991 Free Software Foundation, Inc.
- X 675 Mass Ave, Cambridge, MA 02139, USA
- X Everyone is permitted to copy and distribute verbatim copies
- X of this license document, but changing it is not allowed.
- X
- X[This is the first released version of the library GPL. It is
- X numbered 2 because it goes with version 2 of the ordinary GPL.]
- X
- X Preamble
- X
- X The licenses for most software are designed to take away your
- freedom to share and change it. By contrast, the GNU General Public
- Licenses are intended to guarantee your freedom to share and change
- free software--to make sure the software is free for all its users.
- X
- X This license, the Library General Public License, applies to some
- specially designated Free Software Foundation software, and to any
- other libraries whose authors decide to use it. You can use it for
- your libraries, too.
- X
- X When we speak of free software, we are referring to freedom, not
- price. Our General Public Licenses are designed to make sure that you
- have the freedom to distribute copies of free software (and charge for
- this service if you wish), that you receive source code or can get it
- if you want it, that you can change the software or use pieces of it
- in new free programs; and that you know you can do these things.
- X
- X To protect your rights, we need to make restrictions that forbid
- anyone to deny you these rights or to ask you to surrender the rights.
- These restrictions translate to certain responsibilities for you if
- you distribute copies of the library, or if you modify it.
- X
- X For example, if you distribute copies of the library, whether gratis
- or for a fee, you must give the recipients all the rights that we gave
- you. You must make sure that they, too, receive or can get the source
- code. If you link a program with the library, you must provide
- complete object files to the recipients so that they can relink them
- with the library, after making changes to the library and recompiling
- it. And you must show them these terms so they know their rights.
- X
- X Our method of protecting your rights has two steps: (1) copyright
- the library, and (2) offer you this license which gives you legal
- permission to copy, distribute and/or modify the library.
- X
- X Also, for each distributor's protection, we want to make certain
- that everyone understands that there is no warranty for this free
- library. If the library is modified by someone else and passed on, we
- want its recipients to know that what they have is not the original
- version, so that any problems introduced by others will not reflect on
- the original authors' reputations.
- X
- X Finally, any free program is threatened constantly by software
- patents. We wish to avoid the danger that companies distributing free
- software will individually obtain patent licenses, thus in effect
- transforming the program into proprietary software. To prevent this,
- we have made it clear that any patent must be licensed for everyone's
- free use or not licensed at all.
- X
- X Most GNU software, including some libraries, is covered by the ordinary
- GNU General Public License, which was designed for utility programs. This
- license, the GNU Library General Public License, applies to certain
- designated libraries. This license is quite different from the ordinary
- one; be sure to read it in full, and don't assume that anything in it is
- the same as in the ordinary license.
- X
- X The reason we have a separate public license for some libraries is that
- they blur the distinction we usually make between modifying or adding to a
- program and simply using it. Linking a program with a library, without
- changing the library, is in some sense simply using the library, and is
- analogous to running a utility program or application program. However, in
- a textual and legal sense, the linked executable is a combined work, a
- derivative of the original library, and the ordinary General Public License
- treats it as such.
- X
- X Because of this blurred distinction, using the ordinary General
- Public License for libraries did not effectively promote software
- sharing, because most developers did not use the libraries. We
- concluded that weaker conditions might promote sharing better.
- X
- X However, unrestricted linking of non-free programs would deprive the
- users of those programs of all benefit from the free status of the
- libraries themselves. This Library General Public License is intended to
- permit developers of non-free programs to use free libraries, while
- preserving your freedom as a user of such programs to change the free
- libraries that are incorporated in them. (We have not seen how to achieve
- this as regards changes in header files, but we have achieved it as regards
- changes in the actual functions of the Library.) The hope is that this
- will lead to faster development of free libraries.
- X
- X The precise terms and conditions for copying, distribution and
- modification follow. Pay close attention to the difference between a
- X"work based on the library" and a "work that uses the library". The
- former contains code derived from the library, while the latter only
- works together with the library.
- X
- X Note that it is possible for a library to be covered by the ordinary
- General Public License rather than by this special one.
- X
- X GNU LIBRARY GENERAL PUBLIC LICENSE
- X TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- X
- X 0. This License Agreement applies to any software library which
- contains a notice placed by the copyright holder or other authorized
- party saying it may be distributed under the terms of this Library
- General Public License (also called "this License"). Each licensee is
- addressed as "you".
- X
- X A "library" means a collection of software functions and/or data
- prepared so as to be conveniently linked with application programs
- X(which use some of those functions and data) to form executables.
- X
- X The "Library", below, refers to any such software library or work
- which has been distributed under these terms. A "work based on the
- Library" means either the Library or any derivative work under
- copyright law: that is to say, a work containing the Library or a
- portion of it, either verbatim or with modifications and/or translated
- straightforwardly into another language. (Hereinafter, translation is
- included without limitation in the term "modification".)
- X
- X "Source code" for a work means the preferred form of the work for
- making modifications to it. For a library, complete source code means
- all the source code for all modules it contains, plus any associated
- interface definition files, plus the scripts used to control compilation
- and installation of the library.
- X
- X Activities other than copying, distribution and modification are not
- covered by this License; they are outside its scope. The act of
- running a program using the Library is not restricted, and output from
- such a program is covered only if its contents constitute a work based
- on the Library (independent of the use of the Library in a tool for
- writing it). Whether that is true depends on what the Library does
- and what the program that uses the Library does.
- X
- X 1. You may copy and distribute verbatim copies of the Library's
- complete source code as you receive it, in any medium, provided that
- you conspicuously and appropriately publish on each copy an
- appropriate copyright notice and disclaimer of warranty; keep intact
- all the notices that refer to this License and to the absence of any
- warranty; and distribute a copy of this License along with the
- Library.
- X
- X You may charge a fee for the physical act of transferring a copy,
- and you may at your option offer warranty protection in exchange for a
- fee.
- X
- X 2. You may modify your copy or copies of the Library or any portion
- of it, thus forming a work based on the Library, and copy and
- distribute such modifications or work under the terms of Section 1
- above, provided that you also meet all of these conditions:
- X
- X a) The modified work must itself be a software library.
- X
- X b) You must cause the files modified to carry prominent notices
- X stating that you changed the files and the date of any change.
- X
- X c) You must cause the whole of the work to be licensed at no
- X charge to all third parties under the terms of this License.
- X
- X d) If a facility in the modified Library refers to a function or a
- X table of data to be supplied by an application program that uses
- X the facility, other than as an argument passed when the facility
- X is invoked, then you must make a good faith effort to ensure that,
- X in the event an application does not supply such function or
- X table, the facility still operates, and performs whatever part of
- X its purpose remains meaningful.
- X
- X (For example, a function in a library to compute square roots has
- X a purpose that is entirely well-defined independent of the
- X application. Therefore, Subsection 2d requires that any
- X application-supplied function or table used by this function must
- X be optional: if the application does not supply it, the square
- X root function must still compute square roots.)
- X
- These requirements apply to the modified work as a whole. If
- identifiable sections of that work are not derived from the Library,
- and can be reasonably considered independent and separate works in
- themselves, then this License, and its terms, do not apply to those
- sections when you distribute them as separate works. But when you
- distribute the same sections as part of a whole which is a work based
- on the Library, the distribution of the whole must be on the terms of
- this License, whose permissions for other licensees extend to the
- entire whole, and thus to each and every part regardless of who wrote
- it.
- X
- Thus, it is not the intent of this section to claim rights or contest
- your rights to work written entirely by you; rather, the intent is to
- exercise the right to control the distribution of derivative or
- collective works based on the Library.
- X
- In addition, mere aggregation of another work not based on the Library
- with the Library (or with a work based on the Library) on a volume of
- a storage or distribution medium does not bring the other work under
- the scope of this License.
- X
- X 3. You may opt to apply the terms of the ordinary GNU General Public
- License instead of this License to a given copy of the Library. To do
- this, you must alter all the notices that refer to this License, so
- that they refer to the ordinary GNU General Public License, version 2,
- instead of to this License. (If a newer version than version 2 of the
- ordinary GNU General Public License has appeared, then you can specify
- that version instead if you wish.) Do not make any other change in
- these notices.
- X
- X Once this change is made in a given copy, it is irreversible for
- that copy, so the ordinary GNU General Public License applies to all
- subsequent copies and derivative works made from that copy.
- X
- X This option is useful when you wish to copy part of the code of
- the Library into a program that is not a library.
- X
- X 4. You may copy and distribute the Library (or a portion or
- derivative of it, under Section 2) in object code or executable form
- under the terms of Sections 1 and 2 above provided that you accompany
- it with the complete corresponding machine-readable source code, which
- must be distributed under the terms of Sections 1 and 2 above on a
- medium customarily used for software interchange.
- X
- X If distribution of object code is made by offering access to copy
- from a designated place, then offering equivalent access to copy the
- source code from the same place satisfies the requirement to
- distribute the source code, even though third parties are not
- compelled to copy the source along with the object code.
- X
- X 5. A program that contains no derivative of any portion of the
- Library, but is designed to work with the Library by being compiled or
- linked with it, is called a "work that uses the Library". Such a
- work, in isolation, is not a derivative work of the Library, and
- therefore falls outside the scope of this License.
- X
- X However, linking a "work that uses the Library" with the Library
- creates an executable that is a derivative of the Library (because it
- contains portions of the Library), rather than a "work that uses the
- library". The executable is therefore covered by this License.
- Section 6 states terms for distribution of such executables.
- X
- X When a "work that uses the Library" uses material from a header file
- that is part of the Library, the object code for the work may be a
- derivative work of the Library even though the source code is not.
- Whether this is true is especially significant if the work can be
- linked without the Library, or if the work is itself a library. The
- threshold for this to be true is not precisely defined by law.
- X
- X If such an object file uses only numerical parameters, data
- structure layouts and accessors, and small macros and small inline
- functions (ten lines or less in length), then the use of the object
- file is unrestricted, regardless of whether it is legally a derivative
- work. (Executables containing this object code plus portions of the
- Library will still fall under Section 6.)
- X
- X Otherwise, if the work is a derivative of the Library, you may
- distribute the object code for the work under the terms of Section 6.
- Any executables containing that work also fall under Section 6,
- whether or not they are linked directly with the Library itself.
- X
- X 6. As an exception to the Sections above, you may also compile or
- link a "work that uses the Library" with the Library to produce a
- work containing portions of the Library, and distribute that work
- under terms of your choice, provided that the terms permit
- modification of the work for the customer's own use and reverse
- engineering for debugging such modifications.
- X
- X You must give prominent notice with each copy of the work that the
- Library is used in it and that the Library and its use are covered by
- this License. You must supply a copy of this License. If the work
- during execution displays copyright notices, you must include the
- copyright notice for the Library among them, as well as a reference
- directing the user to the copy of this License. Also, you must do one
- of these things:
- X
- X a) Accompany the work with the complete corresponding
- X machine-readable source code for the Library including whatever
- X changes were used in the work (which must be distributed under
- X Sections 1 and 2 above); and, if the work is an executable linked
- X with the Library, with the complete machine-readable "work that
- X uses the Library", as object code and/or source code, so that the
- X user can modify the Library and then relink to produce a modified
- X executable containing the modified Library. (It is understood
- X that the user who changes the contents of definitions files in the
- X Library will not necessarily be able to recompile the application
- X to use the modified definitions.)
- X
- X b) Accompany the work with a written offer, valid for at
- X least three years, to give the same user the materials
- X specified in Subsection 6a, above, for a charge no more
- X than the cost of performing this distribution.
- X
- X c) If distribution of the work is made by offering access to copy
- X from a designated place, offer equivalent access to copy the above
- X specified materials from the same place.
- X
- X d) Verify that the user has already received a copy of these
- X materials or that you have already sent this user a copy.
- X
- X For an executable, the required form of the "work that uses the
- Library" must include any data and utility programs needed for
- reproducing the executable from it. However, as a special exception,
- the source code distributed need not include anything that is normally
- distributed (in either source or binary form) with the major
- components (compiler, kernel, and so on) of the operating system on
- which the executable runs, unless that component itself accompanies
- the executable.
- X
- X It may happen that this requirement contradicts the license
- restrictions of other proprietary libraries that do not normally
- accompany the operating system. Such a contradiction means you cannot
- use both them and the Library together in an executable that you
- distribute.
- X
- X 7. You may place library facilities that are a work based on the
- Library side-by-side in a single library together with other library
- facilities not covered by this License, and distribute such a combined
- library, provided that the separate distribution of the work based on
- the Library and of the other library facilities is otherwise
- permitted, and provided that you do these two things:
- X
- X a) Accompany the combined library with a copy of the same work
- X based on the Library, uncombined with any other library
- X facilities. This must be distributed under the terms of the
- X Sections above.
- X
- X b) Give prominent notice with the combined library of the fact
- X that part of it is a work based on the Library, and explaining
- X where to find the accompanying uncombined form of the same work.
- X
- X 8. You may not copy, modify, sublicense, link with, or distribute
- the Library except as expressly provided under this License. Any
- attempt otherwise to copy, modify, sublicense, link with, or
- distribute the Library is void, and will automatically terminate your
- rights under this License. However, parties who have received copies,
- or rights, from you under this License will not have their licenses
- terminated so long as such parties remain in full compliance.
- X
- X 9. You are not required to accept this License, since you have not
- signed it. However, nothing else grants you permission to modify or
- distribute the Library or its derivative works. These actions are
- prohibited by law if you do not accept this License. Therefore, by
- modifying or distributing the Library (or any work based on the
- Library), you indicate your acceptance of this License to do so, and
- all its terms and conditions for copying, distributing or modifying
- the Library or works based on it.
- X
- X 10. Each time you redistribute the Library (or any work based on the
- Library), the recipient automatically receives a license from the
- original licensor to copy, distribute, link with or modify the Library
- subject to these terms and conditions. You may not impose any further
- restrictions on the recipients' exercise of the rights granted herein.
- You are not responsible for enforcing compliance by third parties to
- this License.
- X
- X 11. If, as a consequence of a court judgment or allegation of patent
- infringement or for any other reason (not limited to patent issues),
- conditions are imposed on you (whether by court order, agreement or
- otherwise) that contradict the conditions of this License, they do not
- excuse you from the conditions of this License. If you cannot
- distribute so as to satisfy simultaneously your obligations under this
- License and any other pertinent obligations, then as a consequence you
- may not distribute the Library at all. For example, if a patent
- license would not permit royalty-free redistribution of the Library by
- all those who receive copies directly or indirectly through you, then
- the only way you could satisfy both it and this License would be to
- refrain entirely from distribution of the Library.
- X
- If any portion of this section is held invalid or unenforceable under any
- particular circumstance, the balance of the section is intended to apply,
- and the section as a whole is intended to apply in other circumstances.
- X
- It is not the purpose of this section to induce you to infringe any
- patents or other property right claims or to contest validity of any
- such claims; this section has the sole purpose of protecting the
- integrity of the free software distribution system which is
- implemented by public license practices. Many people have made
- generous contributions to the wide range of software distributed
- through that system in reliance on consistent application of that
- system; it is up to the author/donor to decide if he or she is willing
- to distribute software through any other system and a licensee cannot
- impose that choice.
- X
- This section is intended to make thoroughly clear what is believed to
- be a consequence of the rest of this License.
- X
- X 12. If the distribution and/or use of the Library is restricted in
- certain countries either by patents or by copyrighted interfaces, the
- original copyright holder who places the Library under this License may add
- an explicit geographical distribution limitation excluding those countries,
- so that distribution is permitted only in or among countries not thus
- excluded. In such case, this License incorporates the limitation as if
- written in the body of this License.
- X
- X 13. The Free Software Foundation may publish revised and/or new
- versions of the Library General Public License from time to time.
- Such new versions will be similar in spirit to the present version,
- but may differ in detail to address new problems or concerns.
- X
- XEach version is given a distinguishing version number. If the Library
- specifies a version number of this License which applies to it and
- X"any later version", you have the option of following the terms and
- conditions either of that version or of any later version published by
- the Free Software Foundation. If the Library does not specify a
- license version number, you may choose any version ever published by
- the Free Software Foundation.
- X
- X 14. If you wish to incorporate parts of the Library into other free
- programs whose distribution conditions are incompatible with these,
- write to the author to ask for permission. For software which is
- copyrighted by the Free Software Foundation, write to the Free
- Software Foundation; we sometimes make exceptions for this. Our
- decision will be guided by the two goals of preserving the free status
- of all derivatives of our free software and of promoting the sharing
- and reuse of software generally.
- X
- X NO WARRANTY
- X
- X 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
- WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
- XEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
- OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
- KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
- LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
- THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
- X
- X 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
- WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
- AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
- XFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
- CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
- LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
- RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
- XFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
- SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
- DAMAGES.
- X
- X END OF TERMS AND CONDITIONS
- X
- X Appendix: How to Apply These Terms to Your New Libraries
- X
- X If you develop a new library, and you want it to be of the greatest
- possible use to the public, we recommend making it free software that
- everyone can redistribute and change. You can do so by permitting
- redistribution under these terms (or, alternatively, under the terms of the
- ordinary General Public License).
- X
- X To apply these terms, attach the following notices to the library. It is
- safest to attach them to the start of each source file to most effectively
- convey the exclusion of warranty; and each file should have at least the
- X"copyright" line and a pointer to where the full notice is found.
- X
- X <one line to give the library's name and a brief idea of what it does.>
- X Copyright (C) <year> <name of author>
- X
- X This library is free software; you can redistribute it and/or
- X modify it under the terms of the GNU Library General Public
- X License as published by the Free Software Foundation; either
- X version 2 of the License, or (at your option) any later version.
- X
- X This library is distributed in the hope that it will be useful,
- X but WITHOUT ANY WARRANTY; without even the implied warranty of
- X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- X Library General Public License for more details.
- X
- X You should have received a copy of the GNU Library General Public
- X License along with this library; if not, write to the Free
- X Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- X
- Also add information on how to contact you by electronic and paper mail.
- X
- You should also get your employer (if you work as a programmer) or your
- school, if any, to sign a "copyright disclaimer" for the library, if
- necessary. Here is a sample; alter the names:
- X
- X Yoyodyne, Inc., hereby disclaims all copyright interest in the
- X library `Frob' (a library for tweaking knobs) written by James Random Hacker.
- X
- X <signature of Ty Coon>, 1 April 1990
- X Ty Coon, President of Vice
- X
- That's all there is to it!
- END_OF_FILE
- if test 25265 -ne `wc -c <'COPYING'`; then
- echo shar: \"'COPYING'\" unpacked with wrong size!
- fi
- # end of 'COPYING'
- fi
- if test -f 'StdHdrs/rpc/clnt.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'StdHdrs/rpc/clnt.h'\"
- else
- echo shar: Extracting \"'StdHdrs/rpc/clnt.h'\" \(9383 characters\)
- sed "s/^X//" >'StdHdrs/rpc/clnt.h' <<'END_OF_FILE'
- X/* @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.31 88/02/08 SMI*/
- X/*
- X * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- X * unrestricted use provided that this legend is included on all tape
- X * media and as a part of the software program in whole or part. Users
- X * may copy or modify Sun RPC without charge, but are not authorized
- X * to license or distribute it to anyone else except as part of a product or
- X * program developed by the user.
- X *
- X * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- X * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- X * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- X *
- X * Sun RPC is provided with no support and without any obligation on the
- X * part of Sun Microsystems, Inc. to assist in its use, correction,
- X * modification or enhancement.
- X *
- X * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- X * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- X * OR ANY PART THEREOF.
- X *
- X * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- X * or profits or other special, indirect and consequential damages, even if
- X * Sun has been advised of the possibility of such damages.
- X *
- X * Sun Microsystems, Inc.
- X * 2550 Garcia Avenue
- X * Mountain View, California 94043
- X */
- X
- X/*
- X * clnt.h - Client side remote procedure call interface.
- X *
- X * Copyright (C) 1984, Sun Microsystems, Inc.
- X */
- X
- X#ifndef _rpc_clnt_h
- X#define _rpc_clnt_h
- X
- X/*
- X * Rpc calls return an enum clnt_stat. This should be looked at more,
- X * since each implementation is required to live with this (implementation
- X * independent) list of errors.
- X */
- enum clnt_stat {
- X RPC_SUCCESS=0, /* call succeeded */
- X /*
- X * local errors
- X */
- X RPC_CANTENCODEARGS=1, /* can't encode arguments */
- X RPC_CANTDECODERES=2, /* can't decode results */
- X RPC_CANTSEND=3, /* failure in sending call */
- X RPC_CANTRECV=4, /* failure in receiving result */
- X RPC_TIMEDOUT=5, /* call timed out */
- X /*
- X * remote errors
- X */
- X RPC_VERSMISMATCH=6, /* rpc versions not compatible */
- X RPC_AUTHERROR=7, /* authentication error */
- X RPC_PROGUNAVAIL=8, /* program not available */
- X RPC_PROGVERSMISMATCH=9, /* program version mismatched */
- X RPC_PROCUNAVAIL=10, /* procedure unavailable */
- X RPC_CANTDECODEARGS=11, /* decode arguments error */
- X RPC_SYSTEMERROR=12, /* generic "other problem" */
- X
- X /*
- X * callrpc & clnt_create errors
- X */
- X RPC_UNKNOWNHOST=13, /* unknown host name */
- X RPC_UNKNOWNPROTO=17, /* unkown protocol */
- X
- X /*
- X * _ create errors
- X */
- X RPC_PMAPFAILURE=14, /* the pmapper failed in its call */
- X RPC_PROGNOTREGISTERED=15, /* remote program is not registered */
- X /*
- X * unspecified error
- X */
- X RPC_FAILED=16
- X};
- X
- X
- X/*
- X * Error info.
- X */
- struct rpc_err {
- X enum clnt_stat re_status;
- X union {
- X int RE_errno; /* realated system error */
- X enum auth_stat RE_why; /* why the auth error occurred */
- X struct {
- X u_long low; /* lowest verion supported */
- X u_long high; /* highest verion supported */
- X } RE_vers;
- X struct { /* maybe meaningful if RPC_FAILED */
- X long s1;
- X long s2;
- X } RE_lb; /* life boot & debugging only */
- X } ru;
- X#define re_errno ru.RE_errno
- X#define re_why ru.RE_why
- X#define re_vers ru.RE_vers
- X#define re_lb ru.RE_lb
- X};
- X
- X
- X/*
- X * Client rpc handle.
- X * Created by individual implementations, see e.g. rpc_udp.c.
- X * Client is responsible for initializing auth, see e.g. auth_none.c.
- X */
- typedef struct {
- X AUTH *cl_auth; /* authenticator */
- X struct clnt_ops {
- X enum clnt_stat (*cl_call)(DOTDOTDOT); /* call remote procedure */
- X void (*cl_abort)(DOTDOTDOT); /* abort a call */
- X void (*cl_geterr)(DOTDOTDOT); /* get specific error code */
- X bool_t (*cl_freeres)(DOTDOTDOT); /* frees results */
- X void (*cl_destroy)(DOTDOTDOT);/* destroy this structure */
- X bool_t (*cl_control)(DOTDOTDOT);/* the ioctl() of rpc */
- X } *cl_ops;
- X caddr_t cl_private; /* private stuff */
- X} CLIENT;
- X
- X
- X/*
- X * client side rpc interface ops
- X *
- X * Parameter types are:
- X *
- X */
- X
- X/*
- X * enum clnt_stat
- X * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
- X * CLIENT *rh;
- X * u_long proc;
- X * xdrproc_t xargs;
- X * caddr_t argsp;
- X * xdrproc_t xres;
- X * caddr_t resp;
- X * struct timeval timeout;
- X */
- X#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
- X ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
- X#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
- X ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
- X
- X/*
- X * void
- X * CLNT_ABORT(rh);
- X * CLIENT *rh;
- X */
- X#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh))
- X#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh))
- X
- X/*
- X * struct rpc_err
- X * CLNT_GETERR(rh);
- X * CLIENT *rh;
- X */
- X#define CLNT_GETERR(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
- X#define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
- X
- X
- X/*
- X * bool_t
- X * CLNT_FREERES(rh, xres, resp);
- X * CLIENT *rh;
- X * xdrproc_t xres;
- X * caddr_t resp;
- X */
- X#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
- X#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
- X
- X/*
- X * bool_t
- X * CLNT_CONTROL(cl, request, info)
- X * CLIENT *cl;
- X * u_int request;
- X * char *info;
- X */
- X#define CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
- X#define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
- X
- X/*
- X * control operations that apply to both udp and tcp transports
- X */
- X#define CLSET_TIMEOUT 1 /* set timeout (timeval) */
- X#define CLGET_TIMEOUT 2 /* get timeout (timeval) */
- X#define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */
- X/*
- X * udp only control operations
- X */
- X#define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */
- X#define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */
- X
- X/*
- X * void
- X * CLNT_DESTROY(rh);
- X * CLIENT *rh;
- X */
- X#define CLNT_DESTROY(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
- X#define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
- X
- X
- X/*
- X * RPCTEST is a test program which is accessable on every rpc
- X * transport/port. It is used for testing, performance evaluation,
- X * and network administration.
- X */
- X
- X#define RPCTEST_PROGRAM ((u_long)1)
- X#define RPCTEST_VERSION ((u_long)1)
- X#define RPCTEST_NULL_PROC ((u_long)2)
- X#define RPCTEST_NULL_BATCH_PROC ((u_long)3)
- X
- X/*
- X * By convention, procedure 0 takes null arguments and returns them
- X */
- X
- X#define NULLPROC ((u_long)0)
- X
- X/*
- X * Below are the client handle creation routines for the various
- X * implementations of client side rpc. They can return NULL if a
- X * creation failure occurs.
- X */
- X
- X/*
- X * Memory based rpc (for speed check and testing)
- X * CLIENT *
- X * clntraw_create(prog, vers)
- X * u_long prog;
- X * u_long vers;
- X */
- XEXTERN_FUNCTION(CLIENT *clntraw_create, (u_long prog, u_long vers));
- X
- X
- X/*
- X * Generic client creation routine. Supported protocols are "udp" and "tcp"
- X */
- XEXTERN_FUNCTION(CLIENT *
- clnt_create, (char* host, u_long prog, u_long vers, char* prot));
- X/*
- X char *host; -- hostname
- X u_long prog; -- program number
- X u_long vers; -- version number
- X char *prot; -- protocol
- X*/
- X
- X
- X
- X
- X/*
- X * TCP based rpc
- X * CLIENT *
- X * clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
- X * struct sockaddr_in *raddr;
- X * u_long prog;
- X * u_long version;
- X * register int *sockp;
- X * u_int sendsz;
- X * u_int recvsz;
- X */
- XEXTERN_FUNCTION(CLIENT *clnttcp_create, (struct sockaddr_in *raddr,
- X u_long prog,
- X u_long version,
- X register int *sockp,
- X u_int sendsz,
- X u_int recvsz));
- X
- X/*
- X * UDP based rpc.
- X * CLIENT *
- X * clntudp_create(raddr, program, version, wait, sockp)
- X * struct sockaddr_in *raddr;
- X * u_long program;
- X * u_long version;
- X * struct timeval wait;
- X * int *sockp;
- X *
- X * Same as above, but you specify max packet sizes.
- X * CLIENT *
- X * clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
- X * struct sockaddr_in *raddr;
- X * u_long program;
- X * u_long version;
- X * struct timeval wait;
- X * int *sockp;
- X * u_int sendsz;
- X * u_int recvsz;
- X */
- XEXTERN_FUNCTION(CLIENT *clntudp_create, (struct sockaddr_in *raddr,
- X u_long program,
- X u_long version,
- X struct timeval wait,
- X int *sockp));
- XEXTERN_FUNCTION(CLIENT *clntudp_bufcreate, (struct sockaddr_in *raddr,
- X u_long program,
- X u_long version,
- X struct timeval wait,
- X int *sockp,
- X u_int sendsz,
- X u_int recvsz));
- X
- X/*
- X * Print why creation failed
- X */
- XEXTERN_FUNCTION(void clnt_pcreateerror, (char *msg)); /* stderr */
- XEXTERN_FUNCTION(char *clnt_spcreateerror, (char *msg)); /* string */
- X
- X/*
- X * Like clnt_perror(), but is more verbose in its output
- X */
- XEXTERN_FUNCTION(void clnt_perrno, (enum clnt_stat num)); /* stderr */
- X
- X/*
- X * Print an English error message, given the client error code
- X */
- XEXTERN_FUNCTION(void clnt_perror, (CLIENT *clnt, char *msg)); /* stderr */
- XEXTERN_FUNCTION(char *clnt_sperror, (CLIENT *clnt, char *msg)); /* string */
- X
- X/*
- X * If a creation fails, the following allows the user to figure out why.
- X */
- struct rpc_createerr {
- X enum clnt_stat cf_stat;
- X struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
- X};
- X
- extern struct rpc_createerr rpc_createerr;
- X
- X
- X
- X/*
- X * Copy error message to buffer.
- X */
- XEXTERN_FUNCTION(char *clnt_sperrno, (enum clnt_stat num)); /* string */
- X
- X
- X
- X#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */
- X#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */
- X
- X#endif /*!_rpc_clnt_h*/
- END_OF_FILE
- if test 9383 -ne `wc -c <'StdHdrs/rpc/clnt.h'`; then
- echo shar: \"'StdHdrs/rpc/clnt.h'\" unpacked with wrong size!
- fi
- # end of 'StdHdrs/rpc/clnt.h'
- fi
- if test -f 'StdHdrs/rpc/svc.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'StdHdrs/rpc/svc.h'\"
- else
- echo shar: Extracting \"'StdHdrs/rpc/svc.h'\" \(9566 characters\)
- sed "s/^X//" >'StdHdrs/rpc/svc.h' <<'END_OF_FILE'
- X/* @(#)svc.h 2.2 88/07/29 4.0 RPCSRC; from 1.20 88/02/08 SMI */
- X/*
- X * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- X * unrestricted use provided that this legend is included on all tape
- X * media and as a part of the software program in whole or part. Users
- X * may copy or modify Sun RPC without charge, but are not authorized
- X * to license or distribute it to anyone else except as part of a product or
- X * program developed by the user.
- X *
- X * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- X * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- X * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- X *
- X * Sun RPC is provided with no support and without any obligation on the
- X * part of Sun Microsystems, Inc. to assist in its use, correction,
- X * modification or enhancement.
- X *
- X * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- X * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- X * OR ANY PART THEREOF.
- X *
- X * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- X * or profits or other special, indirect and consequential damages, even if
- X * Sun has been advised of the possibility of such damages.
- X *
- X * Sun Microsystems, Inc.
- X * 2550 Garcia Avenue
- X * Mountain View, California 94043
- X */
- X
- X/*
- X * svc.h, Server-side remote procedure call interface.
- X *
- X * Copyright (C) 1984, Sun Microsystems, Inc.
- X */
- X
- X#ifndef _rpc_svc_h
- X#define _rpc_svc_h
- X
- X#include <rpc/pmap_clnt.h>
- X
- X/*
- X * This interface must manage two items concerning remote procedure calling:
- X *
- X * 1) An arbitrary number of transport connections upon which rpc requests
- X * are received. The two most notable transports are TCP and UDP; they are
- X * created and registered by routines in svc_tcp.c and svc_udp.c, respectively;
- X * they in turn call xprt_register and xprt_unregister.
- X *
- X * 2) An arbitrary number of locally registered services. Services are
- X * described by the following four data: program number, version number,
- X * "service dispatch" function, a transport handle, and a boolean that
- X * indicates whether or not the exported program should be registered with a
- X * local binder service; if true the program's number and version and the
- X * port number from the transport handle are registered with the binder.
- X * These data are registered with the rpc svc system via svc_register.
- X *
- X * A service's dispatch function is called whenever an rpc request comes in
- X * on a transport. The request's program and version numbers must match
- X * those of the registered service. The dispatch function is passed two
- X * parameters, struct svc_req * and SVCXPRT *, defined below.
- X */
- X
- enum xprt_stat {
- X XPRT_DIED,
- X XPRT_MOREREQS,
- X XPRT_IDLE
- X};
- X
- X/*
- X * Server side transport handle
- X */
- typedef struct {
- X int xp_sock;
- X u_short xp_port; /* associated port number */
- X struct xp_ops {
- X bool_t (*xp_recv)(DOTDOTDOT); /* receive incomming requests */
- X enum xprt_stat (*xp_stat)(DOTDOTDOT); /* get transport status */
- X bool_t (*xp_getargs)(DOTDOTDOT); /* get arguments */
- X bool_t (*xp_reply)(DOTDOTDOT); /* send reply */
- X bool_t (*xp_freeargs)(DOTDOTDOT);/* free mem allocated for args */
- X void (*xp_destroy)(DOTDOTDOT); /* destroy this struct */
- X } *xp_ops;
- X int xp_addrlen; /* length of remote address */
- X struct sockaddr_in xp_raddr; /* remote address */
- X struct opaque_auth xp_verf; /* raw response verifier */
- X caddr_t xp_p1; /* private */
- X caddr_t xp_p2; /* private */
- X} SVCXPRT;
- X
- X/*
- X * Approved way of getting address of caller
- X */
- X#define svc_getcaller(x) (&(x)->xp_raddr)
- X
- X/*
- X * Operations defined on an SVCXPRT handle
- X *
- X * SVCXPRT *xprt;
- X * struct rpc_msg *msg;
- X * xdrproc_t xargs;
- X * caddr_t argsp;
- X */
- X#define SVC_RECV(xprt, msg) \
- X (*(xprt)->xp_ops->xp_recv)((xprt), (msg))
- X#define svc_recv(xprt, msg) \
- X (*(xprt)->xp_ops->xp_recv)((xprt), (msg))
- X
- X#define SVC_STAT(xprt) \
- X (*(xprt)->xp_ops->xp_stat)(xprt)
- X#define svc_stat(xprt) \
- X (*(xprt)->xp_ops->xp_stat)(xprt)
- X
- X#define SVC_GETARGS(xprt, xargs, argsp) \
- X (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
- X#define svc_getargs(xprt, xargs, argsp) \
- X (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
- X
- X#define SVC_REPLY(xprt, msg) \
- X (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
- X#define svc_reply(xprt, msg) \
- X (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
- X
- X#define SVC_FREEARGS(xprt, xargs, argsp) \
- X (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
- X#define svc_freeargs(xprt, xargs, argsp) \
- X (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
- X
- X#define SVC_DESTROY(xprt) \
- X (*(xprt)->xp_ops->xp_destroy)(xprt)
- X#define svc_destroy(xprt) \
- X (*(xprt)->xp_ops->xp_destroy)(xprt)
- X
- X
- X/*
- X * Service request
- X */
- struct svc_req {
- X u_long rq_prog; /* service program number */
- X u_long rq_vers; /* service protocol version */
- X u_long rq_proc; /* the desired procedure */
- X struct opaque_auth rq_cred; /* raw creds from the wire */
- X caddr_t rq_clntcred; /* read only cooked cred */
- X SVCXPRT *rq_xprt; /* associated transport */
- X};
- X
- X
- X/*
- X * Service registration
- X *
- X * svc_register(xprt, prog, vers, dispatch, protocol)
- X * SVCXPRT *xprt;
- X * u_long prog;
- X * u_long vers;
- X * void (*dispatch)();
- X * int protocol; like TCP or UDP, zero means do not register
- X */
- XEXTERN_FUNCTION(bool_t svc_register, (SVCXPRT *xprt, u_long prog, u_long vers,
- X void (*dispatch)(struct svc_req *,
- X SVCXPRT*),
- X int protocol));
- X
- X/*
- X * Service un-registration
- X *
- X * svc_unregister(prog, vers)
- X * u_long prog;
- X * u_long vers;
- X */
- XEXTERN_FUNCTION(void* svc_unregister, (u_long prog, u_long vers));
- X
- X/*
- X * Transport registration.
- X *
- X * xprt_register(xprt)
- X * SVCXPRT *xprt;
- X */
- XEXTERN_FUNCTION(void xprt_register, (SVCXPRT* xprt));
- X
- X/*
- X * Transport un-register
- X *
- X * xprt_unregister(xprt)
- X * SVCXPRT *xprt;
- X */
- XEXTERN_FUNCTION(void xprt_unregister, (SVCXPRT* xprt));
- X
- X
- X
- X
- X/*
- X * When the service routine is called, it must first check to see if it
- X * knows about the procedure; if not, it should call svcerr_noproc
- X * and return. If so, it should deserialize its arguments via
- X * SVC_GETARGS (defined above). If the deserialization does not work,
- X * svcerr_decode should be called followed by a return. Successful
- X * decoding of the arguments should be followed the execution of the
- X * procedure's code and a call to svc_sendreply.
- X *
- X * Also, if the service refuses to execute the procedure due to too-
- X * weak authentication parameters, svcerr_weakauth should be called.
- X * Note: do not confuse access-control failure with weak authentication!
- X *
- X * NB: In pure implementations of rpc, the caller always waits for a reply
- X * msg. This message is sent when svc_sendreply is called.
- X * Therefore pure service implementations should always call
- X * svc_sendreply even if the function logically returns void; use
- X * xdr.h - xdr_void for the xdr routine. HOWEVER, tcp based rpc allows
- X * for the abuse of pure rpc via batched calling or pipelining. In the
- X * case of a batched call, svc_sendreply should NOT be called since
- X * this would send a return message, which is what batching tries to avoid.
- X * It is the service/protocol writer's responsibility to know which calls are
- X * batched and which are not. Warning: responding to batch calls may
- X * deadlock the caller and server processes!
- X */
- X
- XEXTERN_FUNCTION(bool_t svc_sendreply, (SVCXPRT *xprt,xdrproc_t outproc,
- X char *out));
- XEXTERN_FUNCTION(void svcerr_decode, (SVCXPRT *xprt));
- XEXTERN_FUNCTION(void svcerr_weakauth, (SVCXPRT *xprt));
- XEXTERN_FUNCTION(void svcerr_noproc, (SVCXPRT *xprt));
- XEXTERN_FUNCTION(void svcerr_progvers, (SVCXPRT *xprt));
- XEXTERN_FUNCTION(void svcerr_auth, (SVCXPRT *xprt, enum auth_stat why));
- XEXTERN_FUNCTION(void svcerr_noprog, (SVCXPRT *xprt));
- XEXTERN_FUNCTION(void svcerr_systemerr, (SVCXPRT *xprt));
- X
- X/*
- X * Lowest level dispatching -OR- who owns this process anyway.
- X * Somebody has to wait for incoming requests and then call the correct
- X * service routine. The routine svc_run does infinite waiting; i.e.,
- X * svc_run never returns.
- X * Since another (co-existant) package may wish to selectively wait for
- X * incoming calls or other events outside of the rpc architecture, the
- X * routine svc_getreq is provided. It must be passed readfds, the
- X * "in-place" results of a select system call (see select, section 2).
- X */
- X
- X/*
- X * Global keeper of rpc service descriptors in use
- X * dynamic; must be inspected before each call to select
- X */
- X#ifdef FD_SETSIZE
- extern fd_set svc_fdset;
- X#define svc_fds svc_fdset.fds_bits[0] /* compatibility */
- X#else
- extern int svc_fds;
- X#endif /* def FD_SETSIZE */
- X
- X/*
- X * a small program implemented by the svc_rpc implementation itself;
- X * also see clnt.h for protocol numbers.
- X */
- XEXTERN_FUNCTION(void rpctest_service, ());
- XEXTERN_FUNCTION(void svc_getreq, (int rdfds));
- XEXTERN_FUNCTION(void svc_getreqset, (fd_set *rdfdsp)); /* takes fdset instead of int */
- XEXTERN_FUNCTION(void svc_run, ()); /* never returns */
- X
- X/*
- X * Socket to use on svcxxx_create call to get default socket
- X */
- X#define RPC_ANYSOCK -1
- X
- X/*
- X * These are the existing service side transport implementations
- X */
- X
- X/*
- X * Memory based rpc for testing and timing.
- X */
- XEXTERN_FUNCTION(SVCXPRT *svcraw_create, ());
- X
- X/*
- X * Udp based rpc.
- X */
- XEXTERN_FUNCTION(SVCXPRT *svcudp_create, (int sock));
- XEXTERN_FUNCTION(SVCXPRT *svcudp_bufcreate, (int sock, u_int sendsz,
- X u_int recvsz));
- X
- X/*
- X * Tcp based rpc.
- X */
- XEXTERN_FUNCTION(SVCXPRT *svctcp_create, (int fd, u_int sendsz, u_int recvsz));
- X
- X
- X
- X#endif /*!_rpc_svc_h*/
- END_OF_FILE
- if test 9566 -ne `wc -c <'StdHdrs/rpc/svc.h'`; then
- echo shar: \"'StdHdrs/rpc/svc.h'\" unpacked with wrong size!
- fi
- # end of 'StdHdrs/rpc/svc.h'
- fi
- if test -f 'StdHdrs/rpc/xdr.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'StdHdrs/rpc/xdr.h'\"
- else
- echo shar: Extracting \"'StdHdrs/rpc/xdr.h'\" \(10878 characters\)
- sed "s/^X//" >'StdHdrs/rpc/xdr.h' <<'END_OF_FILE'
- X/* @(#)xdr.h 2.2 88/07/29 4.0 RPCSRC */
- X/*
- X * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- X * unrestricted use provided that this legend is included on all tape
- X * media and as a part of the software program in whole or part. Users
- X * may copy or modify Sun RPC without charge, but are not authorized
- X * to license or distribute it to anyone else except as part of a product or
- X * program developed by the user.
- X *
- X * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- X * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- X * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- X *
- X * Sun RPC is provided with no support and without any obligation on the
- X * part of Sun Microsystems, Inc. to assist in its use, correction,
- X * modification or enhancement.
- X *
- X * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- X * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- X * OR ANY PART THEREOF.
- X *
- X * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- X * or profits or other special, indirect and consequential damages, even if
- X * Sun has been advised of the possibility of such damages.
- X *
- X * Sun Microsystems, Inc.
- X * 2550 Garcia Avenue
- X * Mountain View, California 94043
- X */
- X/* @(#)xdr.h 1.19 87/04/22 SMI */
- X
- X/*
- X * xdr.h, External Data Representation Serialization Routines.
- X *
- X * Copyright (C) 1984, Sun Microsystems, Inc.
- X */
- X
- X#ifndef _rpc_xdr_h
- X#define _rpc_xdr_h
- X
- X#include <rpc/c_types.h>
- X#include <rpc/types.h>
- X#include <stdio.h>
- X/*
- X * XDR provides a conventional way for converting between C data
- X * types and an external bit-string representation. Library supplied
- X * routines provide for the conversion on built-in C data types. These
- X * routines and utility routines defined here are used to help implement
- X * a type encode/decode routine for each user-defined type.
- X *
- X * Each data type provides a single procedure which takes two arguments:
- X *
- X * bool_t
- X * xdrproc(xdrs, argresp)
- X * XDR *xdrs;
- X * <type> *argresp;
- X *
- X * xdrs is an instance of a XDR handle, to which or from which the data
- X * type is to be converted. argresp is a pointer to the structure to be
- X * converted. The XDR handle contains an operation field which indicates
- X * which of the operations (ENCODE, DECODE * or FREE) is to be performed.
- X *
- X * XDR_DECODE may allocate space if the pointer argresp is null. This
- X * data can be freed with the XDR_FREE operation.
- X *
- X * We write only one procedure per data type to make it easy
- X * to keep the encode and decode procedures for a data type consistent.
- X * In many cases the same code performs all operations on a user defined type,
- X * because all the hard work is done in the component type routines.
- X * decode as a series of calls on the nested data types.
- X */
- X
- X/*
- X * Xdr operations. XDR_ENCODE causes the type to be encoded into the
- X * stream. XDR_DECODE causes the type to be extracted from the stream.
- X * XDR_FREE can be used to release the space allocated by an XDR_DECODE
- X * request.
- X */
- enum xdr_op {
- X XDR_ENCODE=0,
- X XDR_DECODE=1,
- X XDR_FREE=2
- X};
- X
- X/*
- X * This is the number of bytes per unit of external data.
- X */
- X#define BYTES_PER_XDR_UNIT (4)
- X#define RNDUP(x) ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \
- X * BYTES_PER_XDR_UNIT)
- X
- X/*
- X * The XDR handle.
- X * Contains operation which is being applied to the stream,
- X * an operations vector for the paticular implementation (e.g. see xdr_mem.c),
- X * and two private fields for the use of the particular impelementation.
- X */
- typedef struct XDR{
- X enum xdr_op x_op; /* operation; fast additional param */
- X struct xdr_ops {
- X bool_t (*x_getlong) FUN_ARGS((struct XDR*, long*));
- X /* get a long from underlying stream */
- X bool_t (*x_putlong) FUN_ARGS((struct XDR*, long*));
- X /* put a long to " */
- X bool_t (*x_getbytes) FUN_ARGS((struct XDR*, void*, u_int));
- X /* get some bytes from " */
- X bool_t (*x_putbytes) FUN_ARGS((struct XDR*, void*, u_int));
- X /* put some bytes to " */
- X u_int (*x_getpostn) FUN_ARGS((struct XDR*));
- X /* returns bytes off from beginning */
- X bool_t (*x_setpostn) FUN_ARGS((struct XDR*, u_int));
- X /* lets you reposition the stream */
- X long * (*x_inline) FUN_ARGS((struct XDR*, u_int));
- X /* buf quick ptr to buffered data */
- X void (*x_destroy) FUN_ARGS((struct XDR*));
- X /* free privates of this xdr_stream */
- X } *x_ops;
- X caddr_t x_public; /* users' data */
- X caddr_t x_private; /* pointer to private data */
- X caddr_t x_base; /* private used for position info */
- X int x_handy; /* extra private word */
- X} XDR;
- X
- X/*
- X * A xdrproc_t exists for each data type which is to be encoded or decoded.
- X *
- X * The second argument to the xdrproc_t is a pointer to an opaque pointer.
- X * The opaque pointer generally points to a structure of the data type
- X * to be decoded. If this pointer is 0, then the type routines should
- X * allocate dynamic storage of the appropriate size and return it.
- X * bool_t (*xdrproc_t)(XDR *, caddr_t *);
- X */
- typedef bool_t (*xdrproc_t) FUN_ARGS((XDR*, void*));
- X
- X/*
- X * Operations defined on a XDR handle
- X *
- X * XDR *xdrs;
- X * long *longp;
- X * caddr_t addr;
- X * u_int len;
- X * u_int pos;
- X */
- X#define XDR_GETLONG(xdrs, longp) \
- X (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
- X#define xdr_getlong(xdrs, longp) \
- X (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
- X
- X#define XDR_PUTLONG(xdrs, longp) \
- X (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
- X#define xdr_putlong(xdrs, longp) \
- X (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
- X
- X#define XDR_GETBYTES(xdrs, addr, len) \
- X (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
- X#define xdr_getbytes(xdrs, addr, len) \
- X (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
- X
- X#define XDR_PUTBYTES(xdrs, addr, len) \
- X (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
- X#define xdr_putbytes(xdrs, addr, len) \
- X (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
- X
- X#define XDR_GETPOS(xdrs) \
- X (*(xdrs)->x_ops->x_getpostn)(xdrs)
- X#define xdr_getpos(xdrs) \
- X (*(xdrs)->x_ops->x_getpostn)(xdrs)
- X
- X#define XDR_SETPOS(xdrs, pos) \
- X (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
- X#define xdr_setpos(xdrs, pos) \
- X (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
- X
- X#define XDR_INLINE(xdrs, len) \
- X (*(xdrs)->x_ops->x_inline)(xdrs, len)
- X#define xdr_inline(xdrs, len) \
- X (*(xdrs)->x_ops->x_inline)(xdrs, len)
- X
- X#define XDR_DESTROY(xdrs) \
- X if ((xdrs)->x_ops->x_destroy) \
- X (*(xdrs)->x_ops->x_destroy)(xdrs)
- X#define xdr_destroy(xdrs) \
- X if ((xdrs)->x_ops->x_destroy) \
- X (*(xdrs)->x_ops->x_destroy)(xdrs)
- X
- X/*
- X * Support struct for discriminated unions.
- X * You create an array of xdrdiscrim structures, terminated with
- X * a entry with a null procedure pointer. The xdr_union routine gets
- X * the discriminant value and then searches the array of structures
- X * for a matching value. If a match is found the associated xdr routine
- X * is called to handle that part of the union. If there is
- X * no match, then a default routine may be called.
- X * If there is no match and no default routine it is an error.
- X */
- X#define NULL_xdrproc_t ((xdrproc_t)0)
- struct xdr_discrim {
- X int value;
- X xdrproc_t proc;
- X};
- X
- X/*
- X * In-line routines for fast encode/decode of primitve data types.
- X * Caveat emptor: these use single memory cycles to get the
- X * data from the underlying buffer, and will fail to operate
- X * properly if the data is not aligned. The standard way to use these
- X * is to say:
- X * if ((buf = XDR_INLINE(xdrs, count)) == NULL)
- X * return (FALSE);
- X * <<< macro calls >>>
- X * where ``count'' is the number of bytes of data occupied
- X * by the primitive data types.
- X *
- X * N.B. and frozen for all time: each data type here uses 4 bytes
- X * of external representation.
- X */
- X#define IXDR_GET_LONG(buf) ((long)ntohl((u_long)*(buf)++))
- X#define IXDR_PUT_LONG(buf, v) (*(buf)++ = (long)htonl((u_long)v))
- X
- X#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf))
- X#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf))
- X#define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf))
- X#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_LONG(buf))
- X#define IXDR_GET_U_SHORT(buf) ((u_short)IXDR_GET_LONG(buf))
- X
- X#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
- X#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
- X#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
- X#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
- X#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
- X
- X/*
- X * These are the "generic" xdr routines.
- X */
- XEXTERN_FUNCTION(bool_t xdr_void, ());
- XEXTERN_FUNCTION(bool_t xdr_int, (XDR*, int*));
- XEXTERN_FUNCTION(bool_t xdr_u_int, (XDR*, u_int*));
- XEXTERN_FUNCTION(bool_t xdr_long, (XDR*, long*));
- XEXTERN_FUNCTION(bool_t xdr_u_long, (XDR*, u_long*));
- XEXTERN_FUNCTION(bool_t xdr_short, (XDR*, short*));
- XEXTERN_FUNCTION(bool_t xdr_u_short, (XDR*, u_short*));
- XEXTERN_FUNCTION(bool_t xdr_bool, (XDR*, bool_t*));
- XEXTERN_FUNCTION(bool_t xdr_enum, (XDR*, enum_t*));
- XEXTERN_FUNCTION(bool_t xdr_array, (XDR*, void**, u_int*, u_int, u_int, xdrproc_t));
- XEXTERN_FUNCTION(bool_t xdr_bytes, (XDR*, void**, u_int*, u_int));
- XEXTERN_FUNCTION(bool_t xdr_opaque, (XDR*, void*, u_int));
- XEXTERN_FUNCTION(bool_t xdr_string, (XDR*, char**, u_int));
- XEXTERN_FUNCTION(bool_t xdr_union, (XDR*, enum_t*, void*, struct xdr_discrim*, bool_t (*)()));
- XEXTERN_FUNCTION(void xdr_free, (xdrproc_t, void*));
- XEXTERN_FUNCTION(bool_t xdr_char, (XDR*, char*));
- XEXTERN_FUNCTION(bool_t xdr_u_char, (XDR*, u_char*));
- XEXTERN_FUNCTION(bool_t xdr_vector, (XDR*, void*, u_int, u_int, xdrproc_t));
- XEXTERN_FUNCTION(bool_t xdr_float, (XDR*, float*));
- XEXTERN_FUNCTION(bool_t xdr_double, (XDR*, double*));
- XEXTERN_FUNCTION(bool_t xdr_reference, (XDR*, void**, u_int, xdrproc_t));
- XEXTERN_FUNCTION(bool_t xdr_pointer, (XDR*, void**, u_int, xdrproc_t));
- XEXTERN_FUNCTION(bool_t xdr_wrapstring, (XDR*, char**));
- X
- X/*
- X * Common opaque bytes objects used by many rpc protocols;
- X * declared here due to commonality.
- X */
- X#define MAX_NETOBJ_SZ 1024
- struct netobj {
- X u_int n_len;
- X char *n_bytes;
- X};
- typedef struct netobj netobj;
- XEXTERN_FUNCTION(bool_t xdr_netobj, ());
- X
- X/*
- X * These are the public routines for the various implementations of
- X * xdr streams.
- X */
- XEXTERN_FUNCTION(void xdrmem_create, (XDR*, void*, u_int, enum xdr_op));
- X /* XDR using memory buffers */
- XEXTERN_FUNCTION(void xdrstdio_create, (XDR*, FILE*, enum xdr_op));
- X /* XDR using stdio library */
- XEXTERN_FUNCTION(void xdrrec_create, (XDR*, u_int, u_int, void*, int(*)(), int(*)()));
- X /* XDR pseudo records for tcp */
- XEXTERN_FUNCTION(bool_t xdrrec_endofrecord, (XDR*, bool_t));
- X /* make end of xdr record */
- XEXTERN_FUNCTION(int xdrrec_readbytes, (XDR*, void*, u_int));
- X /* like a read on a pipe */
- XEXTERN_FUNCTION(bool_t xdrrec_skiprecord, (XDR*));
- X /* move to beginning of next record */
- XEXTERN_FUNCTION(bool_t xdrrec_eof, (XDR*));
- X /* true if no more input */
- X
- X#endif /*!_rpc_xdr_h*/
- END_OF_FILE
- if test 10878 -ne `wc -c <'StdHdrs/rpc/xdr.h'`; then
- echo shar: \"'StdHdrs/rpc/xdr.h'\" unpacked with wrong size!
- fi
- # end of 'StdHdrs/rpc/xdr.h'
- fi
- if test -f 'rpc++/callback.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rpc++/callback.h'\"
- else
- echo shar: Extracting \"'rpc++/callback.h'\" \(22467 characters\)
- sed "s/^X//" >'rpc++/callback.h' <<'END_OF_FILE'
- X// -*- c++ -*-
- X/*
- Copyright (C) 1991 Peter Bersen
- X
- This file is part of the rpc++ Library. This library is free
- software; you can redistribute it and/or modify it under the terms of
- the GNU Library General Public License as published by the Free
- Software Foundation; either version 2 of the License, or (at your
- option) any later version. This library is distributed in the hope
- that it will be useful, but WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the GNU Library General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free Software
- XFoundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- X
- Modified and partially rewritten March 1992 by Michael N. Lipp,
- mnl@dtro.e-technik.th-darmstadt.de. The original copyright terms and
- conditions apply without change to any modified or new parts.
- X*/
- X
- X#ifndef _RPCCALLBACK_H_
- X#define _RPCCALLBACK_H_
- static char _rpcpp_callback_h_[]
- X= "callback.h,v 2.3 1992/06/15 19:13:26 mnl Exp";
- X
- X// callback.h,v
- X// Revision 2.3 1992/06/15 19:13:26 mnl
- X// Fixed a few bugs, clarified interface.
- X//
- X// Revision 2.2 1992/06/13 14:27:37 mnl
- X// Adapted to (patched) gcc-2.2. Fixed several bugs.
- X//
- X// Revision 2.1.1.1 1992/03/08 13:28:43 mnl
- X// Initial mnl version.
- X//
- X
- X//
- X// The user interface to RpcCallback is quiet simple. The only function
- X// needed is the constructor "RpcCallback (T* o, void* m)". Given a class
- X// C with a method m and an object o of Type C, a callback to the method
- X// can be constructed with "RpcCallback<C> (&O, &C::m)".
- X// As an alternative, an RpcExtCallback may be constructed with
- X// "RpcExtCallback (T* o, void* m, RpcService*)". In this case, the method
- X// is called with a pointer to the RpcService object as a third argument.
- X//
- X// A pointer to a callback can be casted to AnyRpcCallback by
- X// whatever routine receives it and the call can be made by applying "Do"
- X// to the callback.
- X//
- X
- class RpcService;
- X
- class AnyRpcCallback
- X{
- X friend class RpcService;
- X
- protected:
- X int params;
- X RpcService* svc;
- X virtual void* Do (void** in) = 0;
- X
- public:
- X inline virtual ~AnyRpcCallback () {}
- X inline virtual AnyRpcCallback* CopyToHeap () const = 0;
- X inline int Params () const
- X { return params; }
- X inline void SetService (RpcService* s)
- X { svc = s; }
- X};
- X
- class RpcCallback : public AnyRpcCallback
- X{
- private:
- X typedef void* (*ProcN)(void**);
- X typedef void* (*Proc0)();
- X typedef void* (*Proc1)(void*);
- X typedef void* (*Proc2)(void*, void*);
- X typedef void* (*Proc3)(void*, void*, void*);
- X typedef void* (*Proc4)(void*, void*, void*, void*);
- X typedef void* (*Proc5)(void*, void*, void*, void*, void*);
- X typedef void* (*Proc6)(void*, void*, void*, void*, void*, void*);
- X typedef void* (*Proc7)(void*, void*, void*, void*, void*, void*, void*);
- X
- X typedef void (*ProcNv)(void**);
- X typedef void (*Proc0v)();
- X typedef void (*Proc1v)(void*);
- X typedef void (*Proc2v)(void*, void*);
- X typedef void (*Proc3v)(void*, void*, void*);
- X typedef void (*Proc4v)(void*, void*, void*, void*);
- X typedef void (*Proc5v)(void*, void*, void*, void*, void*);
- X typedef void (*Proc6v)(void*, void*, void*, void*, void*, void*);
- X typedef void (*Proc7v)(void*, void*, void*, void*, void*, void*, void*);
- X
- X typedef void* (*ProcNs)(void**, RpcService*);
- X typedef void* (*Proc0s)(RpcService*);
- X typedef void* (*Proc1s)(void*, RpcService*);
- X typedef void* (*Proc2s)(void*, void*, RpcService*);
- X typedef void* (*Proc3s)(void*, void*, void*, RpcService*);
- X typedef void* (*Proc4s)(void*, void*, void*, void*, RpcService*);
- X typedef void* (*Proc5s)(void*, void*, void*, void*, void*, RpcService*);
- X typedef void* (*Proc6s)(void*, void*, void*, void*,
- X void*, void*, RpcService*);
- X typedef void* (*Proc7s)(void*, void*, void*, void*,
- X void*, void*, void*, RpcService*);
- X
- X typedef void (*ProcNvs)(void**, RpcService*);
- X typedef void (*Proc0vs)(RpcService*);
- X typedef void (*Proc1vs)(void*, RpcService*);
- X typedef void (*Proc2vs)(void*, void*, RpcService*);
- X typedef void (*Proc3vs)(void*, void*, void*, RpcService*);
- X typedef void (*Proc4vs)(void*, void*, void*, void*, RpcService*);
- X typedef void (*Proc5vs)(void*, void*, void*, void*, void*, RpcService*);
- X typedef void (*Proc6vs)(void*, void*, void*, void*,
- X void*, void*, RpcService*);
- X typedef void (*Proc7vs)(void*, void*, void*, void*,
- X void*, void*, void*, RpcService*);
- X
- X typedef void* (RpcCallback::*DoPtr)(void**);
- X DoPtr todo;
- X union
- X {
- X ProcN procN;ProcNv procNv;ProcNs procNs;ProcNvs procNvs;
- X Proc0 proc0;Proc0v proc0v;Proc0s proc0s;Proc0vs proc0vs;
- X Proc1 proc1;Proc1v proc1v;Proc1s proc1s;Proc1vs proc1vs;
- X Proc2 proc2;Proc2v proc2v;Proc2s proc2s;Proc2vs proc2vs;
- X Proc3 proc3;Proc3v proc3v;Proc3s proc3s;Proc3vs proc3vs;
- X Proc4 proc4;Proc4v proc4v;Proc4s proc4s;Proc4vs proc4vs;
- X Proc5 proc5;Proc5v proc5v;Proc5s proc5s;Proc5vs proc5vs;
- X Proc6 proc6;Proc6v proc6v;Proc6s proc6s;Proc6vs proc6vs;
- X Proc7 proc7;Proc7v proc7v;Proc7s proc7s;Proc7vs proc7vs;
- X };
- X inline RpcCallback () {}
- X inline void* Do (void** in)
- X { return (this->*todo)(in); }
- X
- X inline void* DoN (void** in)
- X { return (*procN)(in); }
- X inline void* Do0 (void** in)
- X { return (*proc0)(); }
- X inline void* Do1 (void** in)
- X { return (*proc1)(in[0]); }
- X inline void* Do2 (void** in)
- X { return (*proc2)(in[0], in[1]); }
- X inline void* Do3 (void** in)
- X { return (*proc3)(in[0], in[1], in[2]); }
- X inline void* Do4 (void** in)
- X { return (*proc4)(in[0], in[1], in[2], in[3]); }
- X inline void* Do5 (void** in)
- X { return (*proc5)(in[0], in[1], in[2], in[3], in[4]); }
- X inline void* Do6 (void** in)
- X { return (*proc6)(in[0], in[1], in[2], in[3], in[4], in[5]); }
- X inline void* Do7 (void** in)
- X { return (*proc7)(in[0], in[1], in[2], in[3], in[4], in[5], in[6]); }
- X inline void* DoNv (void** in)
- X { (*procNv)(in); return (void*)0; }
- X inline void* Do0v (void** in)
- X { (*proc0v)(); return (void*)0; }
- X inline void* Do1v (void** in)
- X { (*proc1v)(in[0]); return (void*)0; }
- X inline void* Do2v (void** in)
- X { (*proc2v)(in[0], in[1]); return (void*)0; }
- X inline void* Do3v (void** in)
- X { (*proc3v)(in[0], in[1], in[2]); return (void*)0; }
- X inline void* Do4v (void** in)
- X { (*proc4v)(in[0], in[1], in[2], in[3]); return (void*)0; }
- X inline void* Do5v (void** in)
- X { (*proc5v)(in[0], in[1], in[2], in[3], in[4]); return (void*)0; }
- X inline void* Do6v (void** in)
- X { (*proc6v)(in[0], in[1], in[2], in[3], in[4], in[5]); return (void*)0; }
- X inline void* Do7v (void** in)
- X { (*proc7v)(in[0], in[1], in[2], in[3], in[4], in[5], in[6]);
- X return (void*)0; }
- X
- X inline void* DoNs (void** in)
- X { return (*procNs)(in, svc); }
- X inline void* Do0s (void** in)
- X { return (*proc0s)(svc); }
- X inline void* Do1s (void** in)
- X { return (*proc1s)(in[0], svc); }
- X inline void* Do2s (void** in)
- X { return (*proc2s)(in[0], in[1], svc); }
- X inline void* Do3s (void** in)
- X { return (*proc3s)(in[0], in[1], in[2], svc); }
- X inline void* Do4s (void** in)
- X { return (*proc4s)(in[0], in[1], in[2], in[3], svc); }
- X inline void* Do5s (void** in)
- X { return (*proc5s)(in[0], in[1], in[2], in[3], in[4], svc); }
- X inline void* Do6s (void** in)
- X { return (*proc6s)(in[0], in[1], in[2], in[3], in[4], in[5], svc); }
- X inline void* Do7s (void** in)
- X { return (*proc7s)(in[0], in[1], in[2], in[3], in[4], in[5], in[6], svc); }
- X inline void* DoNvs (void** in)
- X { (*procNvs)(in, svc); return (void*)0; }
- X inline void* Do0vs (void** in)
- X { (*proc0vs)(svc); return (void*)0; }
- X inline void* Do1vs (void** in)
- X { (*proc1vs)(in[0], svc); return (void*)0; }
- X inline void* Do2vs (void** in)
- X { (*proc2vs)(in[0], in[1], svc); return (void*)0; }
- X inline void* Do3vs (void** in)
- X { (*proc3vs)(in[0], in[1], in[2], svc); return (void*)0; }
- X inline void* Do4vs (void** in)
- X { (*proc4vs)(in[0], in[1], in[2], in[3], svc); return (void*)0; }
- X inline void* Do5vs (void** in)
- X { (*proc5vs)(in[0], in[1], in[2], in[3], in[4], svc); return (void*)0; }
- X inline void* Do6vs (void** in)
- X { (*proc6vs)(in[0], in[1], in[2], in[3], in[4], in[5], svc);
- X return (void*)0; }
- X inline void* Do7vs (void** in)
- X { (*proc7vs)(in[0], in[1], in[2], in[3],
- X in[4], in[5], in[6], svc); return (void*)0; }
- X
- public:
- X inline RpcCallback (ProcN p)
- X { todo = &this->DoN; procN = p; params = -1; }
- X inline RpcCallback (Proc0 p)
- X { todo = &this->Do0; proc0 = p; params = 0; }
- X inline RpcCallback (Proc1 p)
- X { todo = &this->Do1; proc1 = p; params = 1; }
- X inline RpcCallback (Proc2 p)
- X { todo = &this->Do2; proc2 = p; params = 2; }
- X inline RpcCallback (Proc3 p)
- X { todo = &this->Do3; proc3 = p; params = 3; }
- X inline RpcCallback (Proc4 p)
- X { todo = &this->Do4; proc4 = p; params = 4; }
- X inline RpcCallback (Proc5 p)
- X { todo = &this->Do5; proc5 = p; params = 5; }
- X inline RpcCallback (Proc6 p)
- X { todo = &this->Do6; proc6 = p; params = 6; }
- X inline RpcCallback (Proc7 p)
- X { todo = &this->Do7; proc7 = p; params = 7; }
- X
- X inline RpcCallback (ProcNv p)
- X { todo = &this->DoNv; procNv = p; params = -1; }
- X inline RpcCallback (Proc0v p)
- X { todo = &this->Do0v; proc0v = p; params = 0; }
- X inline RpcCallback (Proc1v p)
- X { todo = &this->Do1v; proc1v = p; params = 1; }
- X inline RpcCallback (Proc2v p)
- X { todo = &this->Do2v; proc2v = p; params = 2; }
- X inline RpcCallback (Proc3v p)
- X { todo = &this->Do3v; proc3v = p; params = 3; }
- X inline RpcCallback (Proc4v p)
- X { todo = &this->Do4v; proc4v = p; params = 4; }
- X inline RpcCallback (Proc5v p)
- X { todo = &this->Do5v; proc5v = p; params = 5; }
- X inline RpcCallback (Proc6v p)
- X { todo = &this->Do6v; proc6v = p; params = 6; }
- X inline RpcCallback (Proc7v p)
- X { todo = &this->Do7v; proc7v = p; params = 7; }
- X
- X inline RpcCallback (ProcNs p)
- X { todo = &this->DoNs; procNs = p; params = -1; }
- X inline RpcCallback (Proc0s p)
- X { todo = &this->Do0s; proc0s = p; params = 0; }
- X inline RpcCallback (Proc1s p)
- X { todo = &this->Do1s; proc1s = p; params = 1; }
- X inline RpcCallback (Proc2s p)
- X { todo = &this->Do2s; proc2s = p; params = 2; }
- X inline RpcCallback (Proc3s p)
- X { todo = &this->Do3s; proc3s = p; params = 3; }
- X inline RpcCallback (Proc4s p)
- X { todo = &this->Do4s; proc4s = p; params = 4; }
- X inline RpcCallback (Proc5s p)
- X { todo = &this->Do5s; proc5s = p; params = 5; }
- X inline RpcCallback (Proc6s p)
- X { todo = &this->Do6s; proc6s = p; params = 6; }
- X inline RpcCallback (Proc7s p)
- X { todo = &this->Do7s; proc7s = p; params = 7; }
- X
- X inline RpcCallback (ProcNvs p)
- X { todo = &this->DoNvs; procNvs = p; params = -1; }
- X inline RpcCallback (Proc0vs p)
- X { todo = &this->Do0vs; proc0vs = p; params = 0; }
- X inline RpcCallback (Proc1vs p)
- X { todo = &this->Do1vs; proc1vs = p; params = 1; }
- X inline RpcCallback (Proc2vs p)
- X { todo = &this->Do2vs; proc2vs = p; params = 2; }
- X inline RpcCallback (Proc3vs p)
- X { todo = &this->Do3vs; proc3vs = p; params = 3; }
- X inline RpcCallback (Proc4vs p)
- X { todo = &this->Do4vs; proc4vs = p; params = 4; }
- X inline RpcCallback (Proc5vs p)
- X { todo = &this->Do5vs; proc5vs = p; params = 5; }
- X inline RpcCallback (Proc6vs p)
- X { todo = &this->Do6vs; proc6vs = p; params = 6; }
- X inline RpcCallback (Proc7vs p)
- X { todo = &this->Do7vs; proc7vs = p; params = 7; }
- X
- X inline virtual AnyRpcCallback* CopyToHeap () const
- X {
- X RpcCallback* p = new RpcCallback ();
- X *p = *this;
- X return p;
- X }
- X};
- X
- template<class T> class RpcMethodCall : public AnyRpcCallback
- X{
- private:
- X typedef void* (T::*MethodN)(void**);
- X typedef void* (T::*Method0)();
- X typedef void* (T::*Method1)(void*);
- X typedef void* (T::*Method2)(void*, void*);
- X typedef void* (T::*Method3)(void*, void*, void*);
- X typedef void* (T::*Method4)(void*, void*, void*, void*);
- X typedef void* (T::*Method5)(void*, void*, void*, void*, void*);
- X typedef void* (T::*Method6)(void*, void*, void*, void*, void*, void*);
- X typedef void* (T::*Method7)(void*, void*, void*, void*, void*, void*, void*);
- X
- X typedef void (T::*MethodNv)(void**);
- X typedef void (T::*Method0v)();
- X typedef void (T::*Method1v)(void*);
- X typedef void (T::*Method2v)(void*, void*);
- X typedef void (T::*Method3v)(void*, void*, void*);
- X typedef void (T::*Method4v)(void*, void*, void*, void*);
- X typedef void (T::*Method5v)(void*, void*, void*, void*, void*);
- X typedef void (T::*Method6v)(void*, void*, void*, void*, void*, void*);
- X typedef void (T::*Method7v)(void*, void*, void*, void*, void*, void*, void*);
- X
- X typedef void* (T::*MethodNs)(void**, RpcService*);
- X typedef void* (T::*Method0s)(RpcService*);
- X typedef void* (T::*Method1s)(void*, RpcService*);
- X typedef void* (T::*Method2s)(void*, void*, RpcService*);
- X typedef void* (T::*Method3s)(void*, void*, void*, RpcService*);
- X typedef void* (T::*Method4s)(void*, void*, void*, void*, RpcService*);
- X typedef void* (T::*Method5s)(void*, void*, void*, void*, void*, RpcService*);
- X typedef void* (T::*Method6s)(void*, void*, void*, void*,
- X void*, void*, RpcService*);
- X typedef void* (T::*Method7s)(void*, void*, void*, void*,
- X void*, void*, void*, RpcService*);
- X
- X typedef void (T::*MethodNvs)(void**, RpcService*);
- X typedef void (T::*Method0vs)(RpcService*);
- X typedef void (T::*Method1vs)(void*, RpcService*);
- X typedef void (T::*Method2vs)(void*, void*, RpcService*);
- X typedef void (T::*Method3vs)(void*, void*, void*, RpcService*);
- X typedef void (T::*Method4vs)(void*, void*, void*, void*, RpcService*);
- X typedef void (T::*Method5vs)(void*, void*, void*, void*, void*, RpcService*);
- X typedef void (T::*Method6vs)(void*, void*, void*, void*,
- X void*, void*, RpcService*);
- X typedef void (T::*Method7vs)(void*, void*, void*, void*,
- X void*, void*, void*, RpcService*);
- X
- X typedef void* (RpcMethodCall::*DoPtr)(void**);
- X DoPtr todo;
- X T* object;
- X union
- X {
- X MethodN methodN;MethodNv methodNv;MethodNs methodNs;MethodNvs methodNvs;
- X Method0 method0;Method0v method0v;Method0s method0s;Method0vs method0vs;
- X Method1 method1;Method1v method1v;Method1s method1s;Method1vs method1vs;
- X Method2 method2;Method2v method2v;Method2s method2s;Method2vs method2vs;
- X Method3 method3;Method3v method3v;Method3s method3s;Method3vs method3vs;
- X Method4 method4;Method4v method4v;Method4s method4s;Method4vs method4vs;
- X Method5 method5;Method5v method5v;Method5s method5s;Method5vs method5vs;
- X Method6 method6;Method6v method6v;Method6s method6s;Method6vs method6vs;
- X Method7 method7;Method7v method7v;Method7s method7s;Method7vs method7vs;
- X };
- X inline RpcMethodCall () {}
- X inline void* Do (void** in)
- X { return (this->*todo)(in); }
- X
- X inline void* DoN (void** in)
- X { return (object->*methodN)(in); }
- X inline void* Do0 (void** in)
- X { return (object->*method0)(); }
- X inline void* Do1 (void** in)
- X { return (object->*method1)(in[0]); }
- X inline void* Do2 (void** in)
- X { return (object->*method2)(in[0], in[1]); }
- X inline void* Do3 (void** in)
- X { return (object->*method3)(in[0], in[1], in[2]); }
- X inline void* Do4 (void** in)
- X { return (object->*method4)(in[0], in[1], in[2], in[3]); }
- X inline void* Do5 (void** in)
- X { return (object->*method5)(in[0], in[1], in[2], in[3], in[4]); }
- X inline void* Do6 (void** in)
- X { return (object->*method6)(in[0], in[1], in[2], in[3], in[4], in[5]); }
- X inline void* Do7 (void** in)
- X { return (object->*method7)(in[0], in[1], in[2],
- X in[3], in[4], in[5], in[6]); }
- X inline void* DoNv (void** in)
- X { (object->*methodNv)(in); return (void*)0; }
- X inline void* Do0v (void** in)
- X { (object->*method0v)(); return (void*)0; }
- X inline void* Do1v (void** in)
- X { (object->*method1v)(in[0]); return (void*)0; }
- X inline void* Do2v (void** in)
- X { (object->*method2v)(in[0], in[1]); return (void*)0; }
- X inline void* Do3v (void** in)
- X { (object->*method3v)(in[0], in[1], in[2]); return (void*)0; }
- X inline void* Do4v (void** in)
- X { (object->*method4v)(in[0], in[1], in[2], in[3]); return (void*)0; }
- X inline void* Do5v (void** in)
- X { (object->*method5v)(in[0], in[1], in[2], in[3], in[4]);
- X return (void*)0; }
- X inline void* Do6v (void** in)
- X { (object->*method6v)(in[0], in[1], in[2], in[3], in[4], in[5]);
- X return (void*)0; }
- X inline void* Do7v (void** in)
- X { (object->*method7v)(in[0], in[1], in[2], in[3], in[4], in[5], in[6]);
- X return (void*)0; }
- X
- X inline void* DoNs (void** in)
- X { return (object->*methodNs)(in, svc); }
- X inline void* Do0s (void** in)
- X { return (object->*method0s)(svc); }
- X inline void* Do1s (void** in)
- X { return (object->*method1s)(in[0], svc); }
- X inline void* Do2s (void** in)
- X { return (object->*method2s)(in[0], in[1], svc); }
- X inline void* Do3s (void** in)
- X { return (object->*method3s)(in[0], in[1], in[2], svc); }
- X inline void* Do4s (void** in)
- X { return (object->*method4s)(in[0], in[1], in[2], in[3], svc); }
- X inline void* Do5s (void** in)
- X { return (object->*method5s)(in[0], in[1], in[2], in[3], in[4], svc); }
- X inline void* Do6s (void** in)
- X { return (object->*method6s)(in[0], in[1], in[2],
- X in[3], in[4], in[5], svc); }
- X inline void* Do7s (void** in)
- X { return (object->*method7s)(in[0], in[1], in[2],
- X in[3], in[4], in[5], in[6], svc); }
- X inline void* DoNvs (void** in)
- X { (object->*methodNvs)(in, svc); return (void*)0; }
- X inline void* Do0vs (void** in)
- X { (object->*method0vs)(svc); return (void*)0; }
- X inline void* Do1vs (void** in)
- X { (object->*method1vs)(in[0], svc); return (void*)0; }
- X inline void* Do2vs (void** in)
- X { (object->*method2vs)(in[0], in[1], svc); return (void*)0; }
- X inline void* Do3vs (void** in)
- X { (object->*method3vs)(in[0], in[1], in[2], svc); return (void*)0; }
- X inline void* Do4vs (void** in)
- X { (object->*method4vs)(in[0], in[1], in[2], in[3], svc); return (void*)0; }
- X inline void* Do5vs (void** in)
- X { (object->*method5vs)(in[0], in[1], in[2], in[3], in[4], svc);
- X return (void*)0; }
- X inline void* Do6vs (void** in)
- X { (object->*method6vs)(in[0], in[1], in[2], in[3], in[4], in[5], svc);
- X return (void*)0; }
- X inline void* Do7vs (void** in)
- X { (object->*method7vs)(in[0], in[1], in[2], in[3],
- X in[4], in[5], in[6], svc); return (void*)0; }
- X
- public:
- X inline RpcMethodCall (T* o, MethodN m)
- X { todo = &this->DoN; object = o; methodN = m; params = -1; }
- X inline RpcMethodCall (T* o, Method0 m)
- X { todo = &this->Do0; object = o; method0 = m; params = 0; }
- X inline RpcMethodCall (T* o, Method1 m)
- X { todo = &this->Do1; object = o; method1 = m; params = 1; }
- X inline RpcMethodCall (T* o, Method2 m)
- X { todo = &this->Do2; object = o; method2 = m; params = 2; }
- X inline RpcMethodCall (T* o, Method3 m)
- X { todo = &this->Do3; object = o; method3 = m; params = 3; }
- X inline RpcMethodCall (T* o, Method4 m)
- X { todo = &this->Do4; object = o; method4 = m; params = 4; }
- X inline RpcMethodCall (T* o, Method5 m)
- X { todo = &this->Do5; object = o; method5 = m; params = 5; }
- X inline RpcMethodCall (T* o, Method6 m)
- X { todo = &this->Do6; object = o; method6 = m; params = 6; }
- X inline RpcMethodCall (T* o, Method7 m)
- X { todo = &this->Do7; object = o; method7 = m; params = 7; }
- X
- X inline RpcMethodCall (T* o, MethodNv m)
- X { todo = &this->DoNv; object = o; methodNv = m; params = -1; }
- X inline RpcMethodCall (T* o, Method0v m)
- X { todo = &this->Do0v; object = o; method0v = m; params = 0; }
- X inline RpcMethodCall (T* o, Method1v m)
- X { todo = &this->Do1v; object = o; method1v = m; params = 1; }
- X inline RpcMethodCall (T* o, Method2v m)
- X { todo = &this->Do2v; object = o; method2v = m; params = 2; }
- X inline RpcMethodCall (T* o, Method3v m)
- X { todo = &this->Do3v; object = o; method3v = m; params = 3; }
- X inline RpcMethodCall (T* o, Method4v m)
- X { todo = &this->Do4v; object = o; method4v = m; params = 4; }
- X inline RpcMethodCall (T* o, Method5v m)
- X { todo = &this->Do5v; object = o; method5v = m; params = 5; }
- X inline RpcMethodCall (T* o, Method6v m)
- X { todo = &this->Do6v; object = o; method6v = m; params = 6; }
- X inline RpcMethodCall (T* o, Method7v m)
- X { todo = &this->Do7v; object = o; method7v = m; params = 7; }
- X
- X inline RpcMethodCall (T* o, MethodNs m)
- X { todo = &this->DoNs; object = o; methodNs = m; params = -1; }
- X inline RpcMethodCall (T* o, Method0s m)
- X { todo = &this->Do0s; object = o; method0s = m; params = 0; }
- X inline RpcMethodCall (T* o, Method1s m)
- X { todo = &this->Do1s; object = o; method1s = m; params = 1; }
- X inline RpcMethodCall (T* o, Method2s m)
- X { todo = &this->Do2s; object = o; method2s = m; params = 2; }
- X inline RpcMethodCall (T* o, Method3s m)
- X { todo = &this->Do3s; object = o; method3s = m; params = 3; }
- X inline RpcMethodCall (T* o, Method4s m)
- X { todo = &this->Do4s; object = o; method4s = m; params = 4; }
- X inline RpcMethodCall (T* o, Method5s m)
- X { todo = &this->Do5s; object = o; method5s = m; params = 5; }
- X inline RpcMethodCall (T* o, Method6s m)
- X { todo = &this->Do6s; object = o; method6s = m; params = 6; }
- X inline RpcMethodCall (T* o, Method7s m)
- X { todo = &this->Do7s; object = o; method7s = m; params = 7; }
- X
- X inline RpcMethodCall (T* o, MethodNvs m)
- X { todo = &this->DoNvs; object = o; methodNvs = m; params = -1; }
- X inline RpcMethodCall (T* o, Method0vs m)
- X { todo = &this->Do0vs; object = o; method0vs = m; params = 0; }
- X inline RpcMethodCall (T* o, Method1vs m)
- X { todo = &this->Do1vs; object = o; method1vs = m; params = 1; }
- X inline RpcMethodCall (T* o, Method2vs m)
- X { todo = &this->Do2vs; object = o; method2vs = m; params = 2; }
- X inline RpcMethodCall (T* o, Method3vs m)
- X { todo = &this->Do3vs; object = o; method3vs = m; params = 3; }
- X inline RpcMethodCall (T* o, Method4vs m)
- X { todo = &this->Do4vs; object = o; method4vs = m; params = 4; }
- X inline RpcMethodCall (T* o, Method5vs m)
- X { todo = &this->Do5vs; object = o; method5vs = m; params = 5; }
- X inline RpcMethodCall (T* o, Method6vs m)
- X { todo = &this->Do6vs; object = o; method6vs = m; params = 6; }
- X inline RpcMethodCall (T* o, Method7vs m)
- X { todo = &this->Do7vs; object = o; method7vs = m; params = 7; }
- X
- X inline virtual AnyRpcCallback* CopyToHeap () const
- X {
- X RpcMethodCall* p = new RpcMethodCall ();
- X *p = *this;
- X return p;
- X }
- X};
- X
- X#endif
- END_OF_FILE
- if test 22467 -ne `wc -c <'rpc++/callback.h'`; then
- echo shar: \"'rpc++/callback.h'\" unpacked with wrong size!
- fi
- # end of 'rpc++/callback.h'
- fi
- echo shar: End of archive 2 \(of 3\).
- cp /dev/null ark2isdone
- MISSING=""
- for I in 1 2 3 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 3 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-