imapext-2007

diff src/osdep/nt/ssl_none.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/nt/ssl_none.c	Mon Sep 14 15:17:45 2009 +0900
     1.3 @@ -0,0 +1,141 @@
     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:	Dummy (no SSL) authentication/encryption module
    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:	7 February 2001
    1.29 + * Last Edited:	30 August 2006
    1.30 + */
    1.31 +
    1.32 +/* Init server for SSL
    1.33 + * Accepts: server name
    1.34 + */
    1.35 +
    1.36 +void ssl_server_init (char *server)
    1.37 +{
    1.38 +  syslog (LOG_ERR,"This server does not support SSL");
    1.39 +  exit (1);			/* punt this program too */
    1.40 +}
    1.41 +
    1.42 +
    1.43 +/* Start TLS
    1.44 + * Accepts: /etc/services service name
    1.45 + * Returns: cpystr'd error string if TLS failed, else NIL for success
    1.46 + */
    1.47 +
    1.48 +char *ssl_start_tls (char *server)
    1.49 +{
    1.50 +  return cpystr ("This server does not support TLS");
    1.51 +}
    1.52 +
    1.53 +/* Get character
    1.54 + * Returns: character or EOF
    1.55 + */
    1.56 +
    1.57 +int PBIN (void)
    1.58 +{
    1.59 +  return getchar ();
    1.60 +}
    1.61 +
    1.62 +
    1.63 +/* Get string
    1.64 + * Accepts: destination string pointer
    1.65 + *	    number of bytes available
    1.66 + * Returns: destination string pointer or NIL if EOF
    1.67 + */
    1.68 +
    1.69 +char *PSIN (char *s,int n)
    1.70 +{
    1.71 +  return fgets (s,n,stdin);
    1.72 +}
    1.73 +
    1.74 +
    1.75 +/* Get record
    1.76 + * Accepts: destination string pointer
    1.77 + *	    number of bytes to read
    1.78 + * Returns: T if success, NIL otherwise
    1.79 + */
    1.80 +
    1.81 +long PSINR (char *s,unsigned long n)
    1.82 +{
    1.83 +  unsigned long i;
    1.84 +  while (n && ((i = fread (s,1,n,stdin)) || (errno == EINTR))) s += i,n -= i;
    1.85 +  return n ? NIL : LONGT;
    1.86 +}
    1.87 +
    1.88 +
    1.89 +/* Wait for input
    1.90 + * Accepts: timeout in seconds
    1.91 + * Returns: T if have input on stdin, else NIL
    1.92 + */
    1.93 +
    1.94 +long INWAIT (long seconds)
    1.95 +{
    1.96 +  return server_input_wait (seconds);
    1.97 +}
    1.98 +
    1.99 +/* Put character
   1.100 + * Accepts: character
   1.101 + * Returns: character written or EOF
   1.102 + */
   1.103 +
   1.104 +int PBOUT (int c)
   1.105 +{
   1.106 +  return putchar (c);
   1.107 +}
   1.108 +
   1.109 +
   1.110 +/* Put string
   1.111 + * Accepts: source string pointer
   1.112 + * Returns: 0 or EOF if error
   1.113 + */
   1.114 +
   1.115 +int PSOUT (char *s)
   1.116 +{
   1.117 +  return fputs (s,stdout);
   1.118 +}
   1.119 +
   1.120 +
   1.121 +/* Put record
   1.122 + * Accepts: source sized text
   1.123 + * Returns: 0 or EOF if error
   1.124 + */
   1.125 +
   1.126 +int PSOUTR (SIZEDTEXT *s)
   1.127 +{
   1.128 +  unsigned char *t;
   1.129 +  unsigned long i,j;
   1.130 +  for (t = s->data,i = s->size;
   1.131 +       (i && ((j = fwrite (t,1,i,stdout)) || (errno == EINTR)));
   1.132 +       t += j,i -= j);
   1.133 +  return i ? EOF : NIL;
   1.134 +}
   1.135 +
   1.136 +
   1.137 +/* Flush output
   1.138 + * Returns: 0 or EOF if error
   1.139 + */
   1.140 +
   1.141 +int PFLUSH (void)
   1.142 +{
   1.143 +  return fflush (stdout);
   1.144 +}

UW-IMAP'd extensions by yuuji