home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / n / n001 / 2.ddi / EXAMPLES / POINTER / CLIENT / CLIENT.C next >
Encoding:
C/C++ Source or Header  |  1989-12-11  |  2.3 KB  |  67 lines

  1. /*                                                                            *
  2.  *                                                                            *
  3.  *                  Copyright 1987, 1988, 1989 Netwise, Inc.                  *
  4.  *                              All Rights Reserved                           *
  5.  *   This software contains information which is proprietary to and a trade   *
  6.  *   secret of Netwise, Inc. It is not to be used, reproduced, or disclosed   *
  7.  *   except as authorized in your license agreement.                          *
  8.  *                                                                            *
  9.  *                          Restricted Rights Legend                          *
  10.  *   Use, duplication,  or  disclosure  by the  Government  is  subject  to   *
  11.  *   restrictions as set forth in subparagraph (c)(1)(ii) of the Rights  in   *
  12.  *   Technical Data and  Computer Software clause  at 252.227-7013, or  the   *
  13.  *   equivalent Government clause for other agencies.                         *
  14.  *   Contractor: Netwise, Inc., Boulder, CO 80301 USA                         *
  15.  *                                                                            *
  16.  */ 
  17. /*
  18.  * File: pointer\client\client.c:
  19.  *
  20.  * This example runs in the following environments:
  21.  *    NetWare RPC 1.0, NetWare 2.1 or higher, DOS 3.3
  22.  *
  23.  * Client code for the pointer example.
  24.  */ 
  25.  
  26. #include <stdio.h>
  27. #include "pointer.h"    /* client header file, created by the RPC compiler */
  28.  
  29. extern int _rpcerr_;    /* declare RPC error code */
  30.  
  31. /* Server_Name is used to set the process-binding variable.
  32.  * It must be defined as the name the server registers under.
  33.  */
  34. #define Server_Name  "example"
  35.  
  36. /* declare variable of type server_name for process binding */
  37. server_name sname;
  38.  
  39. main()
  40. {
  41.     string init;
  42.     string final;
  43.     int result;
  44.  
  45.     sname = Server_Name;
  46.  
  47.     init = "This message contains 5 blank chars";
  48.  
  49.     /* Example of call to rm_blanks() */
  50.  
  51.     printf("CLIENT: call rm_blanks(%s)\n", init);
  52.     result = rm_blanks(init, &final);
  53.  
  54.     if (_rpcerr_) {        /* check RPC return code */
  55.         printf("CLIENT: RPC error %d in rm_blanks() call\n", _rpcerr_);
  56.         exit(1);
  57.     }
  58.  
  59.     if (result == 0) {
  60.         printf("CLIENT: rm_blanks() returned '%s'\n",final);
  61.     } else {
  62.         printf("CLIENT: rm_blanks error (%d)\n", result);
  63.     }
  64.  
  65.     exit(0);
  66. }
  67.