home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / n / n001 / 2.ddi / EXAMPLES / POINTER / SERVER / RPROC.C next >
Encoding:
C/C++ Source or Header  |  1989-12-11  |  2.1 KB  |  59 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\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 pointer example.
  24.  */ 
  25.  
  26. #include <stdio.h>
  27. #include "pointer.h"    /* server header file, created by the RPC compiler */
  28.  
  29. int
  30. rm_blanks(initial, final)
  31. string initial;
  32. string *final;
  33. {
  34.     int i, j;
  35.     string tmp;
  36.     extern char *malloc();
  37.     
  38.     if (initial == (string)0) {
  39.         printf("SERVER: rm_blanks() called with no string\n");
  40.         return(1);
  41.     } else {
  42.         printf("SERVER: rm_blanks() called with string '%s'\n",initial);
  43.     }
  44.  
  45.     if ((tmp=(string)malloc(strlen(initial))) == (string)NULL) {
  46.         printf ("malloc failed! execution aborted\n");
  47.         exit (1);
  48.         }
  49.     j=0;
  50.     for(i=0; i<=strlen(initial); i++) {
  51.         if (initial[i] != ' ') {
  52.             tmp[j] = initial[i];
  53.             j++;
  54.         }
  55.     }
  56.     *final=tmp;
  57.     return (0);
  58. }
  59.