home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume26 / mnl-rpc++-2.3.1 / part01 / xdr++.cc < prev   
Encoding:
C/C++ Source or Header  |  1993-04-24  |  2.5 KB  |  76 lines

  1. // -*- c++ -*-
  2. /* 
  3. Copyright (C) 1991 Peter Bersen
  4.  
  5. This file is part of the rpc++ Library.  This library is free
  6. software; you can redistribute it and/or modify it under the terms of
  7. the GNU Library General Public License as published by the Free
  8. Software Foundation; either version 2 of the License, or (at your
  9. option) any later version.  This library is distributed in the hope
  10. that it will be useful, but WITHOUT ANY WARRANTY; without even the
  11. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  12. PURPOSE.  See the GNU Library General Public License for more details.
  13. You should have received a copy of the GNU Library General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  16.  
  17. Modified and partially rewritten March 1992 by Michael N. Lipp,
  18. mnl@dtro.e-technik.th-darmstadt.de. The original copyright terms and
  19. conditions apply without change to any modified or new parts.
  20. */
  21.  
  22. static char _rpcpp_xdrpp_cc_[]
  23. = "xdr++.cc,v 2.3 1992/06/15 19:12:49 mnl Exp";
  24.  
  25. // xdr++.cc,v
  26. // Revision 2.3  1992/06/15  19:12:49  mnl
  27. // Fixed a few bugs, clarified interface.
  28. //
  29. // Revision 2.2  1992/06/13  14:27:06  mnl
  30. // Adapted to (patched) gcc-2.2. Fixed several bugs.
  31. //
  32. // Revision 2.1.1.1  1992/03/08  13:28:42  mnl
  33. // Initial mnl version.
  34. //
  35.  
  36. #ifdef __GNUG__
  37. #pragma implementation
  38. #endif
  39.  
  40. /*
  41. ** See Xdr.h.
  42. */
  43.  
  44. #include "rpc++/xdr++.h"
  45.  
  46. XdrInfo Xdr::Xnull ((xdrproc_t)0, 0);
  47. XdrInfo Xdr::Xchar ((xdrproc_t)xdr_char, sizeof (char));
  48. XdrInfo Xdr::Xshort ((xdrproc_t)xdr_short, sizeof (short));
  49. XdrInfo Xdr::Xint ((xdrproc_t)xdr_int, sizeof (int));
  50. XdrInfo Xdr::Xlong ((xdrproc_t)xdr_long, sizeof (long));
  51. XdrInfo Xdr::Xuchar ((xdrproc_t)xdr_u_char, sizeof (u_char));
  52. XdrInfo Xdr::Xushort ((xdrproc_t)xdr_u_short, sizeof (u_short));
  53. XdrInfo Xdr::Xuint ((xdrproc_t)xdr_u_int, sizeof (u_int));
  54. XdrInfo Xdr::Xulong ((xdrproc_t)xdr_u_long, sizeof (u_long));
  55. XdrInfo Xdr::Xfloat ((xdrproc_t)xdr_float, sizeof (float));
  56. XdrInfo Xdr::Xdouble ((xdrproc_t)xdr_double, sizeof (double));
  57.  
  58. XdrInfo Xdr::Xenum_t ((xdrproc_t)xdr_enum, sizeof (enum_t));
  59. XdrInfo Xdr::Xbool_t ((xdrproc_t)xdr_bool, sizeof (bool_t));
  60. XdrInfo Xdr::Xvoid ((xdrproc_t)xdr_void, 0);
  61. XdrInfo Xdr::Xwrapstring ((xdrproc_t)xdr_wrapstring, sizeof (char*));
  62.  
  63. bool_t Xdr::XdrParams (XDR* xdrs, XdrSeqInfo* xsi)
  64. {
  65.   XdrInfo** infop = xsi->infos;
  66.   void** datap = xsi->data;
  67.  
  68.   while (*infop)
  69.     {
  70.       if (! (*infop->Proc ()) (xdrs, *datap))
  71.     return FALSE;
  72.       infop++, datap++;
  73.     }
  74.   return TRUE;
  75. }
  76.