home *** CD-ROM | disk | FTP | other *** search
- /* *
- * *
- * Copyright 1987, 1988, 1989 Netwise, Inc. *
- * All Rights Reserved *
- * This software contains information which is proprietary to and a trade *
- * secret of Netwise, Inc. It is not to be used, reproduced, or disclosed *
- * except as authorized in your license agreement. *
- * *
- * Restricted Rights Legend *
- * Use, duplication, or disclosure by the Government is subject to *
- * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in *
- * Technical Data and Computer Software clause at 252.227-7013, or the *
- * equivalent Government clause for other agencies. *
- * Contractor: Netwise, Inc., Boulder, CO 80301 USA *
- * *
- */
- /*
- * File: union\client\client.c
- *
- * This example runs in the following environments:
- * NetWare RPC 1.0, NetWare 2.1 or higher, DOS 3.3
- *
- * Client code for the union example. This program calls one
- * remote procedure, opening and closing the connection for
- * the call using the non-persistent style of process binding.
- *
- */
-
- #include <stdio.h>
- #include "union.h" /* client header file, created by RPC compiler */
-
- extern int _rpcerr_; /* Declare RPC error code */
-
- /* Server_Name is used to set the process-binding variable.
- * It must be defined as the name the server registers under.
- */
- #define Server_Name "example"
-
- /* declare variable of type server_name for process binding */
- server_name sname;
-
- main()
- {
- object nxt;
-
- sname = Server_Name;
-
- /* Example of call to remote procedure get_next() */
- printf("CLIENT: call get_next()\n");
- nxt = get_next();
-
- /* check RPC error code after remote call */
- if (_rpcerr_) {
- fprintf(stderr,"CLIENT: RPC error %d in get_next() call\n",
- _rpcerr_);
- exit(1);
- }
-
- switch (nxt.class) {
- case FLOAT:
- printf("CLIENT: get_next() returned %e\n", nxt.inst.f);
- break;
- case LONG:
- printf("CLIENT: get_next() returned '%ld'\n", nxt.inst.l);
- break;
- default: /* int */
- printf("CLIENT: get_next() returned '%d'\n", nxt.inst.i);
- break;
- }
-
- exit(0);
- }
-