🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #4285

Help with RPC programming

#4285
From: Keith Gemeinhart
Date: Tue, 08 Aug 1995 13:24
40 lines
1898 bytes
XDR unions are discriminated unions allowing different results to be returned
on a conditional basis. The conditional variable is part of the generated data
structure which is used as the case discriminator in switch statements in the
automatically generated source files. The entire discriminated union data
structure is given an identifier in the RPCL protocol definition file which
is used as both a structure tag-name and defined type.

The member name for the union component of this data structure is appended with
"_u" in the output C header file.

I would like to define an additional identifier or tag-name for this union so
that I can then define it as an independent data type. Is there any way to
accomplish this through the existing RPCL without manual modification of the
output header file or duplicating the union specification?

Example:
	struct VIEW_ARG {
        VIEW_EVENT_TYPE type;
        union {
                int a;
		int b;
		int c;
		int d;
		int e;
              } VIEW_ARG_u;
	};

	typedef struct VIEW_ARG VIEW_ARG;
	bool_t xdr_VIEW_ARG();

I would like to be able to reference the VIEW_ARG_u union.

	Thank you,
		Keith Gemeinhart

-- 
Keith Gemeinhart (keithg@tsc.com) | Voice: (812) 336 - 7576
Technology Service Corp.          | Fax:   (812) 336 - 7735 
Bloomington, IN                   | WWW:   http://www.tsc.com/css
--
Technical Details
Message-ID: <407oj4$fjo@walt.tsc.com>
Path: arc1-ca.pugleaf.net!walt.tsc.com!usenet

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!walt.tsc.com!usenet
From: Keith Gemeinhart <keithg@tsc.com>
Newsgroups: comp.lang.misc,comp.lang.c,comp.sys.hp.hpux
Subject: Help with RPC programming
Date: 8 Aug 1995 13:24:52 GMT
Organization: Technology Service Corp.
Message-ID: <407oj4$fjo@walt.tsc.com>
NNTP-Posting-Host: elmer.tsc.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.05 9000/725)
To: keithg
X-URL: news:comp.lang.misc