Annotation of libwww/Library/src/HTAlert.html, revision 2.22
2.6 timbl 1: <HTML>
2: <HEAD>
2.20 frystyk 3: <TITLE>Displaying and Promting User Messages</TITLE>
2.22 ! frystyk 4: <!-- Changed by: Henrik Frystyk Nielsen, 19-Aug-1995 -->
2.6 timbl 5: <NEXTID N="z3">
6: </HEAD>
7: <BODY>
2.12 frystyk 8:
2.20 frystyk 9: <H1>Displaying and Promting User Messages</H1>
2.10 frystyk 10:
2.12 frystyk 11: <PRE>
12: /*
2.18 frystyk 13: ** (c) COPYRIGHT MIT 1995.
2.12 frystyk 14: ** Please first read the full copyright statement in the file COPYRIGH.
15: */
16: </PRE>
17:
2.15 frystyk 18: This module may be overridden for GUI clients. It allows progress
2.12 frystyk 19: indications and warning messages to be communicated to the user in a
2.15 frystyk 20: portable way using stdio. Yes, I know that not all platforms have
21: stdio :-(. It contain two parts:
22:
23: <UL>
24: <LI><A HREF="#Interactive">A User Interactive part</A>
25: <LI><A HREF="#NonInteractive">A part for sending messages to the user</A>
26: </UL>
2.10 frystyk 27:
2.6 timbl 28: <UL>
29: <LI>May 92 Created By C.T. Barker
30: <LI>Feb 93 Portablized etc TBL
2.15 frystyk 31: <LI>Mar 95 Updated by Henrik
2.6 timbl 32: </UL>
2.12 frystyk 33:
34: This module is implemented by <A HREF="HTAlert.c">HTAlert.c</A>, and
35: it is a part of the <A
2.19 frystyk 36: HREF="http://www.w3.org/hypertext/WWW/Library/">
37: W3C Reference Library</A>.
2.12 frystyk 38:
2.11 frystyk 39: <PRE>
2.12 frystyk 40: #ifndef HTALERT_H
41: #define HTALERT_H
2.17 frystyk 42:
43: #include "HTAccess.h"
2.11 frystyk 44: </PRE>
45:
2.15 frystyk 46: <A NAME="Interactive"><H2>User Interactive Functions</H2></A>
47:
48: These functions require the user to interact in some way
49:
50: <H3>Flags for This Module</H3>
51:
52: If you really don't want the library to prompt for anything at all
53: then enable this constant. The default value is <EM>OFF</EM>. All
54: functions returning a <EM>string</EM> return a dynamic string which
55: must be freed by the caller.
2.8 luotonen 56:
2.11 frystyk 57: <PRE>
2.22 ! frystyk 58: extern void HTPrompt_setInteractive PARAMS((BOOL interative));
! 59: extern BOOL HTPrompt_interactive NOPARAMS;
2.6 timbl 60: </PRE>
2.11 frystyk 61:
2.15 frystyk 62: <H3>Display a message, then wait for 'YES' or 'NO'</H3>
2.11 frystyk 63:
2.15 frystyk 64: This function prompts the user for a confirmation on the message
65: passed as a parameter. If the user reacts in the affirmative, returns
66: <EM>TRUE</EM>, returns <EM>FALSE</EM> otherwise.
2.11 frystyk 67:
2.15 frystyk 68: <PRE>
69: extern BOOL HTConfirm PARAMS((CONST char * Msg));
70: </PRE>
71:
72: <H3>Prompt the User a Question</H3>
73:
74: Prompt for answer and get text back. Reply text is either NULL on
75: error or a dynamic string which the caller must free.
2.6 timbl 76:
77: <PRE>
1.1 timbl 78: extern char * HTPrompt PARAMS((CONST char * Msg, CONST char * deflt));
2.15 frystyk 79: </PRE>
80:
81: <H3>Prompt for a Password</H3>
82:
83: Prompt for password without echoing the reply. Reply text is weither
84: NULL on error or a dynamic string which the caller must free. <P>
85:
86: <B>NOTE:</B> The current version uses <EM>getpass</EM> which on many
87: systems returns a string of 8 or 16 bytes.
88:
89: <PRE>
2.7 luotonen 90: extern char * HTPromptPassword PARAMS((CONST char * Msg));
2.15 frystyk 91: </PRE>
92:
2.16 frystyk 93: <H3>Prompt for a UserID and a Password</H3>
2.15 frystyk 94:
95: This is just a composite function using <EM>HTPrompt</EM> and
96: <EM>HTPromptPassword</EM>. The strings returned must be freed by
97: caller.
1.1 timbl 98:
2.8 luotonen 99: <PRE>
100: extern void HTPromptUsernameAndPassword PARAMS((CONST char * Msg,
101: char ** username,
102: char ** password));
2.15 frystyk 103: </PRE>
1.1 timbl 104:
2.17 frystyk 105: <A NAME="NonInteractive"><H2>Messages, Warnings, and Errors</H2></A>
2.15 frystyk 106:
107: These functions are used to inform the user of an event which requires
108: no response form the user.
109:
110: <H3>Display a Message</H3>
111:
112: This function simply puts out the message passed.
2.6 timbl 113:
114: <PRE>
1.1 timbl 115: extern void HTAlert PARAMS((CONST char * Msg));
2.6 timbl 116: </PRE>
117:
2.15 frystyk 118: <H3>Display a Status Message on what's going on</H3>
2.6 timbl 119:
2.15 frystyk 120: This function can be used to indicate the current status of a certain
121: action.
2.6 timbl 122:
123: <PRE>
2.15 frystyk 124: extern void HTProgress PARAMS((CONST char * Msg));
2.17 frystyk 125: </PRE>
126:
127: <H3>Generating an Error Message of a request</H3>
128:
129: This function outputs the content of the error_stack to standard
130: output (used in Line Mode Browser), but smart clients and servers
131: might overwrite this function so that the error messages can be
132: handled to the user in a nice(r) way. That is the reason for putting
133: the actual implementation in <A HREF="HTAlert.c">HTAlert.c</A>.<P>
134:
135: <B>Note:</B> If a stream <EM>has</EM> been put up (and maybe taken
136: down again) inside the Library, then request->error_block has been
137: set to YES. This indicates that it is NOT possible any more to use the
138: stream as output for the message.
139:
140: <PRE>
141: extern void HTErrorMsg PARAMS((HTRequest * request));
2.6 timbl 142:
2.12 frystyk 143: #endif
144: </PRE>
2.6 timbl 145:
2.12 frystyk 146: </BODY>
2.6 timbl 147: </HTML>
Webmaster