imapext-2007

view src/osdep/tops-20/os_t20.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 -- TOPS-20 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: 1 August 1988
26 * Last Edited: 30 August 2006
27 */
30 /* Dedication:
31 * This file is dedicated with affection to the TOPS-20 operating system, which
32 * set standards for user and programmer friendliness that have still not been
33 * equaled by more `modern' operating systems.
34 * Wasureru mon ka!!!!
35 */
37 #include "mail.h"
38 #include <jsys.h> /* must be before tcp_t20.h */
39 #include "tcp_t20.h" /* must be before osdep include tcp.h */
40 #include <time.h>
41 #include "osdep.h"
42 #include <sys/time.h>
43 #include "misc.h"
44 #include <stdio.h>
45 #include <fcntl.h>
46 #include <sys/stat.h>
47 #include <ctype.h>
49 #include "fs_t20.c"
50 #include "ftl_t20.c"
51 #include "nl_t20.c"
52 #include "env_t20.c"
53 #include "tcp_t20.c"
54 #include "log_t20.c"
56 #define MD5ENABLE "PS:<SYSTEM>CRAM-MD5.PWD"
57 #include "auth_md5.c"
58 #include "auth_ext.c"
59 #include "auth_pla.c"
60 #include "auth_log.c"
62 /* Emulator for UNIX gethostid() call
63 * Returns: host id
64 */
66 long gethostid ()
67 {
68 int argblk[5];
69 #ifndef _APRID
70 #define _APRID 28
71 #endif
72 argblk[1] = _APRID;
73 jsys (GETAB,argblk);
74 return (long) argblk[1];
75 }
78 /* Emulator for UNIX getpass() call
79 * Accepts: prompt
80 * Returns: password
81 */
83 #define PWDLEN 128 /* used by Linux */
85 char *getpass (const char *prompt)
86 {
87 char *s;
88 static char pwd[PWDLEN];
89 int argblk[5],mode;
90 argblk[1] = (int) (prompt-1); /* prompt user */
91 jsys (PSOUT,argblk);
92 argblk[1] = _PRIIN; /* get current TTY mode */
93 jsys (RFMOD,argblk);
94 mode = argblk[2]; /* save for later */
95 argblk[2] &= ~06000;
96 jsys (SFMOD,argblk);
97 jsys (STPAR,argblk);
98 fgets (pwd,PWDLEN-1,stdin);
99 pwd[PWDLEN-1] = '\0';
100 if (s = strchr (pwd,'\n')) *s = '\0';
101 putchar ('\n');
102 argblk[2] = mode;
103 jsys (SFMOD,argblk);
104 jsys (STPAR,argblk);
105 return pwd;
106 }

UW-IMAP'd extensions by yuuji