home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / n / n001 / 2.ddi / EXAMPLES / FREEMEM / SERVER / RPROC.C next >
Encoding:
C/C++ Source or Header  |  1989-12-11  |  1.8 KB  |  45 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: freemem\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 procedure for the freemem example. 
  24. */ 
  25.  
  26. #include <stdio.h>
  27. #include "freemem.h"    /* server header file, created by RPC compiler */
  28.  
  29. char *string;
  30.  
  31. int
  32. get_string(num)
  33. int num;
  34. {
  35.     extern char *malloc();
  36.  
  37.     if ((string=malloc(20)) == NULL) {
  38.         printf ("SERVER: malloc failed!  execution aborted\n");
  39.         exit (1);
  40.         }
  41.     sprintf(string, "server %d", num+100);
  42.     printf("SERVER: get_string(%d) returning '%s'\n", num, string);
  43.     return(0);
  44. }
  45.