imapext-2007

view src/osdep/dos/os_dwa.c @ 0:ada5e610ab86

imap-2007e
author yuuji@gentei.org
date Mon, 14 Sep 2009 15:17:45 +0900
parents
children
line source
1 /* ========================================================================
2 * Copyright 1988-2006 University of Washington
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 *
11 * ========================================================================
12 */
14 /*
15 * Program: Operating-system dependent routines -- DOS (Waterloo) version
16 *
17 * Author: Mark Crispin
18 * Networks and Distributed Computing
19 * Computing & Communications
20 * University of Washington
21 * Administration Building, AG-44
22 * Seattle, WA 98195
23 * Internet: MRC@CAC.Washington.EDU
24 *
25 * Date: 11 April 1989
26 * Last Edited: 30 August 2006
27 */
29 #include <tcp.h> /* must be before TCPSTREAM definition */
30 #include "tcp_dwa.h" /* must be before osdep include our tcp.h */
31 #include "mail.h"
32 #include "osdep.h"
33 #include <time.h>
34 #include <errno.h>
35 #include <fcntl.h>
36 #include <sys\stat.h>
37 #include <sys\timeb.h>
38 #include "misc.h"
40 /* Undo compatibility definition */
42 #undef tcp_open
44 #include "fs_dos.c"
45 #include "ftl_dos.c"
46 #include "nl_dos.c"
47 #include "env_dos.c"
48 #include "tcp_dwa.c"
51 /* Return my local host name
52 * Returns: my local host name
53 */
55 char *mylocalhost (void)
56 {
57 if (!myLocalHost) {
58 char *s,hname[32],tmp[MAILTMPLEN];
59 long myip;
61 if (!sock_initted++) sock_init();
62 tcp_cbrk (0x01); /* turn off ctrl-break catching */
63 /*
64 * haven't discovered a way to find out the local host's
65 * name with wattcp yet.
66 */
67 if (myip = gethostid ()) sprintf (s = tmp,"[%s]",inet_ntoa (hname,myip));
68 else s = "random-pc";
69 myLocalHost = cpystr (s);
70 }
71 return myLocalHost;
72 }

UW-IMAP'd extensions by yuuji