From: stroili@padova.infn.it (Roberto Stroili)
Subject: CXX
Date: Fri, 18 Mar 1994 13:20:08 GMT [thread overview]
Message-ID: <CMv3pK.C5v@news.cern.ch> (raw)
I have some problems with CXX 1.2 and 1.3 under osf 1.3. Trying to compile a
routine which calls an XDR functions I get some compilation errors (see an
extract from the listing at the end of this). Does anybody have an idea about
these errors?
Roberto
15265 #endif /* !__rpc_types_h */
15266 #endif
15267 /*
15268 * XDR provides a conventional way for converting between C dat
a
15269 * types and an external bit-string representation. Library su
pplied
15270 * routines provide for the conversion on built-in C data types
These
15271 * routines and utility routines defined here are used to help
implement
15272 * a type encode/decode routine for each user-defined type.
15273 *
15274 * Each data type provides a single procedure which takes two a
rguments:
15275 *
15276 * bool_t
15277 * xdrproc(xdrs, argresp)
15278 * XDR *xdrs;
15279 * <type> *argresp;
15280 *
15281 * xdrs is an instance of a XDR handle, to which or from which
the data
15282 * type is to be converted. argresp is a pointer to the struct
ure to be
15283 * converted. The XDR handle contains an operation field which
indicates
15284 * which of the operations (ENCODE, DECODE * or FREE) is to be
performed.
15285 *
15286 * XDR_DECODE may allocate space if the pointer argresp is null
This
15287 * data can be freed with the XDR_FREE operation.
15288 *
15289 * We write only one procedure per data type to make it easy
15290 * to keep the encode and decode procedures for a data type con
sistent.
15291 * In many cases the same code performs all operations on a use
r defined type,
15292 * because all the hard work is done in the component type rout
ines.
15293 * decode as a series of calls on the nested data types.
15294 */
15295
15296 /*
^LPIXdrStream.cc DEC C++ for ULTRIX on RISC
V1.2 Mar 14 1994 18:14:56 280
15297 * Xdr operations. XDR_ENCODE causes the type to be encoded in
to the
15298 * stream. XDR_DECODE causes the type to be extracted from the
stream.
15299 * XDR_FREE can be used to release the space allocated by an XD
R_DECODE
15300 * request.
15301 */
15302 enum xdr_op {
15303 XDR_ENCODE=0,
15304 XDR_DECODE=1,
15305 XDR_FREE=2
15306 };
15307
15308 /*
15309 * This is the number of bytes per unit of external data.
15310 */
15311 #define BYTES_PER_XDR_UNIT (4)
15312 #define RNDUP(x) ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_
XDR_UNIT) \
15313 * BYTES_PER_XDR_UNIT)
15314
15315 /*
15316 * A xdrproc_t exists for each data type which is to be encoded
or decoded.
15317 *
15318 * The second argument to the xdrproc_t is a pointer to an opaq
ue pointer.
15319 * The opaque pointer generally points to a structure of the da
ta type
15320 * to be decoded. If this pointer is 0, then the type routines
should
15321 * allocate dynamic storage of the appropriate size and return
it.
15322 * bool_t (*xdrproc_t)(XDR *, caddr_t *);
15323 */
15324 typedef bool_t (*xdrproc_t)();
15324.1 int
15325
15326 /*
15327 * The XDR handle.
15328 * Contains operation which is being applied to the stream,
15329 * an operations vector for the paticular implementation (e.g.
see xdr_mem.c),
15330 * and two private fields for the use of the particular impelem
entation.
15331 */
15332 typedef struct {
15333 enum xdr_op x_op; /* operation; fast addit
ional param */
15334 struct xdr_ops {
15335 bool_t (*x_getlong)(); /* get an int from under
lying stream */
15335.1 int
15336 bool_t (*x_putlong)(); /* put an int to " */
15336.1 int
15337 bool_t (*x_getbytes)();/* get some bytes from "
*/
15337.1 int
15338 bool_t (*x_putbytes)();/* put some bytes to " *
/
15338.1 int
15339 u_int (*x_getpostn)();/* returns bytes off fro
m beginning */
15340 bool_t (*x_setpostn)();/* lets you reposition t
he stream */
15340.1 int
^LPIXdrStream.cc DEC C++ for ULTRIX on RISC
V1.2 Mar 14 1994 18:14:56 281
15341 int * (*x_inline)(); /* buf quick ptr to buff
ered data */
15342 void (*x_destroy)(); /* free privates of this
xdr_stream */
15343 } *x_ops;
15344 caddr_t x_public; /* users' data */
15345 caddr_t x_private; /* pointer to private da
ta */
15346 caddr_t x_base; /* private used for posi
tion info */
15347 int x_handy; /* extra private word */
15348 } XDR;
15349
15350 /*
15351 * Operations defined on a XDR handle
15352 *
15353 * XDR *xdrs;
15354 * int *longp;
15355 * caddr_t addr;
15356 * u_int len;
15357 * u_int pos;
15358 */
15359 #define XDR_GETLONG(xdrs, longp) \
15360 (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
15361 #define xdr_getlong(xdrs, longp) \
15362 (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
15363
15364 #define XDR_PUTLONG(xdrs, longp) \
15365 (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
15366 #define xdr_putlong(xdrs, longp) \
15367 (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
15368
15369 #define XDR_GETBYTES(xdrs, addr, len) \
15370 (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
15371 #define xdr_getbytes(xdrs, addr, len) \
15372 (*(xdrs)-15380 (*(xdrs)->x_ops->x_getpostn)(xdrs)
15381 #define xdr_getpos(xdrs) \
15382 (*(xdrs)->x_ops->x_getpostn)(xdrs)
15383
15384 #define XDR_SETPOS(xdrs, pos) \
15385 (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
15386 #define xdr_setpos(xdrs, pos) \
15387 (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
15388
15389 #define XDR_INLINE(xdrs, len)
\
15390 (*(xdrs)->x_ops->x_inline)(xdrs, len)
15391 #define xdr_inline(xdrs, len)
\
15392 (*(xdrs)->x_ops->x_inline)(xdrs, len)
15393
15394 #define XDR_DESTROY(xdrs)
\
^LPIXdrStream.cc V1.2 Mar 14 1994 18:14:56 282
15395 (*(xdrs)->x_ops->x_destroy)(xdrs)
15396 #define xdr_destroy(xdrs) XDR_DESTROY(xdrs)
15397
15398 /*
15399 * Support struct for discriminated unions.
15400 * You create an array of xdrdiscrim structures, terminated wit
h
15401 * a entry with a null procedure pointer. The xdr_union routin
e gets
15402 * the discriminant value and then searches the array of struct
ures
15403 * for a matching value. If a match is found the associated xd
r routine
15404 * is called to handle that part of the union. If there is
15405 * no match, then a default routine may be called.
15406 * If there is no match and no default routine it is an error.
15407 */
15408 #define NULL_xdrproc_t ((xdrproc_t)0)
15409 struct xdr_discrim {
15410 int value;
15411 xdrproc_t proc;
15412 };
15413
15414 /*
15415 * In-line routines for fast encode/decode of primitve data typ
es.
15416 * Caveat emptor: these use single memory cycles to get the
15417 * data from the underlying buffer, and will fail to operate
15418 * properly if the data is not aligned. The standard way to us
e these
15419 * is to say:
15420 * if ((buf = XDR_INLINE(xdrs, count)) == NULL)
15421 * return (FALSE);
15422 * <<< macro calls >>>
15423 * where ``count'' is the number of bytes of data occupied
15424 * by the primitive data types.
15425 *
15426 * N.B. and frozen for all time: each data type here uses 4 byt
es
15427 * of external representation.
15428 */
15429 #define IXDR_GET_LONG(buf) ((int)ntohl((u_int)*(buf
)++))u_int)v))
15431
15432 #define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(b
uf))
15433 #define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf))
15434 #define IXDR_GET_U_LONG(buf) ((u_int)IXDR_GET_LONG(bu
f))
15435 #define IXDR_GET_SHORT(buf) ((short)IXDR_GET_LONG(bu
f))
15436 #define IXDR_GET_U_SHORT(buf) ((u_short)IXDR_GET_LONG(
buf))
15437
15438 #define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG((buf), ((i
nt)(v)))
15439 #define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG((buf), ((i
nt)(v)))
15440 #define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG((b
uf), ((int)(v)))
15441 #define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG((buf), ((i
nt)(v)))
15442 #define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG((buf), ((i
nt)(v)))
15443
15444 /*
15445 * These are the "generic" xdr routines.
15446 */
15447 extern bool_t xdr_void();
15447.1 int
^LPIXdrStream.cc DEC C++ for ULTRIX on RISC
15430 #define IXDR_PUT_LV1.2 Mar 14 1994 18:14:56 283
15448 extern bool_t xdr_int();
15448.1 int
15449 extern bool_t xdr_u_int();
15449.1 int
15450 extern bool_t xdr_long();
15450.1 int
15451 extern bool_t xdr_u_long();
15451.1 int
15452 extern bool_t xdr_short();
15452.1 int
15453 extern bool_t xdr_u_short();
15453.1 int
15454 extern bool_t xdr_bool();
15454.1 int
15455 extern bool_t xdr_enum();
15455.1 int
15456 extern bool_t xdr_array();
15456.1 int
15457 extern bool_t xdr_bytes();
15457.1 int
15458 extern bool_t xdr_opaque();
15458.1 int
15459 extern bool_t xdr_string();
15459.1 int
15460 extern bool_t xdr_union();
15460.1 int
15461 #ifndef KERNEL
15462 extern void xdr_free();
15463 extern bool_t xdr_char();
15463.1 int
15464 extern bool_t xdr_u_char();
15464.1 int
15465 extern bool_t xdr_vector();
15465.1 int
15466 extern bool_t xdr_float();
15466.1 int
15467 extern bool_t xdr_double();
15467.1 int
^LPIXdrStream.cc DEC C++ for ULTRIX on RISC
V1.2 Mar 14 1994 18:14:56 284
15468 extern bool_t xdr_reference();
15468.1 int
15469 extern bool_t xdr_pointer();
15469.1 int
15470 extern bool_t xdr_wrapstring();
15470.1 int
15471 #endif /* !KERNEL */
15472
15473 /*
15474 * Common opaque bytes objects used by many rpc protocols;
15475 * declared here due to commonality.
15476 */
15477 #define MAX_NETOBJ_SZ 1024
15478 struct netobj {
15479 u_int n_len;
15480 char *n_bytes;
15481 };
15482 typedef struct netobj netobj;
15483 extern bool_t xdr_netobj();
15483.1 int
15484
15485 /*
15486 * These are the public routines for the various implementation
s of
15487 * xdr streams.
15488 */
15489 extern void xdrmem_create(); /* XDR using memory buff
ers */
15490 #ifndef KERNEL
15491 extern void xdrstdio_create(); /* XDR using stdio libra
ry */
15492 extern void xdrrec_create(); /* XDR pseudo records fo
r tcp */
15493 extern bool_t xdrrec_endofrecord(); /* make end of xdr recor
d */
15493.1 int
15494 extern bool_t xdrrec_skiprecord(); /* move to beginning of
next record */
15494.1 int
15495 extern bool_t xdrrec_eof(); /* true if no more input
*/
15495.1 int
15496 extern bool_t xdrrec_eof(); /* true if no more input
*/
15496.1 int
15497 #else
15498 extern void xdrmbuf_init(); /* XDR using kernel mbuf
s */
15499 #endif /* !KERNEL */
15500
15501 #endif /*!_rpc_xdr_h*/
15502
15503 /* Client side only authentication */
15504 #include <rpc/auth.h> /* generic authenticator (client
side) */
15505 /*
^LPIXdrStream.cc V1.2 Mar 14 1994 18:14:56 285
15506 * ************************************************************
*****
15507 * *
*
15508 * * Copyright (c) Digital Equipment Corporation, 1991, 1992
*
15509 * *
*
15510 * * All Rights Reserved. Unpublished rights reserved unde
r *
15511 * * the copyright laws of the United States.
*
15512 * *
*
15513 * * The software contained on this media is proprietary t
o *
15514 * * and embodies the confidential technology of Digita
l *
15515 * * Equipment Corporation. Possession, use, duplication o
r *
15516 * * dissemination of the software and media is authorized on
ly *
15517 * * pursuant to a valid written license from Digital Equipme
nt *
15518 * * Corporation.
*
15519 * *
*
15520 * * RESTRICTED RIGHTS LEGEND Use, duplication, or disclosu
re *
15521 * * by the U.S. Government is subject to restrictions as s
et *
15522 * * forth in Subparagraph (c)(1)(ii) of DFARS 252.227-701
3, *
15523 * * or in FAR 52.227-19, as applicable.
*
15524 * *
*
15525 * ************************************************************
*****
15526 */
15527 /*
15528 * HISTORY
15529 */
15530 /*
15531 * @(#)$RCSfile: auth.h,v $ $Revision: 4.2.3.2 $ (DEC) $Dat
e: 1992/01/24 17:29:17 $
15532 */
15533 /*
15534 */
15535
15536
15537 /*
15538 * Copyright (c) 1990 by Sun Microsystems, Inc.
15539 * 1.17 88/02/08 SMI
15540 */
15541
15542
15543 /*
15544 * auth.h, Authentication interface.
15545 *
15546 * Copyright (C) 1984, Sun Microsystems, Inc.
15547 *
15548 * The data structures are completely opaque to the client. Th
e client
15549 * is required to pass a AUTH * to routines that create rpc
15550 * "sessions".
15551 */
15552
15553
15554 #ifndef _rpc_auth_h
15555 #define _rpc_auth_h
15556
15557 #define MAX_AUTH_BYTES 400
15558 #define MAXNETNAMELEN 255 /* maximum length of net
work user's name */
15559
15560 /*
^LPIXdrStream.cc DEC C++ for ULTRIX on RISC
DEC C++ for ULTRIX on RISC
15373
15374 #define XDR_PUTBYTES(xdrs, addr, len) \
15375 (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
15376 #define xdr_putbytes(xdrs, addr, len) \
15377 (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
15378
15379 #define XDR_GETPOS(xdrs) \
15580 #if (defined(mips) || defined(mc68000) || defined(sparc) || def
ined(vax) || defined(i386))
15581 typedef u_long u_int32; /* 32-bit unsigned integers */
15582 #endif
15583
15584 #ifdef __alpha
15585 typedef u_int u_int32; /* 32-bit unsigned integers */
15586 #endif
15587
15588 union des_block {
15589 struct {
15590 u_int32 high;
15591 u_int32 low;
15592 } key;
15593 char c[8];
15594 };
15595 typedef union des_block des_block;
15596 extern bool_t xdr_des_block();
15596.1 int
15597
15598 /*
15599 * Authentication info. Opaque to client.
15600 */
15601 struct opaque_auth {
15602 enum_t oa_flavor; /* flavor of auth */
15602.1 int
15603 caddr_t oa_base; /* address of more auth
stuff */
15604 u_int oa_length; /* not to exceed MAX_AUT
H_BYTES */
15605 };
15606
15607
15608 /*
15609 * Auth handle, interface to client side authenticators.
15610 */
15611 typedef struct {
^LPIXdrStream.cc DEC C++ for ULTRIX on RISC
V1.2 Mar 14 1994 18:14:56 287
reply other threads:[~1994-03-18 13:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox