imapext-2007

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/osdep/dos/os_dwa.c	Mon Sep 14 15:17:45 2009 +0900
     1.3 @@ -0,0 +1,72 @@
     1.4 +/* ========================================================================
     1.5 + * Copyright 1988-2006 University of Washington
     1.6 + *
     1.7 + * Licensed under the Apache License, Version 2.0 (the "License");
     1.8 + * you may not use this file except in compliance with the License.
     1.9 + * You may obtain a copy of the License at
    1.10 + *
    1.11 + *     http://www.apache.org/licenses/LICENSE-2.0
    1.12 + *
    1.13 + * 
    1.14 + * ========================================================================
    1.15 + */
    1.16 +
    1.17 +/*
    1.18 + * Program:	Operating-system dependent routines -- DOS (Waterloo) version
    1.19 + *
    1.20 + * Author:	Mark Crispin
    1.21 + *		Networks and Distributed Computing
    1.22 + *		Computing & Communications
    1.23 + *		University of Washington
    1.24 + *		Administration Building, AG-44
    1.25 + *		Seattle, WA  98195
    1.26 + *		Internet: MRC@CAC.Washington.EDU
    1.27 + *
    1.28 + * Date:	11 April 1989
    1.29 + * Last Edited:	30 August 2006
    1.30 + */
    1.31 +
    1.32 +#include <tcp.h>		/* must be before TCPSTREAM definition */
    1.33 +#include "tcp_dwa.h"		/* must be before osdep include our tcp.h */
    1.34 +#include "mail.h"
    1.35 +#include "osdep.h"
    1.36 +#include <time.h>
    1.37 +#include <errno.h>
    1.38 +#include <fcntl.h>
    1.39 +#include <sys\stat.h>
    1.40 +#include <sys\timeb.h>
    1.41 +#include "misc.h"
    1.42 +
    1.43 +/* Undo compatibility definition */
    1.44 +
    1.45 +#undef tcp_open
    1.46 +
    1.47 +#include "fs_dos.c"
    1.48 +#include "ftl_dos.c"
    1.49 +#include "nl_dos.c"
    1.50 +#include "env_dos.c"
    1.51 +#include "tcp_dwa.c"
    1.52 +
    1.53 +
    1.54 +/* Return my local host name
    1.55 + * Returns: my local host name
    1.56 + */
    1.57 +
    1.58 +char *mylocalhost (void)
    1.59 +{
    1.60 +  if (!myLocalHost) {
    1.61 +    char *s,hname[32],tmp[MAILTMPLEN];
    1.62 +    long myip;
    1.63 +
    1.64 +    if (!sock_initted++) sock_init();
    1.65 +    tcp_cbrk (0x01);		/* turn off ctrl-break catching */
    1.66 +    /*
    1.67 +     * haven't discovered a way to find out the local host's 
    1.68 +     * name with wattcp yet.
    1.69 +     */
    1.70 +    if (myip = gethostid ()) sprintf (s = tmp,"[%s]",inet_ntoa (hname,myip));
    1.71 +    else s = "random-pc";
    1.72 +    myLocalHost = cpystr (s);
    1.73 +  }
    1.74 +  return myLocalHost;
    1.75 +}

UW-IMAP'd extensions by yuuji