home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume25 / finger / part01 / locname.c < prev    next >
C/C++ Source or Header  |  1992-04-03  |  1KB  |  49 lines

  1. /*
  2.  * locname.c -- create ttyloc file paths for ttyloc.c and finger
  3.  *
  4.  * Copyright (C) 1986, 1990  Philip L. Budne
  5.  *
  6.  * This file is part of "Phil's Finger Program".
  7.  *
  8.  * This program is free software; you can redistribute it and/or modify
  9.  * it under the terms of the GNU General Public License as published by
  10.  * the Free Software Foundation; either version 1, or (at your option)
  11.  * any later version.
  12.  *
  13.  */
  14.  
  15. # ifndef lint
  16. static char *rcsid = "$Id: locname.c,v 3.0 90/07/06 13:11:15 budd Rel $";
  17. # endif /* lint not defined */
  18.  
  19. # include "finger.h"
  20.  
  21. extern char localhost[];
  22.  
  23. LOCAL char *_locname(type, ttyname)
  24.     char *type, *ttyname;
  25. {
  26.     static char buffer[200];
  27.     sprintf(buffer, "%s/%s_%s_%s", TTYLOC_DIR, type, localhost, ttyname);
  28.     return( buffer );
  29. } /* _locname */
  30.  
  31. GLOBAL char *locname( ttyname )
  32.     char *ttyname;
  33. {
  34.     return( _locname("ttyloc", ttyname ) );
  35. } /* locname */
  36.  
  37. GLOBAL char *netlocname( ttyname )
  38.     char *ttyname;
  39. {
  40.     return( _locname("netloc", ttyname ) );
  41. } /* netlocname */
  42.  
  43.  
  44. /*
  45.  * Local variables:
  46.  * comment-column: 40
  47.  * End:
  48.  */
  49.