~ubuntu-branches/ubuntu/edgy/lynx/edgy

« back to all changes in this revision

Viewing changes to src/HTAlert.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-09-16 12:14:10 UTC
  • Revision ID: james.westby@ubuntu.com-20040916121410-cz1gu92c4nqfeyrg
Tags: upstream-2.8.5
ImportĀ upstreamĀ versionĀ 2.8.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*      Displaying messages and getting input for WWW Library
 
2
**      =====================================================
 
3
**
 
4
**         May 92 Created By C.T. Barker
 
5
**         Feb 93 Portablized etc TBL
 
6
*/
 
7
 
 
8
#ifndef HTALERT_H
 
9
#define HTALERT_H 1
 
10
 
 
11
#include <LYCookie.h>
 
12
 
 
13
#define ALERT_PREFIX_LEN 5
 
14
 
 
15
/*      Display a message and get the input
 
16
**
 
17
**      On entry,
 
18
**              Msg is the message.
 
19
**
 
20
**      On exit,
 
21
**              Return value is malloc'd string which must be freed.
 
22
*/
 
23
extern char * HTPrompt PARAMS((CONST char * Msg, CONST char * deflt));
 
24
 
 
25
 
 
26
/*      Display a message, don't wait for input
 
27
**
 
28
**      On entry,
 
29
**              The input is a list of parameters for printf.
 
30
*/
 
31
extern void HTAlert PARAMS((CONST char * Msg));
 
32
extern void HTAlwaysAlert PARAMS((CONST char * extra_prefix, CONST char * Msg));
 
33
extern void HTInfoMsg PARAMS((CONST char * Msg));
 
34
extern void HTUserMsg PARAMS((CONST char * Msg));
 
35
extern void HTUserMsg2 PARAMS((CONST char * Msg, CONST char * Arg));
 
36
 
 
37
 
 
38
/*      Display a progress message for information (and diagnostics) only
 
39
**
 
40
**      On entry,
 
41
**              The input is a list of parameters for printf.
 
42
*/
 
43
extern CONST char *HTProgressUnits PARAMS((int kilobytes));
 
44
extern void HTProgress PARAMS((CONST char * Msg));
 
45
extern void HTReadProgress PARAMS((long bytes, long total));
 
46
#define _HTProgress(msg)        mustshow = TRUE, HTProgress(msg)
 
47
 
 
48
/*
 
49
 *  Indicates whether last HTConfirm was cancelled (^G or ^C) and
 
50
 *  resets flag. (so only call once!) - kw
 
51
 */
 
52
extern BOOL HTLastConfirmCancelled NOPARAMS;
 
53
 
 
54
/*
 
55
**      Supports logic for forced yes/no prompt results.
 
56
*/
 
57
extern int HTForcedPrompt PARAMS((int Opt, CONST char * Msg, int Dft));
 
58
 
 
59
/*      Display a message, then wait for 'yes' or 'no', allowing default
 
60
**      response if a return or left-arrow is used.
 
61
**
 
62
**      On entry,
 
63
**              Takes a list of parameters for printf.
 
64
**
 
65
**      On exit,
 
66
**              If the user enters 'YES', returns TRUE, returns FALSE
 
67
**              otherwise.
 
68
*/
 
69
extern int HTConfirmDefault PARAMS ((CONST char * Msg, int Dft));
 
70
 
 
71
 
 
72
/*      Display a message, then wait for 'yes' or 'no'.
 
73
**
 
74
**      On entry,
 
75
**              Takes a list of parameters for printf.
 
76
**
 
77
**      On exit,
 
78
**              If the user enters 'YES', returns TRUE, returns FALSE
 
79
**              otherwise.
 
80
*/
 
81
extern BOOL HTConfirm PARAMS ((CONST char * Msg));
 
82
 
 
83
extern BOOL confirm_post_resub PARAMS((
 
84
    CONST char*         address,
 
85
    CONST char*         title,
 
86
    int                 if_imgmap,
 
87
    int                 if_file));
 
88
 
 
89
/*      Prompt for password without echoing the reply
 
90
*/
 
91
extern char * HTPromptPassword PARAMS((CONST char * Msg));
 
92
 
 
93
/*      Prompt both username and password       HTPromptUsernameAndPassword()
 
94
**      ---------------------------------
 
95
** On entry,
 
96
**      Msg             is the prompting message.
 
97
**      *username and
 
98
**      *password       are char pointers; they are changed
 
99
**                      to point to result strings.
 
100
**      IsProxy         should be TRUE if this is for
 
101
**                      proxy authentication.
 
102
**
 
103
**                      If *username is not NULL, it is taken
 
104
**                      to point to  a default value.
 
105
**                      Initial value of *password is
 
106
**                      completely discarded.
 
107
**
 
108
** On exit,
 
109
**      *username and *password point to newly allocated
 
110
**      strings -- original strings pointed to by them
 
111
**      are NOT freed.
 
112
**
 
113
*/
 
114
extern void HTPromptUsernameAndPassword PARAMS((
 
115
        CONST char *    Msg,
 
116
        char **         username,
 
117
        char **         password,
 
118
        BOOL            IsProxy));
 
119
 
 
120
 
 
121
/*      Confirm a cookie operation.                     HTConfirmCookie()
 
122
**      ---------------------------
 
123
**
 
124
**  On entry,
 
125
**      server                  is the server sending the Set-Cookie.
 
126
**      domain                  is the domain of the cookie.
 
127
**      path                    is the path of the cookie.
 
128
**      name                    is the name of the cookie.
 
129
**      value                   is the value of the cookie.
 
130
**
 
131
**  On exit,
 
132
**      Returns FALSE on cancel,
 
133
**              TRUE if the cookie should be set.
 
134
*/
 
135
extern BOOL HTConfirmCookie PARAMS((
 
136
        domain_entry *  dp,
 
137
        CONST char *    server,
 
138
        CONST char *    name,
 
139
        CONST char *    value));
 
140
 
 
141
 
 
142
/*      Confirm redirection of POST.            HTConfirmPostRedirect()
 
143
**      ----------------------------
 
144
**  On entry,
 
145
**      Redirecting_url             is the Location.
 
146
**      server_status               is the server status code.
 
147
**
 
148
**  On exit,
 
149
**      Returns 0 on cancel,
 
150
**        1 for redirect of POST with content,
 
151
**      303 for redirect as GET without content
 
152
*/
 
153
extern int HTConfirmPostRedirect PARAMS((
 
154
        CONST char *    Redirecting_url,
 
155
        int             server_status));
 
156
 
 
157
 
 
158
extern void LYSleepAlert NOPARAMS;
 
159
extern void LYSleepDebug NOPARAMS;
 
160
extern void LYSleepInfo NOPARAMS;
 
161
extern void LYSleepMsg NOPARAMS;
 
162
extern void LYSleepReplay NOPARAMS;
 
163
 
 
164
#ifdef HAVE_STRERROR
 
165
#define LYStrerror strerror
 
166
#else
 
167
extern char *LYStrerror PARAMS((
 
168
        int             code));
 
169
#endif /* HAVE_STRERROR */
 
170
 
 
171
#endif /* HTALERT_H */