imapext-2007

annotate src/osdep/amiga/ssl_none.c @ 0:ada5e610ab86

imap-2007e
author yuuji@gentei.org
date Mon, 14 Sep 2009 15:17:45 +0900
parents
children
rev   line source
yuuji@0 1 /* ========================================================================
yuuji@0 2 * Copyright 1988-2006 University of Washington
yuuji@0 3 *
yuuji@0 4 * Licensed under the Apache License, Version 2.0 (the "License");
yuuji@0 5 * you may not use this file except in compliance with the License.
yuuji@0 6 * You may obtain a copy of the License at
yuuji@0 7 *
yuuji@0 8 * http://www.apache.org/licenses/LICENSE-2.0
yuuji@0 9 *
yuuji@0 10 *
yuuji@0 11 * ========================================================================
yuuji@0 12 */
yuuji@0 13
yuuji@0 14 /*
yuuji@0 15 * Program: Dummy (no SSL) authentication/encryption module
yuuji@0 16 *
yuuji@0 17 * Author: Mark Crispin
yuuji@0 18 * Networks and Distributed Computing
yuuji@0 19 * Computing & Communications
yuuji@0 20 * University of Washington
yuuji@0 21 * Administration Building, AG-44
yuuji@0 22 * Seattle, WA 98195
yuuji@0 23 * Internet: MRC@CAC.Washington.EDU
yuuji@0 24 *
yuuji@0 25 * Date: 7 February 2001
yuuji@0 26 * Last Edited: 30 August 2006
yuuji@0 27 */
yuuji@0 28
yuuji@0 29 /* Init server for SSL
yuuji@0 30 * Accepts: server name
yuuji@0 31 */
yuuji@0 32
yuuji@0 33 void ssl_server_init (char *server)
yuuji@0 34 {
yuuji@0 35 syslog (LOG_ERR,"This server does not support SSL");
yuuji@0 36 exit (1); /* punt this program too */
yuuji@0 37 }
yuuji@0 38
yuuji@0 39
yuuji@0 40 /* Start TLS
yuuji@0 41 * Accepts: /etc/services service name
yuuji@0 42 * Returns: cpystr'd error string if TLS failed, else NIL for success
yuuji@0 43 */
yuuji@0 44
yuuji@0 45 char *ssl_start_tls (char *server)
yuuji@0 46 {
yuuji@0 47 return cpystr ("This server does not support TLS");
yuuji@0 48 }
yuuji@0 49
yuuji@0 50 /* Get character
yuuji@0 51 * Returns: character or EOF
yuuji@0 52 */
yuuji@0 53
yuuji@0 54 int PBIN (void)
yuuji@0 55 {
yuuji@0 56 return getchar ();
yuuji@0 57 }
yuuji@0 58
yuuji@0 59
yuuji@0 60 /* Get string
yuuji@0 61 * Accepts: destination string pointer
yuuji@0 62 * number of bytes available
yuuji@0 63 * Returns: destination string pointer or NIL if EOF
yuuji@0 64 */
yuuji@0 65
yuuji@0 66 char *PSIN (char *s,int n)
yuuji@0 67 {
yuuji@0 68 return fgets (s,n,stdin);
yuuji@0 69 }
yuuji@0 70
yuuji@0 71
yuuji@0 72 /* Get record
yuuji@0 73 * Accepts: destination string pointer
yuuji@0 74 * number of bytes to read
yuuji@0 75 * Returns: T if success, NIL otherwise
yuuji@0 76 */
yuuji@0 77
yuuji@0 78 long PSINR (char *s,unsigned long n)
yuuji@0 79 {
yuuji@0 80 unsigned long i;
yuuji@0 81 while (n && ((i = fread (s,1,n,stdin)) || (errno == EINTR))) s += i,n -= i;
yuuji@0 82 return n ? NIL : LONGT;
yuuji@0 83 }
yuuji@0 84
yuuji@0 85
yuuji@0 86 /* Wait for input
yuuji@0 87 * Accepts: timeout in seconds
yuuji@0 88 * Returns: T if have input on stdin, else NIL
yuuji@0 89 */
yuuji@0 90
yuuji@0 91 long INWAIT (long seconds)
yuuji@0 92 {
yuuji@0 93 return server_input_wait (seconds);
yuuji@0 94 }
yuuji@0 95
yuuji@0 96 /* Put character
yuuji@0 97 * Accepts: character
yuuji@0 98 * Returns: character written or EOF
yuuji@0 99 */
yuuji@0 100
yuuji@0 101 int PBOUT (int c)
yuuji@0 102 {
yuuji@0 103 return putchar (c);
yuuji@0 104 }
yuuji@0 105
yuuji@0 106
yuuji@0 107 /* Put string
yuuji@0 108 * Accepts: source string pointer
yuuji@0 109 * Returns: 0 or EOF if error
yuuji@0 110 */
yuuji@0 111
yuuji@0 112 int PSOUT (char *s)
yuuji@0 113 {
yuuji@0 114 return fputs (s,stdout);
yuuji@0 115 }
yuuji@0 116
yuuji@0 117
yuuji@0 118 /* Put record
yuuji@0 119 * Accepts: source sized text
yuuji@0 120 * Returns: 0 or EOF if error
yuuji@0 121 */
yuuji@0 122
yuuji@0 123 int PSOUTR (SIZEDTEXT *s)
yuuji@0 124 {
yuuji@0 125 unsigned char *t;
yuuji@0 126 unsigned long i,j;
yuuji@0 127 for (t = s->data,i = s->size;
yuuji@0 128 (i && ((j = fwrite (t,1,i,stdout)) || (errno == EINTR)));
yuuji@0 129 t += j,i -= j);
yuuji@0 130 return i ? EOF : NIL;
yuuji@0 131 }
yuuji@0 132
yuuji@0 133
yuuji@0 134 /* Flush output
yuuji@0 135 * Returns: 0 or EOF if error
yuuji@0 136 */
yuuji@0 137
yuuji@0 138 int PFLUSH (void)
yuuji@0 139 {
yuuji@0 140 return fflush (stdout);
yuuji@0 141 }

UW-IMAP'd extensions by yuuji