1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
#if !defined(lint) && !defined(DOS)
static char rcsid[] = "$Id: stubs.c 769 2007-10-24 00:15:40Z hubert@u.washington.edu $";
#endif
/* ========================================================================
* Copyright 2006-2007 University of Washington
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* ========================================================================
*/
#include <system.h>
#include <general.h>
#include "../../../c-client/c-client.h"
#include "../../../pith/takeaddr.h"
#include "../../../pith/ldap.h"
#include "../../../pith/debug.h"
#include "../../../pith/osdep/coredump.h"
#include "alpined.h"
/* let cleanup calls know we're screwed */
static int in_panic = 0;
/* input timeout */
static int input_timeout = 0;
/* time of last user-initiated newmail check */
static time_t time_of_input;
void
peMarkInputTime(void)
{
time_of_input = time((time_t *)0);
}
/********* ../../../pith/newmail.c stub **********/
time_t
time_of_last_input()
{
return(time_of_input);
}
/********* ../../../pith/conf.c stub **********/
int
set_input_timeout(t)
int t;
{
int old_t = input_timeout;
input_timeout = t;
return(old_t);
}
int
get_input_timeout()
{
return(input_timeout);
}
int
unexpected_pinerc_change()
{
dprint((1, "Unexpected pinerc change"));
return(0); /* always overwrite */
}
/********* ../../../pith/mailcap.c stub **********/
int
exec_mailcap_test_cmd(cmd)
char *cmd;
{
return(-1); /* never succeeds on web server */
}
/****** various other stuff ******/
/*----------------------------------------------------------------------
panic - call on detected programmatic errors to exit pine
Args: message -- message to record in debug file and to be printed for user
Result: The various tty modes are restored
If debugging is active a core dump will be generated
Exits Pine
This is also called from imap routines and fs_get and fs_resize.
----*/
void
alpine_panic(message)
char *message;
{
in_panic = 1;
syslog(LOG_ERR, "%s", message); /* may not work, but try */
#if 0
if(ps_global)
peDestroyUserContext(&ps_global);
#endif
#ifdef DEBUG
if(debug > 1)
coredump(); /*--- If we're debugging get a core dump --*/
#endif
exit(-1);
fatal("ffo"); /* BUG -- hack to get fatal out of library in right order*/
}
/*----------------------------------------------------------------------
panicking - called to test whether we're sunk
Args: none
----*/
int
panicking()
{
return(in_panic);
}
/*----------------------------------------------------------------------
exceptional_exit - called to exit under unusual conditions (with no core)
Args: message -- message to record in debug file and to be printed for user
ev -- exit value
----*/
void
exceptional_exit(message, ev)
char *message;
int ev;
{
syslog(LOG_ALERT, "%s", message);
exit(ev);
}
/*----------------------------------------------------------------------
write argument error to the display...
Args: none
Result: prints help messages
----------------------------------------------------------------------*/
void
display_args_err(s, a, err)
char *s;
char **a;
int err;
{
syslog(LOG_INFO, "Arg Error: %s", s);
}
|