home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / n / n001 / 2.ddi / EXAMPLES / ARRAY / SERVER / RPROC.C next >
Encoding:
C/C++ Source or Header  |  1989-12-11  |  2.1 KB  |  65 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: array\server\rproc.c
  19.  *
  20.  * This example runs in the following environment:
  21.  *    NetWare RPC 1.0, NetWare 2.1 or higher, DOS 3.3
  22.  *
  23.  * This file contains the remote procedures for the array example. 
  24.  */ 
  25.  
  26. #include <stdio.h>
  27. #include "array.h"    /* server header file, created by RPC compiler */
  28.  
  29. /* add_vec1 adds the array elements and returns the sum to the client */
  30.  
  31. int
  32. add_vec1( size, vec)
  33. int size;        /* number of array elements */
  34. int vec[];        /* array of integers */
  35. {
  36.    int i, sum;
  37.  
  38.    printf("SERVER: add_vec1() with %d elements\n", size);
  39.    sum = 0;
  40.  
  41.    for(i=0; i<size; i++) {
  42.     sum += vec[i];
  43.    }
  44.  
  45.    return (sum);
  46. }
  47.  
  48. /* add_vec2 adds the array elements and returns the sum to the client */
  49.  
  50. add_vec2( size, vec)
  51. int size;
  52. int vec[];
  53. {
  54.    int i, sum;
  55.  
  56.    printf("SERVER: add_vec2() with %d elements\n", size);
  57.    sum = 0;
  58.  
  59.    for(i=0; i<size; i++) {
  60.     sum += vec[i];
  61.    }
  62.  
  63.    return (sum);
  64. }
  65.