OSDN Git Service

import nethack-3.6.0
[jnethack/source.git] / sys / share / nhlan.c
1 /* NetHack 3.6  nhlan.c $NHDT-Date: 1432512786 2015/05/25 00:13:06 $  $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ */
2 /* Copyright (c) Michael Allison, 1997                  */
3 /* NetHack may be freely redistributed.  See license for details. */
4
5 /*
6  * Currently shared by the following ports:
7  *      WIN32
8  *
9  * The code in here is used to take advantage of added features
10  * that might be available in a Local Area Network environment.
11  *
12  *      Network Username of player
13  */
14
15 #include "hack.h"
16 #include <ctype.h>
17
18 #ifdef LAN_FEATURES
19
20 void
21 init_lan_features()
22 {
23     lan_username();
24 }
25 /*
26  * The get_lan_username() call is a required call, since some of
27  * the other LAN features depend on a unique username being available.
28  *
29  */
30 char lusername[MAX_LAN_USERNAME];
31 int lusername_size = MAX_LAN_USERNAME;
32
33 char *
34 lan_username()
35 {
36     char *lu;
37     lu = get_username(&lusername_size);
38     if (lu) {
39         Strcpy(lusername, lu);
40         return lusername;
41     } else
42         return (char *) 0;
43 }
44 #endif /*LAN_FEATURES*/
45 /*nhlan.c*/