* Clean up some function definitions to comply with strict
[alpine.git] / imap / src / osdep / amiga / ssl_none.c
bloba87c4be6ef24790103a300b2326a8ae311465651
1 /* ========================================================================
2 * Copyright 2008 Mark Crispin
3 * ========================================================================
4 */
6 /*
7 * Program: Dummy (no SSL) authentication/encryption module
9 * Author: Mark Crispin
11 * Date: 7 February 2001
12 * Last Edited: 19 November 2008
14 * Previous versions of this file were
16 * Copyright 1988-2006 University of Washington
18 * Licensed under the Apache License, Version 2.0 (the "License");
19 * you may not use this file except in compliance with the License.
20 * You may obtain a copy of the License at
22 * http://www.apache.org/licenses/LICENSE-2.0
26 /* Init server for SSL
27 * Accepts: server name
30 void ssl_server_init (char *server)
32 syslog (LOG_ERR,"This server does not support SSL");
33 exit (1); /* punt this program too */
37 /* Start TLS
38 * Accepts: /etc/services service name
39 * Returns: cpystr'd error string if TLS failed, else NIL for success
42 char *ssl_start_tls (char *server)
44 return cpystr ("This server does not support TLS");
47 /* Get character
48 * Returns: character or EOF
51 int PBIN (void)
53 int ret;
54 do {
55 clearerr (stdin);
56 ret = getchar ();
57 } while ((ret == EOF) && !feof (stdin) && ferror (stdin) &&(errno == EINTR));
58 return ret;
62 /* Get string
63 * Accepts: destination string pointer
64 * number of bytes available
65 * Returns: destination string pointer or NIL if EOF
68 char *PSIN (char *s,int n)
70 char *ret;
71 do {
72 clearerr (stdin);
73 ret = fgets (s,n,stdin);
74 } while (!ret && !feof (stdin) && ferror (stdin) && (errno == EINTR));
75 return ret;
79 /* Get record
80 * Accepts: destination string pointer
81 * number of bytes to read
82 * Returns: T if success, NIL otherwise
85 long PSINR (char *s,unsigned long n)
87 unsigned long i;
88 while (n && ((i = fread (s,1,n,stdin)) || (errno == EINTR))) s += i,n -= i;
89 return n ? NIL : LONGT;
93 /* Wait for input
94 * Accepts: timeout in seconds
95 * Returns: T if have input on stdin, else NIL
98 long INWAIT (long seconds)
100 return server_input_wait (seconds);
103 /* Put character
104 * Accepts: character
105 * Returns: character written or EOF
108 int PBOUT (int c)
110 return putchar (c);
114 /* Put string
115 * Accepts: source string pointer
116 * Returns: 0 or EOF if error
119 int PSOUT (char *s)
121 return fputs (s,stdout);
125 /* Put record
126 * Accepts: source sized text
127 * Returns: 0 or EOF if error
130 int PSOUTR (SIZEDTEXT *s)
132 unsigned char *t;
133 unsigned long i,j;
134 for (t = s->data,i = s->size;
135 (i && ((j = fwrite (t,1,i,stdout)) || (errno == EINTR)));
136 t += j,i -= j);
137 return i ? EOF : NIL;
141 /* Flush output
142 * Returns: 0 or EOF if error
145 int PFLUSH (void)
147 return fflush (stdout);