home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / mnlrpc23 / part02 < prev    next >
Encoding:
Text File  |  1993-04-24  |  80.6 KB  |  2,031 lines

  1. Newsgroups: comp.sources.unix
  2. From: mnl@dtro.e-technik.th-darmstadt.de (Michael Lipp)
  3. Subject: v26i182: mnl-rpc++-2.3.1 - a C++ interface to Sun RPC, Part02/03
  4. Sender: unix-sources-moderator@vix.com
  5. Approved: paul@vix.com
  6.  
  7. Submitted-By: mnl@dtro.e-technik.th-darmstadt.de (Michael Lipp)
  8. Posting-Number: Volume 26, Issue 182
  9. Archive-Name: mnl-rpc++-2.3.1/part02
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 2 (of 3)."
  18. # Contents:  COPYING StdHdrs/rpc/clnt.h StdHdrs/rpc/svc.h
  19. #   StdHdrs/rpc/xdr.h rpc++/callback.h
  20. # Wrapped by vixie@gw.home.vix.com on Sun Apr 25 00:49:47 1993
  21. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  22. if test -f 'COPYING' -a "${1}" != "-c" ; then 
  23.   echo shar: Will not clobber existing file \"'COPYING'\"
  24. else
  25. echo shar: Extracting \"'COPYING'\" \(25265 characters\)
  26. sed "s/^X//" >'COPYING' <<'END_OF_FILE'
  27. X          GNU LIBRARY GENERAL PUBLIC LICENSE
  28. X               Version 2, June 1991
  29. X
  30. X Copyright (C) 1991 Free Software Foundation, Inc.
  31. X                    675 Mass Ave, Cambridge, MA 02139, USA
  32. X Everyone is permitted to copy and distribute verbatim copies
  33. X of this license document, but changing it is not allowed.
  34. X
  35. X[This is the first released version of the library GPL.  It is
  36. X numbered 2 because it goes with version 2 of the ordinary GPL.]
  37. X
  38. X                Preamble
  39. X
  40. X  The licenses for most software are designed to take away your
  41. freedom to share and change it.  By contrast, the GNU General Public
  42. Licenses are intended to guarantee your freedom to share and change
  43. free software--to make sure the software is free for all its users.
  44. X
  45. X  This license, the Library General Public License, applies to some
  46. specially designated Free Software Foundation software, and to any
  47. other libraries whose authors decide to use it.  You can use it for
  48. your libraries, too.
  49. X
  50. X  When we speak of free software, we are referring to freedom, not
  51. price.  Our General Public Licenses are designed to make sure that you
  52. have the freedom to distribute copies of free software (and charge for
  53. this service if you wish), that you receive source code or can get it
  54. if you want it, that you can change the software or use pieces of it
  55. in new free programs; and that you know you can do these things.
  56. X
  57. X  To protect your rights, we need to make restrictions that forbid
  58. anyone to deny you these rights or to ask you to surrender the rights.
  59. These restrictions translate to certain responsibilities for you if
  60. you distribute copies of the library, or if you modify it.
  61. X
  62. X  For example, if you distribute copies of the library, whether gratis
  63. or for a fee, you must give the recipients all the rights that we gave
  64. you.  You must make sure that they, too, receive or can get the source
  65. code.  If you link a program with the library, you must provide
  66. complete object files to the recipients so that they can relink them
  67. with the library, after making changes to the library and recompiling
  68. it.  And you must show them these terms so they know their rights.
  69. X
  70. X  Our method of protecting your rights has two steps: (1) copyright
  71. the library, and (2) offer you this license which gives you legal
  72. permission to copy, distribute and/or modify the library.
  73. X
  74. X  Also, for each distributor's protection, we want to make certain
  75. that everyone understands that there is no warranty for this free
  76. library.  If the library is modified by someone else and passed on, we
  77. want its recipients to know that what they have is not the original
  78. version, so that any problems introduced by others will not reflect on
  79. the original authors' reputations.
  80. X
  81. X  Finally, any free program is threatened constantly by software
  82. patents.  We wish to avoid the danger that companies distributing free
  83. software will individually obtain patent licenses, thus in effect
  84. transforming the program into proprietary software.  To prevent this,
  85. we have made it clear that any patent must be licensed for everyone's
  86. free use or not licensed at all.
  87. X
  88. X  Most GNU software, including some libraries, is covered by the ordinary
  89. GNU General Public License, which was designed for utility programs.  This
  90. license, the GNU Library General Public License, applies to certain
  91. designated libraries.  This license is quite different from the ordinary
  92. one; be sure to read it in full, and don't assume that anything in it is
  93. the same as in the ordinary license.
  94. X
  95. X  The reason we have a separate public license for some libraries is that
  96. they blur the distinction we usually make between modifying or adding to a
  97. program and simply using it.  Linking a program with a library, without
  98. changing the library, is in some sense simply using the library, and is
  99. analogous to running a utility program or application program.  However, in
  100. a textual and legal sense, the linked executable is a combined work, a
  101. derivative of the original library, and the ordinary General Public License
  102. treats it as such.
  103. X
  104. X  Because of this blurred distinction, using the ordinary General
  105. Public License for libraries did not effectively promote software
  106. sharing, because most developers did not use the libraries.  We
  107. concluded that weaker conditions might promote sharing better.
  108. X
  109. X  However, unrestricted linking of non-free programs would deprive the
  110. users of those programs of all benefit from the free status of the
  111. libraries themselves.  This Library General Public License is intended to
  112. permit developers of non-free programs to use free libraries, while
  113. preserving your freedom as a user of such programs to change the free
  114. libraries that are incorporated in them.  (We have not seen how to achieve
  115. this as regards changes in header files, but we have achieved it as regards
  116. changes in the actual functions of the Library.)  The hope is that this
  117. will lead to faster development of free libraries.
  118. X
  119. X  The precise terms and conditions for copying, distribution and
  120. modification follow.  Pay close attention to the difference between a
  121. X"work based on the library" and a "work that uses the library".  The
  122. former contains code derived from the library, while the latter only
  123. works together with the library.
  124. X
  125. X  Note that it is possible for a library to be covered by the ordinary
  126. General Public License rather than by this special one.
  127. X
  128. X          GNU LIBRARY GENERAL PUBLIC LICENSE
  129. X   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  130. X
  131. X  0. This License Agreement applies to any software library which
  132. contains a notice placed by the copyright holder or other authorized
  133. party saying it may be distributed under the terms of this Library
  134. General Public License (also called "this License").  Each licensee is
  135. addressed as "you".
  136. X
  137. X  A "library" means a collection of software functions and/or data
  138. prepared so as to be conveniently linked with application programs
  139. X(which use some of those functions and data) to form executables.
  140. X
  141. X  The "Library", below, refers to any such software library or work
  142. which has been distributed under these terms.  A "work based on the
  143. Library" means either the Library or any derivative work under
  144. copyright law: that is to say, a work containing the Library or a
  145. portion of it, either verbatim or with modifications and/or translated
  146. straightforwardly into another language.  (Hereinafter, translation is
  147. included without limitation in the term "modification".)
  148. X
  149. X  "Source code" for a work means the preferred form of the work for
  150. making modifications to it.  For a library, complete source code means
  151. all the source code for all modules it contains, plus any associated
  152. interface definition files, plus the scripts used to control compilation
  153. and installation of the library.
  154. X
  155. X  Activities other than copying, distribution and modification are not
  156. covered by this License; they are outside its scope.  The act of
  157. running a program using the Library is not restricted, and output from
  158. such a program is covered only if its contents constitute a work based
  159. on the Library (independent of the use of the Library in a tool for
  160. writing it).  Whether that is true depends on what the Library does
  161. and what the program that uses the Library does.
  162. X  
  163. X  1. You may copy and distribute verbatim copies of the Library's
  164. complete source code as you receive it, in any medium, provided that
  165. you conspicuously and appropriately publish on each copy an
  166. appropriate copyright notice and disclaimer of warranty; keep intact
  167. all the notices that refer to this License and to the absence of any
  168. warranty; and distribute a copy of this License along with the
  169. Library.
  170. X
  171. X  You may charge a fee for the physical act of transferring a copy,
  172. and you may at your option offer warranty protection in exchange for a
  173. fee.
  174. X
  175. X  2. You may modify your copy or copies of the Library or any portion
  176. of it, thus forming a work based on the Library, and copy and
  177. distribute such modifications or work under the terms of Section 1
  178. above, provided that you also meet all of these conditions:
  179. X
  180. X    a) The modified work must itself be a software library.
  181. X
  182. X    b) You must cause the files modified to carry prominent notices
  183. X    stating that you changed the files and the date of any change.
  184. X
  185. X    c) You must cause the whole of the work to be licensed at no
  186. X    charge to all third parties under the terms of this License.
  187. X
  188. X    d) If a facility in the modified Library refers to a function or a
  189. X    table of data to be supplied by an application program that uses
  190. X    the facility, other than as an argument passed when the facility
  191. X    is invoked, then you must make a good faith effort to ensure that,
  192. X    in the event an application does not supply such function or
  193. X    table, the facility still operates, and performs whatever part of
  194. X    its purpose remains meaningful.
  195. X
  196. X    (For example, a function in a library to compute square roots has
  197. X    a purpose that is entirely well-defined independent of the
  198. X    application.  Therefore, Subsection 2d requires that any
  199. X    application-supplied function or table used by this function must
  200. X    be optional: if the application does not supply it, the square
  201. X    root function must still compute square roots.)
  202. X
  203. These requirements apply to the modified work as a whole.  If
  204. identifiable sections of that work are not derived from the Library,
  205. and can be reasonably considered independent and separate works in
  206. themselves, then this License, and its terms, do not apply to those
  207. sections when you distribute them as separate works.  But when you
  208. distribute the same sections as part of a whole which is a work based
  209. on the Library, the distribution of the whole must be on the terms of
  210. this License, whose permissions for other licensees extend to the
  211. entire whole, and thus to each and every part regardless of who wrote
  212. it.
  213. X
  214. Thus, it is not the intent of this section to claim rights or contest
  215. your rights to work written entirely by you; rather, the intent is to
  216. exercise the right to control the distribution of derivative or
  217. collective works based on the Library.
  218. X
  219. In addition, mere aggregation of another work not based on the Library
  220. with the Library (or with a work based on the Library) on a volume of
  221. a storage or distribution medium does not bring the other work under
  222. the scope of this License.
  223. X
  224. X  3. You may opt to apply the terms of the ordinary GNU General Public
  225. License instead of this License to a given copy of the Library.  To do
  226. this, you must alter all the notices that refer to this License, so
  227. that they refer to the ordinary GNU General Public License, version 2,
  228. instead of to this License.  (If a newer version than version 2 of the
  229. ordinary GNU General Public License has appeared, then you can specify
  230. that version instead if you wish.)  Do not make any other change in
  231. these notices.
  232. X
  233. X  Once this change is made in a given copy, it is irreversible for
  234. that copy, so the ordinary GNU General Public License applies to all
  235. subsequent copies and derivative works made from that copy.
  236. X
  237. X  This option is useful when you wish to copy part of the code of
  238. the Library into a program that is not a library.
  239. X
  240. X  4. You may copy and distribute the Library (or a portion or
  241. derivative of it, under Section 2) in object code or executable form
  242. under the terms of Sections 1 and 2 above provided that you accompany
  243. it with the complete corresponding machine-readable source code, which
  244. must be distributed under the terms of Sections 1 and 2 above on a
  245. medium customarily used for software interchange.
  246. X
  247. X  If distribution of object code is made by offering access to copy
  248. from a designated place, then offering equivalent access to copy the
  249. source code from the same place satisfies the requirement to
  250. distribute the source code, even though third parties are not
  251. compelled to copy the source along with the object code.
  252. X
  253. X  5. A program that contains no derivative of any portion of the
  254. Library, but is designed to work with the Library by being compiled or
  255. linked with it, is called a "work that uses the Library".  Such a
  256. work, in isolation, is not a derivative work of the Library, and
  257. therefore falls outside the scope of this License.
  258. X
  259. X  However, linking a "work that uses the Library" with the Library
  260. creates an executable that is a derivative of the Library (because it
  261. contains portions of the Library), rather than a "work that uses the
  262. library".  The executable is therefore covered by this License.
  263. Section 6 states terms for distribution of such executables.
  264. X
  265. X  When a "work that uses the Library" uses material from a header file
  266. that is part of the Library, the object code for the work may be a
  267. derivative work of the Library even though the source code is not.
  268. Whether this is true is especially significant if the work can be
  269. linked without the Library, or if the work is itself a library.  The
  270. threshold for this to be true is not precisely defined by law.
  271. X
  272. X  If such an object file uses only numerical parameters, data
  273. structure layouts and accessors, and small macros and small inline
  274. functions (ten lines or less in length), then the use of the object
  275. file is unrestricted, regardless of whether it is legally a derivative
  276. work.  (Executables containing this object code plus portions of the
  277. Library will still fall under Section 6.)
  278. X
  279. X  Otherwise, if the work is a derivative of the Library, you may
  280. distribute the object code for the work under the terms of Section 6.
  281. Any executables containing that work also fall under Section 6,
  282. whether or not they are linked directly with the Library itself.
  283. X
  284. X  6. As an exception to the Sections above, you may also compile or
  285. link a "work that uses the Library" with the Library to produce a
  286. work containing portions of the Library, and distribute that work
  287. under terms of your choice, provided that the terms permit
  288. modification of the work for the customer's own use and reverse
  289. engineering for debugging such modifications.
  290. X
  291. X  You must give prominent notice with each copy of the work that the
  292. Library is used in it and that the Library and its use are covered by
  293. this License.  You must supply a copy of this License.  If the work
  294. during execution displays copyright notices, you must include the
  295. copyright notice for the Library among them, as well as a reference
  296. directing the user to the copy of this License.  Also, you must do one
  297. of these things:
  298. X
  299. X    a) Accompany the work with the complete corresponding
  300. X    machine-readable source code for the Library including whatever
  301. X    changes were used in the work (which must be distributed under
  302. X    Sections 1 and 2 above); and, if the work is an executable linked
  303. X    with the Library, with the complete machine-readable "work that
  304. X    uses the Library", as object code and/or source code, so that the
  305. X    user can modify the Library and then relink to produce a modified
  306. X    executable containing the modified Library.  (It is understood
  307. X    that the user who changes the contents of definitions files in the
  308. X    Library will not necessarily be able to recompile the application
  309. X    to use the modified definitions.)
  310. X
  311. X    b) Accompany the work with a written offer, valid for at
  312. X    least three years, to give the same user the materials
  313. X    specified in Subsection 6a, above, for a charge no more
  314. X    than the cost of performing this distribution.
  315. X
  316. X    c) If distribution of the work is made by offering access to copy
  317. X    from a designated place, offer equivalent access to copy the above
  318. X    specified materials from the same place.
  319. X
  320. X    d) Verify that the user has already received a copy of these
  321. X    materials or that you have already sent this user a copy.
  322. X
  323. X  For an executable, the required form of the "work that uses the
  324. Library" must include any data and utility programs needed for
  325. reproducing the executable from it.  However, as a special exception,
  326. the source code distributed need not include anything that is normally
  327. distributed (in either source or binary form) with the major
  328. components (compiler, kernel, and so on) of the operating system on
  329. which the executable runs, unless that component itself accompanies
  330. the executable.
  331. X
  332. X  It may happen that this requirement contradicts the license
  333. restrictions of other proprietary libraries that do not normally
  334. accompany the operating system.  Such a contradiction means you cannot
  335. use both them and the Library together in an executable that you
  336. distribute.
  337. X
  338. X  7. You may place library facilities that are a work based on the
  339. Library side-by-side in a single library together with other library
  340. facilities not covered by this License, and distribute such a combined
  341. library, provided that the separate distribution of the work based on
  342. the Library and of the other library facilities is otherwise
  343. permitted, and provided that you do these two things:
  344. X
  345. X    a) Accompany the combined library with a copy of the same work
  346. X    based on the Library, uncombined with any other library
  347. X    facilities.  This must be distributed under the terms of the
  348. X    Sections above.
  349. X
  350. X    b) Give prominent notice with the combined library of the fact
  351. X    that part of it is a work based on the Library, and explaining
  352. X    where to find the accompanying uncombined form of the same work.
  353. X
  354. X  8. You may not copy, modify, sublicense, link with, or distribute
  355. the Library except as expressly provided under this License.  Any
  356. attempt otherwise to copy, modify, sublicense, link with, or
  357. distribute the Library is void, and will automatically terminate your
  358. rights under this License.  However, parties who have received copies,
  359. or rights, from you under this License will not have their licenses
  360. terminated so long as such parties remain in full compliance.
  361. X
  362. X  9. You are not required to accept this License, since you have not
  363. signed it.  However, nothing else grants you permission to modify or
  364. distribute the Library or its derivative works.  These actions are
  365. prohibited by law if you do not accept this License.  Therefore, by
  366. modifying or distributing the Library (or any work based on the
  367. Library), you indicate your acceptance of this License to do so, and
  368. all its terms and conditions for copying, distributing or modifying
  369. the Library or works based on it.
  370. X
  371. X  10. Each time you redistribute the Library (or any work based on the
  372. Library), the recipient automatically receives a license from the
  373. original licensor to copy, distribute, link with or modify the Library
  374. subject to these terms and conditions.  You may not impose any further
  375. restrictions on the recipients' exercise of the rights granted herein.
  376. You are not responsible for enforcing compliance by third parties to
  377. this License.
  378. X
  379. X  11. If, as a consequence of a court judgment or allegation of patent
  380. infringement or for any other reason (not limited to patent issues),
  381. conditions are imposed on you (whether by court order, agreement or
  382. otherwise) that contradict the conditions of this License, they do not
  383. excuse you from the conditions of this License.  If you cannot
  384. distribute so as to satisfy simultaneously your obligations under this
  385. License and any other pertinent obligations, then as a consequence you
  386. may not distribute the Library at all.  For example, if a patent
  387. license would not permit royalty-free redistribution of the Library by
  388. all those who receive copies directly or indirectly through you, then
  389. the only way you could satisfy both it and this License would be to
  390. refrain entirely from distribution of the Library.
  391. X
  392. If any portion of this section is held invalid or unenforceable under any
  393. particular circumstance, the balance of the section is intended to apply,
  394. and the section as a whole is intended to apply in other circumstances.
  395. X
  396. It is not the purpose of this section to induce you to infringe any
  397. patents or other property right claims or to contest validity of any
  398. such claims; this section has the sole purpose of protecting the
  399. integrity of the free software distribution system which is
  400. implemented by public license practices.  Many people have made
  401. generous contributions to the wide range of software distributed
  402. through that system in reliance on consistent application of that
  403. system; it is up to the author/donor to decide if he or she is willing
  404. to distribute software through any other system and a licensee cannot
  405. impose that choice.
  406. X
  407. This section is intended to make thoroughly clear what is believed to
  408. be a consequence of the rest of this License.
  409. X
  410. X  12. If the distribution and/or use of the Library is restricted in
  411. certain countries either by patents or by copyrighted interfaces, the
  412. original copyright holder who places the Library under this License may add
  413. an explicit geographical distribution limitation excluding those countries,
  414. so that distribution is permitted only in or among countries not thus
  415. excluded.  In such case, this License incorporates the limitation as if
  416. written in the body of this License.
  417. X
  418. X  13. The Free Software Foundation may publish revised and/or new
  419. versions of the Library General Public License from time to time.
  420. Such new versions will be similar in spirit to the present version,
  421. but may differ in detail to address new problems or concerns.
  422. X
  423. XEach version is given a distinguishing version number.  If the Library
  424. specifies a version number of this License which applies to it and
  425. X"any later version", you have the option of following the terms and
  426. conditions either of that version or of any later version published by
  427. the Free Software Foundation.  If the Library does not specify a
  428. license version number, you may choose any version ever published by
  429. the Free Software Foundation.
  430. X
  431. X  14. If you wish to incorporate parts of the Library into other free
  432. programs whose distribution conditions are incompatible with these,
  433. write to the author to ask for permission.  For software which is
  434. copyrighted by the Free Software Foundation, write to the Free
  435. Software Foundation; we sometimes make exceptions for this.  Our
  436. decision will be guided by the two goals of preserving the free status
  437. of all derivatives of our free software and of promoting the sharing
  438. and reuse of software generally.
  439. X
  440. X                NO WARRANTY
  441. X
  442. X  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
  443. WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
  444. XEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
  445. OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
  446. KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
  447. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  448. PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
  449. LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
  450. THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  451. X
  452. X  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  453. WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
  454. AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
  455. XFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
  456. CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
  457. LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
  458. RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
  459. XFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
  460. SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
  461. DAMAGES.
  462. X
  463. X             END OF TERMS AND CONDITIONS
  464. X
  465. X     Appendix: How to Apply These Terms to Your New Libraries
  466. X
  467. X  If you develop a new library, and you want it to be of the greatest
  468. possible use to the public, we recommend making it free software that
  469. everyone can redistribute and change.  You can do so by permitting
  470. redistribution under these terms (or, alternatively, under the terms of the
  471. ordinary General Public License).
  472. X
  473. X  To apply these terms, attach the following notices to the library.  It is
  474. safest to attach them to the start of each source file to most effectively
  475. convey the exclusion of warranty; and each file should have at least the
  476. X"copyright" line and a pointer to where the full notice is found.
  477. X
  478. X    <one line to give the library's name and a brief idea of what it does.>
  479. X    Copyright (C) <year>  <name of author>
  480. X
  481. X    This library is free software; you can redistribute it and/or
  482. X    modify it under the terms of the GNU Library General Public
  483. X    License as published by the Free Software Foundation; either
  484. X    version 2 of the License, or (at your option) any later version.
  485. X
  486. X    This library is distributed in the hope that it will be useful,
  487. X    but WITHOUT ANY WARRANTY; without even the implied warranty of
  488. X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  489. X    Library General Public License for more details.
  490. X
  491. X    You should have received a copy of the GNU Library General Public
  492. X    License along with this library; if not, write to the Free
  493. X    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  494. X
  495. Also add information on how to contact you by electronic and paper mail.
  496. X
  497. You should also get your employer (if you work as a programmer) or your
  498. school, if any, to sign a "copyright disclaimer" for the library, if
  499. necessary.  Here is a sample; alter the names:
  500. X
  501. X  Yoyodyne, Inc., hereby disclaims all copyright interest in the
  502. X  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
  503. X
  504. X  <signature of Ty Coon>, 1 April 1990
  505. X  Ty Coon, President of Vice
  506. X
  507. That's all there is to it!
  508. END_OF_FILE
  509. if test 25265 -ne `wc -c <'COPYING'`; then
  510.     echo shar: \"'COPYING'\" unpacked with wrong size!
  511. fi
  512. # end of 'COPYING'
  513. fi
  514. if test -f 'StdHdrs/rpc/clnt.h' -a "${1}" != "-c" ; then 
  515.   echo shar: Will not clobber existing file \"'StdHdrs/rpc/clnt.h'\"
  516. else
  517. echo shar: Extracting \"'StdHdrs/rpc/clnt.h'\" \(9383 characters\)
  518. sed "s/^X//" >'StdHdrs/rpc/clnt.h' <<'END_OF_FILE'
  519. X/* @(#)clnt.h    2.1 88/07/29 4.0 RPCSRC; from 1.31 88/02/08 SMI*/
  520. X/*
  521. X * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  522. X * unrestricted use provided that this legend is included on all tape
  523. X * media and as a part of the software program in whole or part.  Users
  524. X * may copy or modify Sun RPC without charge, but are not authorized
  525. X * to license or distribute it to anyone else except as part of a product or
  526. X * program developed by the user.
  527. X * 
  528. X * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  529. X * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  530. X * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  531. X * 
  532. X * Sun RPC is provided with no support and without any obligation on the
  533. X * part of Sun Microsystems, Inc. to assist in its use, correction,
  534. X * modification or enhancement.
  535. X * 
  536. X * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  537. X * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  538. X * OR ANY PART THEREOF.
  539. X * 
  540. X * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  541. X * or profits or other special, indirect and consequential damages, even if
  542. X * Sun has been advised of the possibility of such damages.
  543. X * 
  544. X * Sun Microsystems, Inc.
  545. X * 2550 Garcia Avenue
  546. X * Mountain View, California  94043
  547. X */
  548. X
  549. X/*
  550. X * clnt.h - Client side remote procedure call interface.
  551. X *
  552. X * Copyright (C) 1984, Sun Microsystems, Inc.
  553. X */
  554. X
  555. X#ifndef _rpc_clnt_h
  556. X#define    _rpc_clnt_h
  557. X
  558. X/*
  559. X * Rpc calls return an enum clnt_stat.  This should be looked at more,
  560. X * since each implementation is required to live with this (implementation
  561. X * independent) list of errors.
  562. X */
  563. enum clnt_stat {
  564. X    RPC_SUCCESS=0,            /* call succeeded */
  565. X    /*
  566. X     * local errors
  567. X     */
  568. X    RPC_CANTENCODEARGS=1,        /* can't encode arguments */
  569. X    RPC_CANTDECODERES=2,        /* can't decode results */
  570. X    RPC_CANTSEND=3,            /* failure in sending call */
  571. X    RPC_CANTRECV=4,            /* failure in receiving result */
  572. X    RPC_TIMEDOUT=5,            /* call timed out */
  573. X    /*
  574. X     * remote errors
  575. X     */
  576. X    RPC_VERSMISMATCH=6,        /* rpc versions not compatible */
  577. X    RPC_AUTHERROR=7,        /* authentication error */
  578. X    RPC_PROGUNAVAIL=8,        /* program not available */
  579. X    RPC_PROGVERSMISMATCH=9,        /* program version mismatched */
  580. X    RPC_PROCUNAVAIL=10,        /* procedure unavailable */
  581. X    RPC_CANTDECODEARGS=11,        /* decode arguments error */
  582. X    RPC_SYSTEMERROR=12,        /* generic "other problem" */
  583. X
  584. X    /*
  585. X     * callrpc & clnt_create errors
  586. X     */
  587. X    RPC_UNKNOWNHOST=13,        /* unknown host name */
  588. X    RPC_UNKNOWNPROTO=17,        /* unkown protocol */
  589. X
  590. X    /*
  591. X     * _ create errors
  592. X     */
  593. X    RPC_PMAPFAILURE=14,        /* the pmapper failed in its call */
  594. X    RPC_PROGNOTREGISTERED=15,    /* remote program is not registered */
  595. X    /*
  596. X     * unspecified error
  597. X     */
  598. X    RPC_FAILED=16
  599. X};
  600. X
  601. X
  602. X/*
  603. X * Error info.
  604. X */
  605. struct rpc_err {
  606. X    enum clnt_stat re_status;
  607. X    union {
  608. X        int RE_errno;        /* realated system error */
  609. X        enum auth_stat RE_why;    /* why the auth error occurred */
  610. X        struct {
  611. X            u_long low;    /* lowest verion supported */
  612. X            u_long high;    /* highest verion supported */
  613. X        } RE_vers;
  614. X        struct {        /* maybe meaningful if RPC_FAILED */
  615. X            long s1;
  616. X            long s2;
  617. X        } RE_lb;        /* life boot & debugging only */
  618. X    } ru;
  619. X#define    re_errno    ru.RE_errno
  620. X#define    re_why        ru.RE_why
  621. X#define    re_vers        ru.RE_vers
  622. X#define    re_lb        ru.RE_lb
  623. X};
  624. X
  625. X
  626. X/*
  627. X * Client rpc handle.
  628. X * Created by individual implementations, see e.g. rpc_udp.c.
  629. X * Client is responsible for initializing auth, see e.g. auth_none.c.
  630. X */
  631. typedef struct {
  632. X    AUTH    *cl_auth;            /* authenticator */
  633. X    struct clnt_ops {
  634. X        enum clnt_stat    (*cl_call)(DOTDOTDOT);    /* call remote procedure */
  635. X        void        (*cl_abort)(DOTDOTDOT);    /* abort a call */
  636. X        void        (*cl_geterr)(DOTDOTDOT);    /* get specific error code */
  637. X        bool_t        (*cl_freeres)(DOTDOTDOT); /* frees results */
  638. X        void        (*cl_destroy)(DOTDOTDOT);/* destroy this structure */
  639. X        bool_t          (*cl_control)(DOTDOTDOT);/* the ioctl() of rpc */
  640. X    } *cl_ops;
  641. X    caddr_t            cl_private;    /* private stuff */
  642. X} CLIENT;
  643. X
  644. X
  645. X/*
  646. X * client side rpc interface ops
  647. X *
  648. X * Parameter types are:
  649. X *
  650. X */
  651. X
  652. X/*
  653. X * enum clnt_stat
  654. X * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
  655. X *     CLIENT *rh;
  656. X *    u_long proc;
  657. X *    xdrproc_t xargs;
  658. X *    caddr_t argsp;
  659. X *    xdrproc_t xres;
  660. X *    caddr_t resp;
  661. X *    struct timeval timeout;
  662. X */
  663. X#define    CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs)    \
  664. X    ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
  665. X#define    clnt_call(rh, proc, xargs, argsp, xres, resp, secs)    \
  666. X    ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
  667. X
  668. X/*
  669. X * void
  670. X * CLNT_ABORT(rh);
  671. X *     CLIENT *rh;
  672. X */
  673. X#define    CLNT_ABORT(rh)    ((*(rh)->cl_ops->cl_abort)(rh))
  674. X#define    clnt_abort(rh)    ((*(rh)->cl_ops->cl_abort)(rh))
  675. X
  676. X/*
  677. X * struct rpc_err
  678. X * CLNT_GETERR(rh);
  679. X *     CLIENT *rh;
  680. X */
  681. X#define    CLNT_GETERR(rh,errp)    ((*(rh)->cl_ops->cl_geterr)(rh, errp))
  682. X#define    clnt_geterr(rh,errp)    ((*(rh)->cl_ops->cl_geterr)(rh, errp))
  683. X
  684. X
  685. X/*
  686. X * bool_t
  687. X * CLNT_FREERES(rh, xres, resp);
  688. X *     CLIENT *rh;
  689. X *    xdrproc_t xres;
  690. X *    caddr_t resp;
  691. X */
  692. X#define    CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
  693. X#define    clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
  694. X
  695. X/*
  696. X * bool_t
  697. X * CLNT_CONTROL(cl, request, info)
  698. X *      CLIENT *cl;
  699. X *      u_int request;
  700. X *      char *info;
  701. X */
  702. X#define    CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
  703. X#define    clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
  704. X
  705. X/*
  706. X * control operations that apply to both udp and tcp transports
  707. X */
  708. X#define CLSET_TIMEOUT       1   /* set timeout (timeval) */
  709. X#define CLGET_TIMEOUT       2   /* get timeout (timeval) */
  710. X#define CLGET_SERVER_ADDR   3   /* get server's address (sockaddr) */
  711. X/*
  712. X * udp only control operations
  713. X */
  714. X#define CLSET_RETRY_TIMEOUT 4   /* set retry timeout (timeval) */
  715. X#define CLGET_RETRY_TIMEOUT 5   /* get retry timeout (timeval) */
  716. X
  717. X/*
  718. X * void
  719. X * CLNT_DESTROY(rh);
  720. X *     CLIENT *rh;
  721. X */
  722. X#define    CLNT_DESTROY(rh)    ((*(rh)->cl_ops->cl_destroy)(rh))
  723. X#define    clnt_destroy(rh)    ((*(rh)->cl_ops->cl_destroy)(rh))
  724. X
  725. X
  726. X/*
  727. X * RPCTEST is a test program which is accessable on every rpc
  728. X * transport/port.  It is used for testing, performance evaluation,
  729. X * and network administration.
  730. X */
  731. X
  732. X#define RPCTEST_PROGRAM        ((u_long)1)
  733. X#define RPCTEST_VERSION        ((u_long)1)
  734. X#define RPCTEST_NULL_PROC    ((u_long)2)
  735. X#define RPCTEST_NULL_BATCH_PROC    ((u_long)3)
  736. X
  737. X/*
  738. X * By convention, procedure 0 takes null arguments and returns them
  739. X */
  740. X
  741. X#define NULLPROC ((u_long)0)
  742. X
  743. X/*
  744. X * Below are the client handle creation routines for the various
  745. X * implementations of client side rpc.  They can return NULL if a 
  746. X * creation failure occurs.
  747. X */
  748. X
  749. X/*
  750. X * Memory based rpc (for speed check and testing)
  751. X * CLIENT *
  752. X * clntraw_create(prog, vers)
  753. X *    u_long prog;
  754. X *    u_long vers;
  755. X */
  756. XEXTERN_FUNCTION(CLIENT *clntraw_create, (u_long prog, u_long vers));
  757. X
  758. X
  759. X/*
  760. X * Generic client creation routine. Supported protocols are "udp" and "tcp"
  761. X */
  762. XEXTERN_FUNCTION(CLIENT *
  763. clnt_create, (char* host, u_long prog, u_long vers, char* prot));
  764. X/*
  765. X    char *host;     -- hostname
  766. X    u_long prog;    -- program number
  767. X    u_long vers;    -- version number
  768. X    char *prot;    -- protocol
  769. X*/
  770. X
  771. X
  772. X
  773. X
  774. X/*
  775. X * TCP based rpc
  776. X * CLIENT *
  777. X * clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
  778. X *    struct sockaddr_in *raddr;
  779. X *    u_long prog;
  780. X *    u_long version;
  781. X *    register int *sockp;
  782. X *    u_int sendsz;
  783. X *    u_int recvsz;
  784. X */
  785. XEXTERN_FUNCTION(CLIENT *clnttcp_create, (struct sockaddr_in *raddr,
  786. X                     u_long prog,
  787. X                     u_long version,
  788. X                     register int *sockp,
  789. X                     u_int sendsz,
  790. X                     u_int recvsz));
  791. X
  792. X/*
  793. X * UDP based rpc.
  794. X * CLIENT *
  795. X * clntudp_create(raddr, program, version, wait, sockp)
  796. X *    struct sockaddr_in *raddr;
  797. X *    u_long program;
  798. X *    u_long version;
  799. X *    struct timeval wait;
  800. X *    int *sockp;
  801. X *
  802. X * Same as above, but you specify max packet sizes.
  803. X * CLIENT *
  804. X * clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
  805. X *    struct sockaddr_in *raddr;
  806. X *    u_long program;
  807. X *    u_long version;
  808. X *    struct timeval wait;
  809. X *    int *sockp;
  810. X *    u_int sendsz;
  811. X *    u_int recvsz;
  812. X */
  813. XEXTERN_FUNCTION(CLIENT *clntudp_create, (struct sockaddr_in *raddr,
  814. X                     u_long program,
  815. X                     u_long version,
  816. X                     struct timeval wait,
  817. X                     int *sockp));
  818. XEXTERN_FUNCTION(CLIENT *clntudp_bufcreate, (struct sockaddr_in *raddr,
  819. X                        u_long program,
  820. X                        u_long version,
  821. X                        struct timeval wait,
  822. X                        int *sockp,
  823. X                        u_int sendsz,
  824. X                        u_int recvsz));
  825. X
  826. X/*
  827. X * Print why creation failed
  828. X */
  829. XEXTERN_FUNCTION(void clnt_pcreateerror, (char *msg));    /* stderr */
  830. XEXTERN_FUNCTION(char *clnt_spcreateerror, (char *msg));    /* string */
  831. X
  832. X/*
  833. X * Like clnt_perror(), but is more verbose in its output
  834. X */
  835. XEXTERN_FUNCTION(void clnt_perrno, (enum clnt_stat num)); /* stderr */
  836. X
  837. X/*
  838. X * Print an English error message, given the client error code
  839. X */
  840. XEXTERN_FUNCTION(void clnt_perror, (CLIENT *clnt, char *msg));     /* stderr */
  841. XEXTERN_FUNCTION(char *clnt_sperror, (CLIENT *clnt, char *msg));    /* string */
  842. X
  843. X/* 
  844. X * If a creation fails, the following allows the user to figure out why.
  845. X */
  846. struct rpc_createerr {
  847. X    enum clnt_stat cf_stat;
  848. X    struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
  849. X};
  850. X
  851. extern struct rpc_createerr rpc_createerr;
  852. X
  853. X
  854. X
  855. X/*
  856. X * Copy error message to buffer.
  857. X */
  858. XEXTERN_FUNCTION(char *clnt_sperrno, (enum clnt_stat num));    /* string */
  859. X
  860. X
  861. X
  862. X#define UDPMSGSIZE    8800    /* rpc imposed limit on udp msg size */
  863. X#define RPCSMALLMSGSIZE    400    /* a more reasonable packet size */
  864. X
  865. X#endif /*!_rpc_clnt_h*/
  866. END_OF_FILE
  867. if test 9383 -ne `wc -c <'StdHdrs/rpc/clnt.h'`; then
  868.     echo shar: \"'StdHdrs/rpc/clnt.h'\" unpacked with wrong size!
  869. fi
  870. # end of 'StdHdrs/rpc/clnt.h'
  871. fi
  872. if test -f 'StdHdrs/rpc/svc.h' -a "${1}" != "-c" ; then 
  873.   echo shar: Will not clobber existing file \"'StdHdrs/rpc/svc.h'\"
  874. else
  875. echo shar: Extracting \"'StdHdrs/rpc/svc.h'\" \(9566 characters\)
  876. sed "s/^X//" >'StdHdrs/rpc/svc.h' <<'END_OF_FILE'
  877. X/* @(#)svc.h    2.2 88/07/29 4.0 RPCSRC; from 1.20 88/02/08 SMI */
  878. X/*
  879. X * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  880. X * unrestricted use provided that this legend is included on all tape
  881. X * media and as a part of the software program in whole or part.  Users
  882. X * may copy or modify Sun RPC without charge, but are not authorized
  883. X * to license or distribute it to anyone else except as part of a product or
  884. X * program developed by the user.
  885. X * 
  886. X * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  887. X * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  888. X * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  889. X * 
  890. X * Sun RPC is provided with no support and without any obligation on the
  891. X * part of Sun Microsystems, Inc. to assist in its use, correction,
  892. X * modification or enhancement.
  893. X * 
  894. X * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  895. X * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  896. X * OR ANY PART THEREOF.
  897. X * 
  898. X * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  899. X * or profits or other special, indirect and consequential damages, even if
  900. X * Sun has been advised of the possibility of such damages.
  901. X * 
  902. X * Sun Microsystems, Inc.
  903. X * 2550 Garcia Avenue
  904. X * Mountain View, California  94043
  905. X */
  906. X
  907. X/*
  908. X * svc.h, Server-side remote procedure call interface.
  909. X *
  910. X * Copyright (C) 1984, Sun Microsystems, Inc.
  911. X */
  912. X
  913. X#ifndef _rpc_svc_h
  914. X#define    _rpc_svc_h
  915. X
  916. X#include <rpc/pmap_clnt.h>
  917. X
  918. X/*
  919. X * This interface must manage two items concerning remote procedure calling:
  920. X *
  921. X * 1) An arbitrary number of transport connections upon which rpc requests
  922. X * are received.  The two most notable transports are TCP and UDP;  they are
  923. X * created and registered by routines in svc_tcp.c and svc_udp.c, respectively;
  924. X * they in turn call xprt_register and xprt_unregister.
  925. X *
  926. X * 2) An arbitrary number of locally registered services.  Services are
  927. X * described by the following four data: program number, version number,
  928. X * "service dispatch" function, a transport handle, and a boolean that
  929. X * indicates whether or not the exported program should be registered with a
  930. X * local binder service;  if true the program's number and version and the
  931. X * port number from the transport handle are registered with the binder.
  932. X * These data are registered with the rpc svc system via svc_register.
  933. X *
  934. X * A service's dispatch function is called whenever an rpc request comes in
  935. X * on a transport.  The request's program and version numbers must match
  936. X * those of the registered service.  The dispatch function is passed two
  937. X * parameters, struct svc_req * and SVCXPRT *, defined below.
  938. X */
  939. X
  940. enum xprt_stat {
  941. X    XPRT_DIED,
  942. X    XPRT_MOREREQS,
  943. X    XPRT_IDLE
  944. X};
  945. X
  946. X/*
  947. X * Server side transport handle
  948. X */
  949. typedef struct {
  950. X    int        xp_sock;
  951. X    u_short        xp_port;     /* associated port number */
  952. X    struct xp_ops {
  953. X        bool_t    (*xp_recv)(DOTDOTDOT);     /* receive incomming requests */
  954. X        enum xprt_stat (*xp_stat)(DOTDOTDOT); /* get transport status */
  955. X        bool_t    (*xp_getargs)(DOTDOTDOT); /* get arguments */
  956. X        bool_t    (*xp_reply)(DOTDOTDOT);     /* send reply */
  957. X        bool_t    (*xp_freeargs)(DOTDOTDOT);/* free mem allocated for args */
  958. X        void    (*xp_destroy)(DOTDOTDOT); /* destroy this struct */
  959. X    } *xp_ops;
  960. X    int        xp_addrlen;     /* length of remote address */
  961. X    struct sockaddr_in xp_raddr;     /* remote address */
  962. X    struct opaque_auth xp_verf;     /* raw response verifier */
  963. X    caddr_t        xp_p1;         /* private */
  964. X    caddr_t        xp_p2;         /* private */
  965. X} SVCXPRT;
  966. X
  967. X/*
  968. X *  Approved way of getting address of caller
  969. X */
  970. X#define svc_getcaller(x) (&(x)->xp_raddr)
  971. X
  972. X/*
  973. X * Operations defined on an SVCXPRT handle
  974. X *
  975. X * SVCXPRT        *xprt;
  976. X * struct rpc_msg    *msg;
  977. X * xdrproc_t         xargs;
  978. X * caddr_t         argsp;
  979. X */
  980. X#define SVC_RECV(xprt, msg)                \
  981. X    (*(xprt)->xp_ops->xp_recv)((xprt), (msg))
  982. X#define svc_recv(xprt, msg)                \
  983. X    (*(xprt)->xp_ops->xp_recv)((xprt), (msg))
  984. X
  985. X#define SVC_STAT(xprt)                    \
  986. X    (*(xprt)->xp_ops->xp_stat)(xprt)
  987. X#define svc_stat(xprt)                    \
  988. X    (*(xprt)->xp_ops->xp_stat)(xprt)
  989. X
  990. X#define SVC_GETARGS(xprt, xargs, argsp)            \
  991. X    (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
  992. X#define svc_getargs(xprt, xargs, argsp)            \
  993. X    (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
  994. X
  995. X#define SVC_REPLY(xprt, msg)                \
  996. X    (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
  997. X#define svc_reply(xprt, msg)                \
  998. X    (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
  999. X
  1000. X#define SVC_FREEARGS(xprt, xargs, argsp)        \
  1001. X    (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
  1002. X#define svc_freeargs(xprt, xargs, argsp)        \
  1003. X    (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
  1004. X
  1005. X#define SVC_DESTROY(xprt)                \
  1006. X    (*(xprt)->xp_ops->xp_destroy)(xprt)
  1007. X#define svc_destroy(xprt)                \
  1008. X    (*(xprt)->xp_ops->xp_destroy)(xprt)
  1009. X
  1010. X
  1011. X/*
  1012. X * Service request
  1013. X */
  1014. struct svc_req {
  1015. X    u_long        rq_prog;    /* service program number */
  1016. X    u_long        rq_vers;    /* service protocol version */
  1017. X    u_long        rq_proc;    /* the desired procedure */
  1018. X    struct opaque_auth rq_cred;    /* raw creds from the wire */
  1019. X    caddr_t        rq_clntcred;    /* read only cooked cred */
  1020. X    SVCXPRT    *rq_xprt;        /* associated transport */
  1021. X};
  1022. X
  1023. X
  1024. X/*
  1025. X * Service registration
  1026. X *
  1027. X * svc_register(xprt, prog, vers, dispatch, protocol)
  1028. X *    SVCXPRT *xprt;
  1029. X *    u_long prog;
  1030. X *    u_long vers;
  1031. X *    void (*dispatch)();
  1032. X *    int protocol;   like TCP or UDP, zero means do not register
  1033. X */
  1034. XEXTERN_FUNCTION(bool_t svc_register, (SVCXPRT *xprt, u_long prog, u_long vers,
  1035. X                      void (*dispatch)(struct svc_req *,
  1036. X                               SVCXPRT*),
  1037. X                      int protocol));
  1038. X
  1039. X/*
  1040. X * Service un-registration
  1041. X *
  1042. X * svc_unregister(prog, vers)
  1043. X *    u_long prog;
  1044. X *    u_long vers;
  1045. X */
  1046. XEXTERN_FUNCTION(void* svc_unregister, (u_long prog, u_long vers));
  1047. X
  1048. X/*
  1049. X * Transport registration.
  1050. X *
  1051. X * xprt_register(xprt)
  1052. X *    SVCXPRT *xprt;
  1053. X */
  1054. XEXTERN_FUNCTION(void xprt_register, (SVCXPRT* xprt));
  1055. X
  1056. X/*
  1057. X * Transport un-register
  1058. X *
  1059. X * xprt_unregister(xprt)
  1060. X *    SVCXPRT *xprt;
  1061. X */
  1062. XEXTERN_FUNCTION(void xprt_unregister, (SVCXPRT* xprt));
  1063. X
  1064. X
  1065. X
  1066. X
  1067. X/*
  1068. X * When the service routine is called, it must first check to see if it
  1069. X * knows about the procedure;  if not, it should call svcerr_noproc
  1070. X * and return.  If so, it should deserialize its arguments via 
  1071. X * SVC_GETARGS (defined above).  If the deserialization does not work,
  1072. X * svcerr_decode should be called followed by a return.  Successful
  1073. X * decoding of the arguments should be followed the execution of the
  1074. X * procedure's code and a call to svc_sendreply.
  1075. X *
  1076. X * Also, if the service refuses to execute the procedure due to too-
  1077. X * weak authentication parameters, svcerr_weakauth should be called.
  1078. X * Note: do not confuse access-control failure with weak authentication!
  1079. X *
  1080. X * NB: In pure implementations of rpc, the caller always waits for a reply
  1081. X * msg.  This message is sent when svc_sendreply is called.  
  1082. X * Therefore pure service implementations should always call
  1083. X * svc_sendreply even if the function logically returns void;  use
  1084. X * xdr.h - xdr_void for the xdr routine.  HOWEVER, tcp based rpc allows
  1085. X * for the abuse of pure rpc via batched calling or pipelining.  In the
  1086. X * case of a batched call, svc_sendreply should NOT be called since
  1087. X * this would send a return message, which is what batching tries to avoid.
  1088. X * It is the service/protocol writer's responsibility to know which calls are
  1089. X * batched and which are not.  Warning: responding to batch calls may
  1090. X * deadlock the caller and server processes!
  1091. X */
  1092. X
  1093. XEXTERN_FUNCTION(bool_t svc_sendreply, (SVCXPRT *xprt,xdrproc_t outproc,
  1094. X                       char *out));
  1095. XEXTERN_FUNCTION(void    svcerr_decode, (SVCXPRT *xprt));
  1096. XEXTERN_FUNCTION(void    svcerr_weakauth, (SVCXPRT *xprt));
  1097. XEXTERN_FUNCTION(void    svcerr_noproc, (SVCXPRT *xprt));
  1098. XEXTERN_FUNCTION(void    svcerr_progvers, (SVCXPRT *xprt));
  1099. XEXTERN_FUNCTION(void    svcerr_auth, (SVCXPRT *xprt, enum auth_stat why));
  1100. XEXTERN_FUNCTION(void    svcerr_noprog, (SVCXPRT *xprt));
  1101. XEXTERN_FUNCTION(void    svcerr_systemerr, (SVCXPRT *xprt));
  1102. X
  1103. X/*
  1104. X * Lowest level dispatching -OR- who owns this process anyway.
  1105. X * Somebody has to wait for incoming requests and then call the correct
  1106. X * service routine.  The routine svc_run does infinite waiting; i.e.,
  1107. X * svc_run never returns.
  1108. X * Since another (co-existant) package may wish to selectively wait for
  1109. X * incoming calls or other events outside of the rpc architecture, the
  1110. X * routine svc_getreq is provided.  It must be passed readfds, the
  1111. X * "in-place" results of a select system call (see select, section 2).
  1112. X */
  1113. X
  1114. X/*
  1115. X * Global keeper of rpc service descriptors in use
  1116. X * dynamic; must be inspected before each call to select 
  1117. X */
  1118. X#ifdef FD_SETSIZE
  1119. extern fd_set svc_fdset;
  1120. X#define svc_fds svc_fdset.fds_bits[0]    /* compatibility */
  1121. X#else
  1122. extern int svc_fds;
  1123. X#endif /* def FD_SETSIZE */
  1124. X
  1125. X/*
  1126. X * a small program implemented by the svc_rpc implementation itself;
  1127. X * also see clnt.h for protocol numbers.
  1128. X */
  1129. XEXTERN_FUNCTION(void rpctest_service, ());
  1130. XEXTERN_FUNCTION(void    svc_getreq, (int rdfds));
  1131. XEXTERN_FUNCTION(void    svc_getreqset, (fd_set *rdfdsp)); /* takes fdset instead of int */
  1132. XEXTERN_FUNCTION(void    svc_run, ());        /* never returns */
  1133. X
  1134. X/*
  1135. X * Socket to use on svcxxx_create call to get default socket
  1136. X */
  1137. X#define    RPC_ANYSOCK    -1
  1138. X
  1139. X/*
  1140. X * These are the existing service side transport implementations
  1141. X */
  1142. X
  1143. X/*
  1144. X * Memory based rpc for testing and timing.
  1145. X */
  1146. XEXTERN_FUNCTION(SVCXPRT *svcraw_create, ());
  1147. X
  1148. X/*
  1149. X * Udp based rpc.
  1150. X */
  1151. XEXTERN_FUNCTION(SVCXPRT *svcudp_create, (int sock));
  1152. XEXTERN_FUNCTION(SVCXPRT *svcudp_bufcreate, (int sock, u_int sendsz,
  1153. X                        u_int recvsz));
  1154. X
  1155. X/*
  1156. X * Tcp based rpc.
  1157. X */
  1158. XEXTERN_FUNCTION(SVCXPRT *svctcp_create, (int fd, u_int sendsz, u_int recvsz));
  1159. X
  1160. X
  1161. X
  1162. X#endif /*!_rpc_svc_h*/
  1163. END_OF_FILE
  1164. if test 9566 -ne `wc -c <'StdHdrs/rpc/svc.h'`; then
  1165.     echo shar: \"'StdHdrs/rpc/svc.h'\" unpacked with wrong size!
  1166. fi
  1167. # end of 'StdHdrs/rpc/svc.h'
  1168. fi
  1169. if test -f 'StdHdrs/rpc/xdr.h' -a "${1}" != "-c" ; then 
  1170.   echo shar: Will not clobber existing file \"'StdHdrs/rpc/xdr.h'\"
  1171. else
  1172. echo shar: Extracting \"'StdHdrs/rpc/xdr.h'\" \(10878 characters\)
  1173. sed "s/^X//" >'StdHdrs/rpc/xdr.h' <<'END_OF_FILE'
  1174. X/* @(#)xdr.h    2.2 88/07/29 4.0 RPCSRC */
  1175. X/*
  1176. X * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  1177. X * unrestricted use provided that this legend is included on all tape
  1178. X * media and as a part of the software program in whole or part.  Users
  1179. X * may copy or modify Sun RPC without charge, but are not authorized
  1180. X * to license or distribute it to anyone else except as part of a product or
  1181. X * program developed by the user.
  1182. X * 
  1183. X * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  1184. X * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  1185. X * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  1186. X * 
  1187. X * Sun RPC is provided with no support and without any obligation on the
  1188. X * part of Sun Microsystems, Inc. to assist in its use, correction,
  1189. X * modification or enhancement.
  1190. X * 
  1191. X * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  1192. X * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  1193. X * OR ANY PART THEREOF.
  1194. X * 
  1195. X * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  1196. X * or profits or other special, indirect and consequential damages, even if
  1197. X * Sun has been advised of the possibility of such damages.
  1198. X * 
  1199. X * Sun Microsystems, Inc.
  1200. X * 2550 Garcia Avenue
  1201. X * Mountain View, California  94043
  1202. X */
  1203. X/*      @(#)xdr.h 1.19 87/04/22 SMI      */
  1204. X
  1205. X/*
  1206. X * xdr.h, External Data Representation Serialization Routines.
  1207. X *
  1208. X * Copyright (C) 1984, Sun Microsystems, Inc.
  1209. X */
  1210. X
  1211. X#ifndef _rpc_xdr_h
  1212. X#define    _rpc_xdr_h
  1213. X
  1214. X#include <rpc/c_types.h>
  1215. X#include <rpc/types.h>
  1216. X#include <stdio.h>
  1217. X/*
  1218. X * XDR provides a conventional way for converting between C data
  1219. X * types and an external bit-string representation.  Library supplied
  1220. X * routines provide for the conversion on built-in C data types.  These
  1221. X * routines and utility routines defined here are used to help implement
  1222. X * a type encode/decode routine for each user-defined type.
  1223. X *
  1224. X * Each data type provides a single procedure which takes two arguments:
  1225. X *
  1226. X *    bool_t
  1227. X *    xdrproc(xdrs, argresp)
  1228. X *        XDR *xdrs;
  1229. X *        <type> *argresp;
  1230. X *
  1231. X * xdrs is an instance of a XDR handle, to which or from which the data
  1232. X * type is to be converted.  argresp is a pointer to the structure to be
  1233. X * converted.  The XDR handle contains an operation field which indicates
  1234. X * which of the operations (ENCODE, DECODE * or FREE) is to be performed.
  1235. X *
  1236. X * XDR_DECODE may allocate space if the pointer argresp is null.  This
  1237. X * data can be freed with the XDR_FREE operation.
  1238. X *
  1239. X * We write only one procedure per data type to make it easy
  1240. X * to keep the encode and decode procedures for a data type consistent.
  1241. X * In many cases the same code performs all operations on a user defined type,
  1242. X * because all the hard work is done in the component type routines.
  1243. X * decode as a series of calls on the nested data types.
  1244. X */
  1245. X
  1246. X/*
  1247. X * Xdr operations.  XDR_ENCODE causes the type to be encoded into the
  1248. X * stream.  XDR_DECODE causes the type to be extracted from the stream.
  1249. X * XDR_FREE can be used to release the space allocated by an XDR_DECODE
  1250. X * request.
  1251. X */
  1252. enum xdr_op {
  1253. X    XDR_ENCODE=0,
  1254. X    XDR_DECODE=1,
  1255. X    XDR_FREE=2
  1256. X};
  1257. X
  1258. X/*
  1259. X * This is the number of bytes per unit of external data.
  1260. X */
  1261. X#define BYTES_PER_XDR_UNIT    (4)
  1262. X#define RNDUP(x)  ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \
  1263. X            * BYTES_PER_XDR_UNIT)
  1264. X
  1265. X/*
  1266. X * The XDR handle.
  1267. X * Contains operation which is being applied to the stream,
  1268. X * an operations vector for the paticular implementation (e.g. see xdr_mem.c),
  1269. X * and two private fields for the use of the particular impelementation.
  1270. X */
  1271. typedef struct XDR{
  1272. X    enum xdr_op    x_op;        /* operation; fast additional param */
  1273. X    struct xdr_ops {
  1274. X        bool_t    (*x_getlong) FUN_ARGS((struct XDR*, long*));
  1275. X                /* get a long from underlying stream */
  1276. X        bool_t    (*x_putlong) FUN_ARGS((struct XDR*, long*));
  1277. X                /* put a long to " */
  1278. X        bool_t    (*x_getbytes) FUN_ARGS((struct XDR*, void*, u_int));
  1279. X                /* get some bytes from " */
  1280. X        bool_t    (*x_putbytes) FUN_ARGS((struct XDR*, void*, u_int));
  1281. X                /* put some bytes to " */
  1282. X        u_int    (*x_getpostn) FUN_ARGS((struct XDR*));
  1283. X                /* returns bytes off from beginning */
  1284. X        bool_t  (*x_setpostn) FUN_ARGS((struct XDR*, u_int));
  1285. X                /* lets you reposition the stream */
  1286. X        long *    (*x_inline) FUN_ARGS((struct XDR*, u_int));
  1287. X                /* buf quick ptr to buffered data */
  1288. X        void    (*x_destroy) FUN_ARGS((struct XDR*));
  1289. X                /* free privates of this xdr_stream */
  1290. X    } *x_ops;
  1291. X    caddr_t     x_public;    /* users' data */
  1292. X    caddr_t        x_private;    /* pointer to private data */
  1293. X    caddr_t     x_base;        /* private used for position info */
  1294. X    int        x_handy;    /* extra private word */
  1295. X} XDR;
  1296. X
  1297. X/*
  1298. X * A xdrproc_t exists for each data type which is to be encoded or decoded.
  1299. X *
  1300. X * The second argument to the xdrproc_t is a pointer to an opaque pointer.
  1301. X * The opaque pointer generally points to a structure of the data type
  1302. X * to be decoded.  If this pointer is 0, then the type routines should
  1303. X * allocate dynamic storage of the appropriate size and return it.
  1304. X * bool_t    (*xdrproc_t)(XDR *, caddr_t *);
  1305. X */
  1306. typedef    bool_t (*xdrproc_t) FUN_ARGS((XDR*, void*));
  1307. X
  1308. X/*
  1309. X * Operations defined on a XDR handle
  1310. X *
  1311. X * XDR        *xdrs;
  1312. X * long        *longp;
  1313. X * caddr_t     addr;
  1314. X * u_int     len;
  1315. X * u_int     pos;
  1316. X */
  1317. X#define XDR_GETLONG(xdrs, longp)            \
  1318. X    (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
  1319. X#define xdr_getlong(xdrs, longp)            \
  1320. X    (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
  1321. X
  1322. X#define XDR_PUTLONG(xdrs, longp)            \
  1323. X    (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
  1324. X#define xdr_putlong(xdrs, longp)            \
  1325. X    (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
  1326. X
  1327. X#define XDR_GETBYTES(xdrs, addr, len)            \
  1328. X    (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
  1329. X#define xdr_getbytes(xdrs, addr, len)            \
  1330. X    (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
  1331. X
  1332. X#define XDR_PUTBYTES(xdrs, addr, len)            \
  1333. X    (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
  1334. X#define xdr_putbytes(xdrs, addr, len)            \
  1335. X    (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
  1336. X
  1337. X#define XDR_GETPOS(xdrs)                \
  1338. X    (*(xdrs)->x_ops->x_getpostn)(xdrs)
  1339. X#define xdr_getpos(xdrs)                \
  1340. X    (*(xdrs)->x_ops->x_getpostn)(xdrs)
  1341. X
  1342. X#define XDR_SETPOS(xdrs, pos)                \
  1343. X    (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
  1344. X#define xdr_setpos(xdrs, pos)                \
  1345. X    (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
  1346. X
  1347. X#define    XDR_INLINE(xdrs, len)                \
  1348. X    (*(xdrs)->x_ops->x_inline)(xdrs, len)
  1349. X#define    xdr_inline(xdrs, len)                \
  1350. X    (*(xdrs)->x_ops->x_inline)(xdrs, len)
  1351. X
  1352. X#define    XDR_DESTROY(xdrs)                \
  1353. X    if ((xdrs)->x_ops->x_destroy)             \
  1354. X        (*(xdrs)->x_ops->x_destroy)(xdrs)
  1355. X#define    xdr_destroy(xdrs)                \
  1356. X    if ((xdrs)->x_ops->x_destroy)             \
  1357. X        (*(xdrs)->x_ops->x_destroy)(xdrs)
  1358. X
  1359. X/*
  1360. X * Support struct for discriminated unions.
  1361. X * You create an array of xdrdiscrim structures, terminated with
  1362. X * a entry with a null procedure pointer.  The xdr_union routine gets
  1363. X * the discriminant value and then searches the array of structures
  1364. X * for a matching value.  If a match is found the associated xdr routine
  1365. X * is called to handle that part of the union.  If there is
  1366. X * no match, then a default routine may be called.
  1367. X * If there is no match and no default routine it is an error.
  1368. X */
  1369. X#define NULL_xdrproc_t ((xdrproc_t)0)
  1370. struct xdr_discrim {
  1371. X    int    value;
  1372. X    xdrproc_t proc;
  1373. X};
  1374. X
  1375. X/*
  1376. X * In-line routines for fast encode/decode of primitve data types.
  1377. X * Caveat emptor: these use single memory cycles to get the
  1378. X * data from the underlying buffer, and will fail to operate
  1379. X * properly if the data is not aligned.  The standard way to use these
  1380. X * is to say:
  1381. X *    if ((buf = XDR_INLINE(xdrs, count)) == NULL)
  1382. X *        return (FALSE);
  1383. X *    <<< macro calls >>>
  1384. X * where ``count'' is the number of bytes of data occupied
  1385. X * by the primitive data types.
  1386. X *
  1387. X * N.B. and frozen for all time: each data type here uses 4 bytes
  1388. X * of external representation.
  1389. X */
  1390. X#define IXDR_GET_LONG(buf)        ((long)ntohl((u_long)*(buf)++))
  1391. X#define IXDR_PUT_LONG(buf, v)        (*(buf)++ = (long)htonl((u_long)v))
  1392. X
  1393. X#define IXDR_GET_BOOL(buf)        ((bool_t)IXDR_GET_LONG(buf))
  1394. X#define IXDR_GET_ENUM(buf, t)        ((t)IXDR_GET_LONG(buf))
  1395. X#define IXDR_GET_U_LONG(buf)        ((u_long)IXDR_GET_LONG(buf))
  1396. X#define IXDR_GET_SHORT(buf)        ((short)IXDR_GET_LONG(buf))
  1397. X#define IXDR_GET_U_SHORT(buf)        ((u_short)IXDR_GET_LONG(buf))
  1398. X
  1399. X#define IXDR_PUT_BOOL(buf, v)        IXDR_PUT_LONG((buf), ((long)(v)))
  1400. X#define IXDR_PUT_ENUM(buf, v)        IXDR_PUT_LONG((buf), ((long)(v)))
  1401. X#define IXDR_PUT_U_LONG(buf, v)        IXDR_PUT_LONG((buf), ((long)(v)))
  1402. X#define IXDR_PUT_SHORT(buf, v)        IXDR_PUT_LONG((buf), ((long)(v)))
  1403. X#define IXDR_PUT_U_SHORT(buf, v)    IXDR_PUT_LONG((buf), ((long)(v)))
  1404. X
  1405. X/*
  1406. X * These are the "generic" xdr routines.
  1407. X */
  1408. XEXTERN_FUNCTION(bool_t    xdr_void, ());
  1409. XEXTERN_FUNCTION(bool_t    xdr_int, (XDR*, int*));
  1410. XEXTERN_FUNCTION(bool_t    xdr_u_int, (XDR*, u_int*));
  1411. XEXTERN_FUNCTION(bool_t    xdr_long, (XDR*, long*));
  1412. XEXTERN_FUNCTION(bool_t    xdr_u_long, (XDR*, u_long*));
  1413. XEXTERN_FUNCTION(bool_t    xdr_short, (XDR*, short*));
  1414. XEXTERN_FUNCTION(bool_t    xdr_u_short, (XDR*, u_short*));
  1415. XEXTERN_FUNCTION(bool_t    xdr_bool, (XDR*, bool_t*));
  1416. XEXTERN_FUNCTION(bool_t    xdr_enum, (XDR*, enum_t*));
  1417. XEXTERN_FUNCTION(bool_t    xdr_array, (XDR*, void**, u_int*, u_int, u_int, xdrproc_t));
  1418. XEXTERN_FUNCTION(bool_t    xdr_bytes, (XDR*, void**, u_int*, u_int));
  1419. XEXTERN_FUNCTION(bool_t    xdr_opaque, (XDR*, void*, u_int));
  1420. XEXTERN_FUNCTION(bool_t    xdr_string, (XDR*, char**, u_int));
  1421. XEXTERN_FUNCTION(bool_t    xdr_union, (XDR*, enum_t*, void*, struct xdr_discrim*, bool_t (*)()));
  1422. XEXTERN_FUNCTION(void    xdr_free, (xdrproc_t, void*));
  1423. XEXTERN_FUNCTION(bool_t    xdr_char, (XDR*, char*));
  1424. XEXTERN_FUNCTION(bool_t    xdr_u_char, (XDR*, u_char*));
  1425. XEXTERN_FUNCTION(bool_t    xdr_vector, (XDR*, void*, u_int, u_int, xdrproc_t));
  1426. XEXTERN_FUNCTION(bool_t    xdr_float, (XDR*, float*));
  1427. XEXTERN_FUNCTION(bool_t    xdr_double, (XDR*, double*));
  1428. XEXTERN_FUNCTION(bool_t    xdr_reference, (XDR*, void**, u_int, xdrproc_t));
  1429. XEXTERN_FUNCTION(bool_t    xdr_pointer, (XDR*, void**, u_int, xdrproc_t));
  1430. XEXTERN_FUNCTION(bool_t    xdr_wrapstring, (XDR*, char**));
  1431. X
  1432. X/*
  1433. X * Common opaque bytes objects used by many rpc protocols;
  1434. X * declared here due to commonality.
  1435. X */
  1436. X#define MAX_NETOBJ_SZ 1024 
  1437. struct netobj {
  1438. X    u_int    n_len;
  1439. X    char    *n_bytes;
  1440. X};
  1441. typedef struct netobj netobj;
  1442. XEXTERN_FUNCTION(bool_t    xdr_netobj, ());
  1443. X
  1444. X/*
  1445. X * These are the public routines for the various implementations of
  1446. X * xdr streams.
  1447. X */
  1448. XEXTERN_FUNCTION(void    xdrmem_create, (XDR*, void*, u_int, enum xdr_op));
  1449. X                        /* XDR using memory buffers */
  1450. XEXTERN_FUNCTION(void    xdrstdio_create, (XDR*, FILE*, enum xdr_op));
  1451. X                        /* XDR using stdio library */
  1452. XEXTERN_FUNCTION(void    xdrrec_create, (XDR*, u_int, u_int, void*, int(*)(), int(*)()));
  1453. X                        /* XDR pseudo records for tcp */
  1454. XEXTERN_FUNCTION(bool_t    xdrrec_endofrecord, (XDR*, bool_t));
  1455. X                        /* make end of xdr record */
  1456. XEXTERN_FUNCTION(int    xdrrec_readbytes, (XDR*, void*, u_int));
  1457. X                        /* like a read on a pipe */
  1458. XEXTERN_FUNCTION(bool_t    xdrrec_skiprecord, (XDR*));
  1459. X                        /* move to beginning of next record */
  1460. XEXTERN_FUNCTION(bool_t    xdrrec_eof, (XDR*));
  1461. X                        /* true if no more input */
  1462. X
  1463. X#endif /*!_rpc_xdr_h*/
  1464. END_OF_FILE
  1465. if test 10878 -ne `wc -c <'StdHdrs/rpc/xdr.h'`; then
  1466.     echo shar: \"'StdHdrs/rpc/xdr.h'\" unpacked with wrong size!
  1467. fi
  1468. # end of 'StdHdrs/rpc/xdr.h'
  1469. fi
  1470. if test -f 'rpc++/callback.h' -a "${1}" != "-c" ; then 
  1471.   echo shar: Will not clobber existing file \"'rpc++/callback.h'\"
  1472. else
  1473. echo shar: Extracting \"'rpc++/callback.h'\" \(22467 characters\)
  1474. sed "s/^X//" >'rpc++/callback.h' <<'END_OF_FILE'
  1475. X// -*- c++ -*-
  1476. X/*
  1477. Copyright (C) 1991 Peter Bersen
  1478. X
  1479. This file is part of the rpc++ Library.  This library is free
  1480. software; you can redistribute it and/or modify it under the terms of
  1481. the GNU Library General Public License as published by the Free
  1482. Software Foundation; either version 2 of the License, or (at your
  1483. option) any later version.  This library is distributed in the hope
  1484. that it will be useful, but WITHOUT ANY WARRANTY; without even the
  1485. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  1486. PURPOSE.  See the GNU Library General Public License for more details.
  1487. You should have received a copy of the GNU Library General Public
  1488. License along with this library; if not, write to the Free Software
  1489. XFoundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  1490. X
  1491. Modified and partially rewritten March 1992 by Michael N. Lipp,
  1492. mnl@dtro.e-technik.th-darmstadt.de. The original copyright terms and
  1493. conditions apply without change to any modified or new parts.
  1494. X*/
  1495. X
  1496. X#ifndef _RPCCALLBACK_H_
  1497. X#define _RPCCALLBACK_H_
  1498. static char _rpcpp_callback_h_[]
  1499. X= "callback.h,v 2.3 1992/06/15 19:13:26 mnl Exp";
  1500. X
  1501. X// callback.h,v
  1502. X// Revision 2.3  1992/06/15  19:13:26  mnl
  1503. X// Fixed a few bugs, clarified interface.
  1504. X//
  1505. X// Revision 2.2  1992/06/13  14:27:37  mnl
  1506. X// Adapted to (patched) gcc-2.2. Fixed several bugs.
  1507. X//
  1508. X// Revision 2.1.1.1  1992/03/08  13:28:43  mnl
  1509. X// Initial mnl version.
  1510. X//
  1511. X
  1512. X//
  1513. X// The user interface to RpcCallback is quiet simple. The only function
  1514. X// needed is the constructor "RpcCallback (T* o, void* m)". Given a class
  1515. X// C with a method m and an object o of Type C, a callback to the method
  1516. X// can be constructed with "RpcCallback<C> (&O, &C::m)".
  1517. X//     As an alternative, an RpcExtCallback may be constructed with
  1518. X// "RpcExtCallback (T* o, void* m, RpcService*)". In this case, the method
  1519. X// is called with a pointer to the RpcService object as a third argument.
  1520. X//
  1521. X//     A pointer to a callback can be casted to AnyRpcCallback by
  1522. X// whatever routine receives it and the call can be made by applying "Do"
  1523. X// to the callback.
  1524. X//
  1525. X
  1526. class RpcService;
  1527. X
  1528. class AnyRpcCallback
  1529. X{
  1530. X  friend class RpcService;
  1531. X
  1532. protected:
  1533. X  int params;
  1534. X  RpcService* svc;
  1535. X  virtual void* Do (void** in) = 0;
  1536. X
  1537. public:
  1538. X  inline virtual ~AnyRpcCallback () {}
  1539. X  inline virtual AnyRpcCallback* CopyToHeap () const = 0;
  1540. X  inline int Params () const
  1541. X    { return params; }
  1542. X  inline void SetService (RpcService* s)
  1543. X    { svc = s; }
  1544. X};
  1545. X
  1546. class RpcCallback : public AnyRpcCallback
  1547. X{
  1548. private:
  1549. X  typedef void* (*ProcN)(void**);
  1550. X  typedef void* (*Proc0)();
  1551. X  typedef void* (*Proc1)(void*);
  1552. X  typedef void* (*Proc2)(void*, void*);
  1553. X  typedef void* (*Proc3)(void*, void*, void*);
  1554. X  typedef void* (*Proc4)(void*, void*, void*, void*);
  1555. X  typedef void* (*Proc5)(void*, void*, void*, void*, void*);
  1556. X  typedef void* (*Proc6)(void*, void*, void*, void*, void*, void*);
  1557. X  typedef void* (*Proc7)(void*, void*, void*, void*, void*, void*, void*);
  1558. X
  1559. X  typedef void (*ProcNv)(void**);
  1560. X  typedef void (*Proc0v)();
  1561. X  typedef void (*Proc1v)(void*);
  1562. X  typedef void (*Proc2v)(void*, void*);
  1563. X  typedef void (*Proc3v)(void*, void*, void*);
  1564. X  typedef void (*Proc4v)(void*, void*, void*, void*);
  1565. X  typedef void (*Proc5v)(void*, void*, void*, void*, void*);
  1566. X  typedef void (*Proc6v)(void*, void*, void*, void*, void*, void*);
  1567. X  typedef void (*Proc7v)(void*, void*, void*, void*, void*, void*, void*);
  1568. X
  1569. X  typedef void* (*ProcNs)(void**, RpcService*);
  1570. X  typedef void* (*Proc0s)(RpcService*);
  1571. X  typedef void* (*Proc1s)(void*, RpcService*);
  1572. X  typedef void* (*Proc2s)(void*, void*, RpcService*);
  1573. X  typedef void* (*Proc3s)(void*, void*, void*, RpcService*);
  1574. X  typedef void* (*Proc4s)(void*, void*, void*, void*, RpcService*);
  1575. X  typedef void* (*Proc5s)(void*, void*, void*, void*, void*, RpcService*);
  1576. X  typedef void* (*Proc6s)(void*, void*, void*, void*,
  1577. X                   void*, void*, RpcService*);
  1578. X  typedef void* (*Proc7s)(void*, void*, void*, void*,
  1579. X                   void*, void*, void*, RpcService*);
  1580. X
  1581. X  typedef void (*ProcNvs)(void**, RpcService*);
  1582. X  typedef void (*Proc0vs)(RpcService*);
  1583. X  typedef void (*Proc1vs)(void*, RpcService*);
  1584. X  typedef void (*Proc2vs)(void*, void*, RpcService*);
  1585. X  typedef void (*Proc3vs)(void*, void*, void*, RpcService*);
  1586. X  typedef void (*Proc4vs)(void*, void*, void*, void*, RpcService*);
  1587. X  typedef void (*Proc5vs)(void*, void*, void*, void*, void*, RpcService*);
  1588. X  typedef void (*Proc6vs)(void*, void*, void*, void*,
  1589. X                   void*, void*, RpcService*);
  1590. X  typedef void (*Proc7vs)(void*, void*, void*, void*,
  1591. X                   void*, void*, void*, RpcService*);
  1592. X
  1593. X  typedef void* (RpcCallback::*DoPtr)(void**);
  1594. X  DoPtr todo;
  1595. X  union
  1596. X    {
  1597. X      ProcN procN;ProcNv procNv;ProcNs procNs;ProcNvs procNvs;
  1598. X      Proc0 proc0;Proc0v proc0v;Proc0s proc0s;Proc0vs proc0vs;
  1599. X      Proc1 proc1;Proc1v proc1v;Proc1s proc1s;Proc1vs proc1vs;
  1600. X      Proc2 proc2;Proc2v proc2v;Proc2s proc2s;Proc2vs proc2vs;
  1601. X      Proc3 proc3;Proc3v proc3v;Proc3s proc3s;Proc3vs proc3vs;
  1602. X      Proc4 proc4;Proc4v proc4v;Proc4s proc4s;Proc4vs proc4vs;
  1603. X      Proc5 proc5;Proc5v proc5v;Proc5s proc5s;Proc5vs proc5vs;
  1604. X      Proc6 proc6;Proc6v proc6v;Proc6s proc6s;Proc6vs proc6vs;
  1605. X      Proc7 proc7;Proc7v proc7v;Proc7s proc7s;Proc7vs proc7vs;
  1606. X    };
  1607. X  inline RpcCallback () {}
  1608. X  inline void* Do (void** in)
  1609. X    { return (this->*todo)(in); }
  1610. X
  1611. X  inline void* DoN (void** in)
  1612. X    { return (*procN)(in); }
  1613. X  inline void* Do0 (void** in)
  1614. X    { return (*proc0)(); }
  1615. X  inline void* Do1 (void** in)
  1616. X    { return (*proc1)(in[0]); }
  1617. X  inline void* Do2 (void** in)
  1618. X    { return (*proc2)(in[0], in[1]); }
  1619. X  inline void* Do3 (void** in)
  1620. X    { return (*proc3)(in[0], in[1], in[2]); }
  1621. X  inline void* Do4 (void** in)
  1622. X    { return (*proc4)(in[0], in[1], in[2], in[3]); }
  1623. X  inline void* Do5 (void** in)
  1624. X    { return (*proc5)(in[0], in[1], in[2], in[3], in[4]); }
  1625. X  inline void* Do6 (void** in)
  1626. X    { return (*proc6)(in[0], in[1], in[2], in[3], in[4], in[5]); }
  1627. X  inline void* Do7 (void** in)
  1628. X    { return (*proc7)(in[0], in[1], in[2], in[3], in[4], in[5], in[6]); }
  1629. X  inline void* DoNv (void** in)
  1630. X    { (*procNv)(in); return (void*)0; }
  1631. X  inline void* Do0v (void** in)
  1632. X    { (*proc0v)(); return (void*)0; }
  1633. X  inline void* Do1v (void** in)
  1634. X    { (*proc1v)(in[0]); return (void*)0; }
  1635. X  inline void* Do2v (void** in)
  1636. X    { (*proc2v)(in[0], in[1]); return (void*)0; }
  1637. X  inline void* Do3v (void** in)
  1638. X    { (*proc3v)(in[0], in[1], in[2]); return (void*)0; }
  1639. X  inline void* Do4v (void** in)
  1640. X    { (*proc4v)(in[0], in[1], in[2], in[3]); return (void*)0; }
  1641. X  inline void* Do5v (void** in)
  1642. X    { (*proc5v)(in[0], in[1], in[2], in[3], in[4]); return (void*)0; }
  1643. X  inline void* Do6v (void** in)
  1644. X    { (*proc6v)(in[0], in[1], in[2], in[3], in[4], in[5]); return (void*)0; }
  1645. X  inline void* Do7v (void** in)
  1646. X    { (*proc7v)(in[0], in[1], in[2], in[3], in[4], in[5], in[6]);
  1647. X      return (void*)0; }
  1648. X
  1649. X  inline void* DoNs (void** in)
  1650. X    { return (*procNs)(in, svc); }
  1651. X  inline void* Do0s (void** in)
  1652. X    { return (*proc0s)(svc); }
  1653. X  inline void* Do1s (void** in)
  1654. X    { return (*proc1s)(in[0], svc); }
  1655. X  inline void* Do2s (void** in)
  1656. X    { return (*proc2s)(in[0], in[1], svc); }
  1657. X  inline void* Do3s (void** in)
  1658. X    { return (*proc3s)(in[0], in[1], in[2], svc); }
  1659. X  inline void* Do4s (void** in)
  1660. X    { return (*proc4s)(in[0], in[1], in[2], in[3], svc); }
  1661. X  inline void* Do5s (void** in)
  1662. X    { return (*proc5s)(in[0], in[1], in[2], in[3], in[4], svc); }
  1663. X  inline void* Do6s (void** in)
  1664. X    { return (*proc6s)(in[0], in[1], in[2], in[3], in[4], in[5], svc); }
  1665. X  inline void* Do7s (void** in)
  1666. X    { return (*proc7s)(in[0], in[1], in[2], in[3], in[4], in[5], in[6], svc); }
  1667. X  inline void* DoNvs (void** in)
  1668. X    { (*procNvs)(in, svc); return (void*)0; }
  1669. X  inline void* Do0vs (void** in)
  1670. X    { (*proc0vs)(svc); return (void*)0; }
  1671. X  inline void* Do1vs (void** in)
  1672. X    { (*proc1vs)(in[0], svc); return (void*)0; }
  1673. X  inline void* Do2vs (void** in)
  1674. X    { (*proc2vs)(in[0], in[1], svc); return (void*)0; }
  1675. X  inline void* Do3vs (void** in)
  1676. X    { (*proc3vs)(in[0], in[1], in[2], svc); return (void*)0; }
  1677. X  inline void* Do4vs (void** in)
  1678. X    { (*proc4vs)(in[0], in[1], in[2], in[3], svc); return (void*)0; }
  1679. X  inline void* Do5vs (void** in)
  1680. X    { (*proc5vs)(in[0], in[1], in[2], in[3], in[4], svc); return (void*)0; }
  1681. X  inline void* Do6vs (void** in)
  1682. X    { (*proc6vs)(in[0], in[1], in[2], in[3], in[4], in[5], svc);
  1683. X      return (void*)0; }
  1684. X  inline void* Do7vs (void** in)
  1685. X    { (*proc7vs)(in[0], in[1], in[2], in[3],
  1686. X           in[4], in[5], in[6], svc); return (void*)0; }
  1687. X
  1688. public:
  1689. X  inline RpcCallback (ProcN p)
  1690. X    { todo = &this->DoN; procN = p; params = -1; }
  1691. X  inline RpcCallback (Proc0 p)
  1692. X    { todo = &this->Do0; proc0 = p; params = 0; }
  1693. X  inline RpcCallback (Proc1 p)
  1694. X    { todo = &this->Do1; proc1 = p; params = 1; }
  1695. X  inline RpcCallback (Proc2 p)
  1696. X    { todo = &this->Do2; proc2 = p; params = 2; }
  1697. X  inline RpcCallback (Proc3 p)
  1698. X    { todo = &this->Do3; proc3 = p; params = 3; }
  1699. X  inline RpcCallback (Proc4 p)
  1700. X    { todo = &this->Do4; proc4 = p; params = 4; }
  1701. X  inline RpcCallback (Proc5 p)
  1702. X    { todo = &this->Do5; proc5 = p; params = 5; }
  1703. X  inline RpcCallback (Proc6 p)
  1704. X    { todo = &this->Do6; proc6 = p; params = 6; }
  1705. X  inline RpcCallback (Proc7 p)
  1706. X    { todo = &this->Do7; proc7 = p; params = 7; }
  1707. X
  1708. X  inline RpcCallback (ProcNv p)
  1709. X    { todo = &this->DoNv; procNv = p; params = -1; }
  1710. X  inline RpcCallback (Proc0v p)
  1711. X    { todo = &this->Do0v; proc0v = p; params = 0; }
  1712. X  inline RpcCallback (Proc1v p)
  1713. X    { todo = &this->Do1v; proc1v = p; params = 1; }
  1714. X  inline RpcCallback (Proc2v p)
  1715. X    { todo = &this->Do2v; proc2v = p; params = 2; }
  1716. X  inline RpcCallback (Proc3v p)
  1717. X    { todo = &this->Do3v; proc3v = p; params = 3; }
  1718. X  inline RpcCallback (Proc4v p)
  1719. X    { todo = &this->Do4v; proc4v = p; params = 4; }
  1720. X  inline RpcCallback (Proc5v p)
  1721. X    { todo = &this->Do5v; proc5v = p; params = 5; }
  1722. X  inline RpcCallback (Proc6v p)
  1723. X    { todo = &this->Do6v; proc6v = p; params = 6; }
  1724. X  inline RpcCallback (Proc7v p)
  1725. X    { todo = &this->Do7v; proc7v = p; params = 7; }
  1726. X
  1727. X  inline RpcCallback (ProcNs p)
  1728. X    { todo = &this->DoNs; procNs = p; params = -1; }
  1729. X  inline RpcCallback (Proc0s p)
  1730. X    { todo = &this->Do0s; proc0s = p; params = 0; }
  1731. X  inline RpcCallback (Proc1s p)
  1732. X    { todo = &this->Do1s; proc1s = p; params = 1; }
  1733. X  inline RpcCallback (Proc2s p)
  1734. X    { todo = &this->Do2s; proc2s = p; params = 2; }
  1735. X  inline RpcCallback (Proc3s p)
  1736. X    { todo = &this->Do3s; proc3s = p; params = 3; }
  1737. X  inline RpcCallback (Proc4s p)
  1738. X    { todo = &this->Do4s; proc4s = p; params = 4; }
  1739. X  inline RpcCallback (Proc5s p)
  1740. X    { todo = &this->Do5s; proc5s = p; params = 5; }
  1741. X  inline RpcCallback (Proc6s p)
  1742. X    { todo = &this->Do6s; proc6s = p; params = 6; }
  1743. X  inline RpcCallback (Proc7s p)
  1744. X    { todo = &this->Do7s; proc7s = p; params = 7; }
  1745. X
  1746. X  inline RpcCallback (ProcNvs p)
  1747. X    { todo = &this->DoNvs; procNvs = p; params = -1; }
  1748. X  inline RpcCallback (Proc0vs p)
  1749. X    { todo = &this->Do0vs; proc0vs = p; params = 0; }
  1750. X  inline RpcCallback (Proc1vs p)
  1751. X    { todo = &this->Do1vs; proc1vs = p; params = 1; }
  1752. X  inline RpcCallback (Proc2vs p)
  1753. X    { todo = &this->Do2vs; proc2vs = p; params = 2; }
  1754. X  inline RpcCallback (Proc3vs p)
  1755. X    { todo = &this->Do3vs; proc3vs = p; params = 3; }
  1756. X  inline RpcCallback (Proc4vs p)
  1757. X    { todo = &this->Do4vs; proc4vs = p; params = 4; }
  1758. X  inline RpcCallback (Proc5vs p)
  1759. X    { todo = &this->Do5vs; proc5vs = p; params = 5; }
  1760. X  inline RpcCallback (Proc6vs p)
  1761. X    { todo = &this->Do6vs; proc6vs = p; params = 6; }
  1762. X  inline RpcCallback (Proc7vs p)
  1763. X    { todo = &this->Do7vs; proc7vs = p; params = 7; }
  1764. X
  1765. X  inline virtual AnyRpcCallback* CopyToHeap () const
  1766. X    {
  1767. X      RpcCallback* p = new RpcCallback ();
  1768. X      *p = *this;
  1769. X      return p;
  1770. X    }
  1771. X};
  1772. X
  1773. template<class T> class RpcMethodCall : public AnyRpcCallback
  1774. X{
  1775. private:
  1776. X  typedef void* (T::*MethodN)(void**);
  1777. X  typedef void* (T::*Method0)();
  1778. X  typedef void* (T::*Method1)(void*);
  1779. X  typedef void* (T::*Method2)(void*, void*);
  1780. X  typedef void* (T::*Method3)(void*, void*, void*);
  1781. X  typedef void* (T::*Method4)(void*, void*, void*, void*);
  1782. X  typedef void* (T::*Method5)(void*, void*, void*, void*, void*);
  1783. X  typedef void* (T::*Method6)(void*, void*, void*, void*, void*, void*);
  1784. X  typedef void* (T::*Method7)(void*, void*, void*, void*, void*, void*, void*);
  1785. X
  1786. X  typedef void (T::*MethodNv)(void**);
  1787. X  typedef void (T::*Method0v)();
  1788. X  typedef void (T::*Method1v)(void*);
  1789. X  typedef void (T::*Method2v)(void*, void*);
  1790. X  typedef void (T::*Method3v)(void*, void*, void*);
  1791. X  typedef void (T::*Method4v)(void*, void*, void*, void*);
  1792. X  typedef void (T::*Method5v)(void*, void*, void*, void*, void*);
  1793. X  typedef void (T::*Method6v)(void*, void*, void*, void*, void*, void*);
  1794. X  typedef void (T::*Method7v)(void*, void*, void*, void*, void*, void*, void*);
  1795. X
  1796. X  typedef void* (T::*MethodNs)(void**, RpcService*);
  1797. X  typedef void* (T::*Method0s)(RpcService*);
  1798. X  typedef void* (T::*Method1s)(void*, RpcService*);
  1799. X  typedef void* (T::*Method2s)(void*, void*, RpcService*);
  1800. X  typedef void* (T::*Method3s)(void*, void*, void*, RpcService*);
  1801. X  typedef void* (T::*Method4s)(void*, void*, void*, void*, RpcService*);
  1802. X  typedef void* (T::*Method5s)(void*, void*, void*, void*, void*, RpcService*);
  1803. X  typedef void* (T::*Method6s)(void*, void*, void*, void*,
  1804. X                   void*, void*, RpcService*);
  1805. X  typedef void* (T::*Method7s)(void*, void*, void*, void*,
  1806. X                   void*, void*, void*, RpcService*);
  1807. X
  1808. X  typedef void (T::*MethodNvs)(void**, RpcService*);
  1809. X  typedef void (T::*Method0vs)(RpcService*);
  1810. X  typedef void (T::*Method1vs)(void*, RpcService*);
  1811. X  typedef void (T::*Method2vs)(void*, void*, RpcService*);
  1812. X  typedef void (T::*Method3vs)(void*, void*, void*, RpcService*);
  1813. X  typedef void (T::*Method4vs)(void*, void*, void*, void*, RpcService*);
  1814. X  typedef void (T::*Method5vs)(void*, void*, void*, void*, void*, RpcService*);
  1815. X  typedef void (T::*Method6vs)(void*, void*, void*, void*,
  1816. X                   void*, void*, RpcService*);
  1817. X  typedef void (T::*Method7vs)(void*, void*, void*, void*,
  1818. X                   void*, void*, void*, RpcService*);
  1819. X
  1820. X  typedef void* (RpcMethodCall::*DoPtr)(void**);
  1821. X  DoPtr todo;
  1822. X  T* object;
  1823. X  union
  1824. X    {
  1825. X      MethodN methodN;MethodNv methodNv;MethodNs methodNs;MethodNvs methodNvs;
  1826. X      Method0 method0;Method0v method0v;Method0s method0s;Method0vs method0vs;
  1827. X      Method1 method1;Method1v method1v;Method1s method1s;Method1vs method1vs;
  1828. X      Method2 method2;Method2v method2v;Method2s method2s;Method2vs method2vs;
  1829. X      Method3 method3;Method3v method3v;Method3s method3s;Method3vs method3vs;
  1830. X      Method4 method4;Method4v method4v;Method4s method4s;Method4vs method4vs;
  1831. X      Method5 method5;Method5v method5v;Method5s method5s;Method5vs method5vs;
  1832. X      Method6 method6;Method6v method6v;Method6s method6s;Method6vs method6vs;
  1833. X      Method7 method7;Method7v method7v;Method7s method7s;Method7vs method7vs;
  1834. X    };
  1835. X  inline RpcMethodCall () {}
  1836. X  inline void* Do (void** in)
  1837. X    { return (this->*todo)(in); }
  1838. X
  1839. X  inline void* DoN (void** in)
  1840. X    { return (object->*methodN)(in); }
  1841. X  inline void* Do0 (void** in)
  1842. X    { return (object->*method0)(); }
  1843. X  inline void* Do1 (void** in)
  1844. X    { return (object->*method1)(in[0]); }
  1845. X  inline void* Do2 (void** in)
  1846. X    { return (object->*method2)(in[0], in[1]); }
  1847. X  inline void* Do3 (void** in)
  1848. X    { return (object->*method3)(in[0], in[1], in[2]); }
  1849. X  inline void* Do4 (void** in)
  1850. X    { return (object->*method4)(in[0], in[1], in[2], in[3]); }
  1851. X  inline void* Do5 (void** in)
  1852. X    { return (object->*method5)(in[0], in[1], in[2], in[3], in[4]); }
  1853. X  inline void* Do6 (void** in)
  1854. X    { return (object->*method6)(in[0], in[1], in[2], in[3], in[4], in[5]); }
  1855. X  inline void* Do7 (void** in)
  1856. X    { return (object->*method7)(in[0], in[1], in[2],
  1857. X                in[3], in[4], in[5], in[6]); }
  1858. X  inline void* DoNv (void** in)
  1859. X    { (object->*methodNv)(in); return (void*)0; }
  1860. X  inline void* Do0v (void** in)
  1861. X    { (object->*method0v)(); return (void*)0; }
  1862. X  inline void* Do1v (void** in)
  1863. X    { (object->*method1v)(in[0]); return (void*)0; }
  1864. X  inline void* Do2v (void** in)
  1865. X    { (object->*method2v)(in[0], in[1]); return (void*)0; }
  1866. X  inline void* Do3v (void** in)
  1867. X    { (object->*method3v)(in[0], in[1], in[2]); return (void*)0; }
  1868. X  inline void* Do4v (void** in)
  1869. X    { (object->*method4v)(in[0], in[1], in[2], in[3]); return (void*)0; }
  1870. X  inline void* Do5v (void** in)
  1871. X    { (object->*method5v)(in[0], in[1], in[2], in[3], in[4]);
  1872. X      return (void*)0; }
  1873. X  inline void* Do6v (void** in)
  1874. X    { (object->*method6v)(in[0], in[1], in[2], in[3], in[4], in[5]);
  1875. X      return (void*)0; }
  1876. X  inline void* Do7v (void** in)
  1877. X    { (object->*method7v)(in[0], in[1], in[2], in[3], in[4], in[5], in[6]);
  1878. X      return (void*)0; }
  1879. X
  1880. X  inline void* DoNs (void** in)
  1881. X    { return (object->*methodNs)(in, svc); }
  1882. X  inline void* Do0s (void** in)
  1883. X    { return (object->*method0s)(svc); }
  1884. X  inline void* Do1s (void** in)
  1885. X    { return (object->*method1s)(in[0], svc); }
  1886. X  inline void* Do2s (void** in)
  1887. X    { return (object->*method2s)(in[0], in[1], svc); }
  1888. X  inline void* Do3s (void** in)
  1889. X    { return (object->*method3s)(in[0], in[1], in[2], svc); }
  1890. X  inline void* Do4s (void** in)
  1891. X    { return (object->*method4s)(in[0], in[1], in[2], in[3], svc); }
  1892. X  inline void* Do5s (void** in)
  1893. X    { return (object->*method5s)(in[0], in[1], in[2], in[3], in[4], svc); }
  1894. X  inline void* Do6s (void** in)
  1895. X    { return (object->*method6s)(in[0], in[1], in[2],
  1896. X                 in[3], in[4], in[5], svc); }
  1897. X  inline void* Do7s (void** in)
  1898. X    { return (object->*method7s)(in[0], in[1], in[2],
  1899. X                 in[3], in[4], in[5], in[6], svc); }
  1900. X  inline void* DoNvs (void** in)
  1901. X    { (object->*methodNvs)(in, svc); return (void*)0; }
  1902. X  inline void* Do0vs (void** in)
  1903. X    { (object->*method0vs)(svc); return (void*)0; }
  1904. X  inline void* Do1vs (void** in)
  1905. X    { (object->*method1vs)(in[0], svc); return (void*)0; }
  1906. X  inline void* Do2vs (void** in)
  1907. X    { (object->*method2vs)(in[0], in[1], svc); return (void*)0; }
  1908. X  inline void* Do3vs (void** in)
  1909. X    { (object->*method3vs)(in[0], in[1], in[2], svc); return (void*)0; }
  1910. X  inline void* Do4vs (void** in)
  1911. X    { (object->*method4vs)(in[0], in[1], in[2], in[3], svc); return (void*)0; }
  1912. X  inline void* Do5vs (void** in)
  1913. X    { (object->*method5vs)(in[0], in[1], in[2], in[3], in[4], svc);
  1914. X      return (void*)0; }
  1915. X  inline void* Do6vs (void** in)
  1916. X    { (object->*method6vs)(in[0], in[1], in[2], in[3], in[4], in[5], svc);
  1917. X      return (void*)0; }
  1918. X  inline void* Do7vs (void** in)
  1919. X    { (object->*method7vs)(in[0], in[1], in[2], in[3],
  1920. X               in[4], in[5], in[6], svc); return (void*)0; }
  1921. X
  1922. public:
  1923. X  inline RpcMethodCall (T* o, MethodN m)
  1924. X    { todo = &this->DoN; object = o; methodN = m; params = -1; }
  1925. X  inline RpcMethodCall (T* o, Method0 m)
  1926. X    { todo = &this->Do0; object = o; method0 = m; params = 0; }
  1927. X  inline RpcMethodCall (T* o, Method1 m)
  1928. X    { todo = &this->Do1; object = o; method1 = m; params = 1; }
  1929. X  inline RpcMethodCall (T* o, Method2 m)
  1930. X    { todo = &this->Do2; object = o; method2 = m; params = 2; }
  1931. X  inline RpcMethodCall (T* o, Method3 m)
  1932. X    { todo = &this->Do3; object = o; method3 = m; params = 3; }
  1933. X  inline RpcMethodCall (T* o, Method4 m)
  1934. X    { todo = &this->Do4; object = o; method4 = m; params = 4; }
  1935. X  inline RpcMethodCall (T* o, Method5 m)
  1936. X    { todo = &this->Do5; object = o; method5 = m; params = 5; }
  1937. X  inline RpcMethodCall (T* o, Method6 m)
  1938. X    { todo = &this->Do6; object = o; method6 = m; params = 6; }
  1939. X  inline RpcMethodCall (T* o, Method7 m)
  1940. X    { todo = &this->Do7; object = o; method7 = m; params = 7; }
  1941. X
  1942. X  inline RpcMethodCall (T* o, MethodNv m)
  1943. X    { todo = &this->DoNv; object = o; methodNv = m; params = -1; }
  1944. X  inline RpcMethodCall (T* o, Method0v m)
  1945. X    { todo = &this->Do0v; object = o; method0v = m; params = 0; }
  1946. X  inline RpcMethodCall (T* o, Method1v m)
  1947. X    { todo = &this->Do1v; object = o; method1v = m; params = 1; }
  1948. X  inline RpcMethodCall (T* o, Method2v m)
  1949. X    { todo = &this->Do2v; object = o; method2v = m; params = 2; }
  1950. X  inline RpcMethodCall (T* o, Method3v m)
  1951. X    { todo = &this->Do3v; object = o; method3v = m; params = 3; }
  1952. X  inline RpcMethodCall (T* o, Method4v m)
  1953. X    { todo = &this->Do4v; object = o; method4v = m; params = 4; }
  1954. X  inline RpcMethodCall (T* o, Method5v m)
  1955. X    { todo = &this->Do5v; object = o; method5v = m; params = 5; }
  1956. X  inline RpcMethodCall (T* o, Method6v m)
  1957. X    { todo = &this->Do6v; object = o; method6v = m; params = 6; }
  1958. X  inline RpcMethodCall (T* o, Method7v m)
  1959. X    { todo = &this->Do7v; object = o; method7v = m; params = 7; }
  1960. X
  1961. X  inline RpcMethodCall (T* o, MethodNs m)
  1962. X    { todo = &this->DoNs; object = o; methodNs = m; params = -1; }
  1963. X  inline RpcMethodCall (T* o, Method0s m)
  1964. X    { todo = &this->Do0s; object = o; method0s = m; params = 0; }
  1965. X  inline RpcMethodCall (T* o, Method1s m)
  1966. X    { todo = &this->Do1s; object = o; method1s = m; params = 1; }
  1967. X  inline RpcMethodCall (T* o, Method2s m)
  1968. X    { todo = &this->Do2s; object = o; method2s = m; params = 2; }
  1969. X  inline RpcMethodCall (T* o, Method3s m)
  1970. X    { todo = &this->Do3s; object = o; method3s = m; params = 3; }
  1971. X  inline RpcMethodCall (T* o, Method4s m)
  1972. X    { todo = &this->Do4s; object = o; method4s = m; params = 4; }
  1973. X  inline RpcMethodCall (T* o, Method5s m)
  1974. X    { todo = &this->Do5s; object = o; method5s = m; params = 5; }
  1975. X  inline RpcMethodCall (T* o, Method6s m)
  1976. X    { todo = &this->Do6s; object = o; method6s = m; params = 6; }
  1977. X  inline RpcMethodCall (T* o, Method7s m)
  1978. X    { todo = &this->Do7s; object = o; method7s = m; params = 7; }
  1979. X
  1980. X  inline RpcMethodCall (T* o, MethodNvs m)
  1981. X    { todo = &this->DoNvs; object = o; methodNvs = m; params = -1; }
  1982. X  inline RpcMethodCall (T* o, Method0vs m)
  1983. X    { todo = &this->Do0vs; object = o; method0vs = m; params = 0; }
  1984. X  inline RpcMethodCall (T* o, Method1vs m)
  1985. X    { todo = &this->Do1vs; object = o; method1vs = m; params = 1; }
  1986. X  inline RpcMethodCall (T* o, Method2vs m)
  1987. X    { todo = &this->Do2vs; object = o; method2vs = m; params = 2; }
  1988. X  inline RpcMethodCall (T* o, Method3vs m)
  1989. X    { todo = &this->Do3vs; object = o; method3vs = m; params = 3; }
  1990. X  inline RpcMethodCall (T* o, Method4vs m)
  1991. X    { todo = &this->Do4vs; object = o; method4vs = m; params = 4; }
  1992. X  inline RpcMethodCall (T* o, Method5vs m)
  1993. X    { todo = &this->Do5vs; object = o; method5vs = m; params = 5; }
  1994. X  inline RpcMethodCall (T* o, Method6vs m)
  1995. X    { todo = &this->Do6vs; object = o; method6vs = m; params = 6; }
  1996. X  inline RpcMethodCall (T* o, Method7vs m)
  1997. X    { todo = &this->Do7vs; object = o; method7vs = m; params = 7; }
  1998. X
  1999. X  inline virtual AnyRpcCallback* CopyToHeap () const
  2000. X    {
  2001. X      RpcMethodCall* p = new RpcMethodCall ();
  2002. X      *p = *this;
  2003. X      return p;
  2004. X    }
  2005. X};
  2006. X
  2007. X#endif
  2008. END_OF_FILE
  2009. if test 22467 -ne `wc -c <'rpc++/callback.h'`; then
  2010.     echo shar: \"'rpc++/callback.h'\" unpacked with wrong size!
  2011. fi
  2012. # end of 'rpc++/callback.h'
  2013. fi
  2014. echo shar: End of archive 2 \(of 3\).
  2015. cp /dev/null ark2isdone
  2016. MISSING=""
  2017. for I in 1 2 3 ; do
  2018.     if test ! -f ark${I}isdone ; then
  2019.     MISSING="${MISSING} ${I}"
  2020.     fi
  2021. done
  2022. if test "${MISSING}" = "" ; then
  2023.     echo You have unpacked all 3 archives.
  2024.     rm -f ark[1-9]isdone
  2025. else
  2026.     echo You still need to unpack the following archives:
  2027.     echo "        " ${MISSING}
  2028. fi
  2029. ##  End of shell archive.
  2030. exit 0
  2031.