home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / netlib / Net_UltraAddrToString.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-03  |  1.4 KB  |  55 lines

  1. /* 
  2.  * Net_UltraAddrToString.c --
  3.  *
  4.  *    Convert an UltraNet address to a string.
  5.  *
  6.  * Copyright 1987 Regents of the University of California
  7.  * All rights reserved.
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that the above copyright
  11.  * notice appear in all copies.  The University of California
  12.  * makes no representations about the suitability of this
  13.  * software for any purpose.  It is provided "as is" without
  14.  * express or implied warranty.
  15.  */
  16.  
  17. #ifndef lint
  18. static char rcsid[] = "$Header: /sprite/src/lib/net/RCS/Net_UltraAddrToString.c,v 1.2 90/09/11 14:43:43 kupfer Exp $ SPRITE (Berkeley)";
  19. #endif not lint
  20.  
  21.  
  22. #include "sprite.h"
  23. #include <stdio.h>
  24. #include "net.h"
  25.  
  26. /*
  27.  *----------------------------------------------------------------------
  28.  *
  29.  * Net_UltraAddrToString --
  30.  *
  31.  *    Convert Ultranet address to printable representation.
  32.  *
  33.  * Results:
  34.  *    Address of the string buffer.
  35.  *
  36.  * Side effects:
  37.  *    The buffer is overwritten.
  38.  *
  39.  *----------------------------------------------------------------------
  40.  */
  41.  
  42. char *
  43. Net_UltraAddrToString(ultraAddrPtr, buffer)
  44.     register Net_UltraAddress *ultraAddrPtr;
  45.     char *buffer;
  46. {
  47.     int        group;
  48.     int        unit;
  49.  
  50.     Net_UltraAddressGet(ultraAddrPtr, &group, &unit);
  51.     sprintf(buffer, "%d/%d", group, unit);
  52.     return(buffer);
  53. }
  54.  
  55.