Annotation of libwww/Library/src/HTAlert.html, revision 2.20
2.6 timbl 1: <HTML>
2: <HEAD>
2.20 ! frystyk 3: <TITLE>Displaying and Promting User Messages</TITLE>
! 4: <!-- Changed by: Henrik Frystyk Nielsen, 11-Jul-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>
58: extern BOOL HTInteractive; /* Any prompts from the Library? */
2.6 timbl 59: </PRE>
2.11 frystyk 60:
2.15 frystyk 61: <H3>Display a message, then wait for 'YES' or 'NO'</H3>
2.11 frystyk 62:
2.15 frystyk 63: This function prompts the user for a confirmation on the message
64: passed as a parameter. If the user reacts in the affirmative, returns
65: <EM>TRUE</EM>, returns <EM>FALSE</EM> otherwise.
2.11 frystyk 66:
2.15 frystyk 67: <PRE>
68: extern BOOL HTConfirm PARAMS((CONST char * Msg));
69: </PRE>
70:
71: <H3>Prompt the User a Question</H3>
72:
73: Prompt for answer and get text back. Reply text is either NULL on
74: error or a dynamic string which the caller must free.
2.6 timbl 75:
76: <PRE>
1.1 timbl 77: extern char * HTPrompt PARAMS((CONST char * Msg, CONST char * deflt));
2.15 frystyk 78: </PRE>
79:
80: <H3>Prompt for a Password</H3>
81:
82: Prompt for password without echoing the reply. Reply text is weither
83: NULL on error or a dynamic string which the caller must free. <P>
84:
85: <B>NOTE:</B> The current version uses <EM>getpass</EM> which on many
86: systems returns a string of 8 or 16 bytes.
87:
88: <PRE>
2.7 luotonen 89: extern char * HTPromptPassword PARAMS((CONST char * Msg));
2.15 frystyk 90: </PRE>
91:
2.16 frystyk 92: <H3>Prompt for a UserID and a Password</H3>
2.15 frystyk 93:
94: This is just a composite function using <EM>HTPrompt</EM> and
95: <EM>HTPromptPassword</EM>. The strings returned must be freed by
96: caller.
1.1 timbl 97:
2.8 luotonen 98: <PRE>
99: extern void HTPromptUsernameAndPassword PARAMS((CONST char * Msg,
100: char ** username,
101: char ** password));
2.15 frystyk 102: </PRE>
1.1 timbl 103:
2.17 frystyk 104: <A NAME="NonInteractive"><H2>Messages, Warnings, and Errors</H2></A>
2.15 frystyk 105:
106: These functions are used to inform the user of an event which requires
107: no response form the user.
108:
109: <H3>Display a Message</H3>
110:
111: This function simply puts out the message passed.
2.6 timbl 112:
113: <PRE>
1.1 timbl 114: extern void HTAlert PARAMS((CONST char * Msg));
2.6 timbl 115: </PRE>
116:
2.15 frystyk 117: <H3>Display a Status Message on what's going on</H3>
2.6 timbl 118:
2.15 frystyk 119: This function can be used to indicate the current status of a certain
120: action.
2.6 timbl 121:
122: <PRE>
2.15 frystyk 123: extern void HTProgress PARAMS((CONST char * Msg));
2.17 frystyk 124: </PRE>
125:
126: <H3>Generating an Error Message of a request</H3>
127:
128: This function outputs the content of the error_stack to standard
129: output (used in Line Mode Browser), but smart clients and servers
130: might overwrite this function so that the error messages can be
131: handled to the user in a nice(r) way. That is the reason for putting
132: the actual implementation in <A HREF="HTAlert.c">HTAlert.c</A>.<P>
133:
134: <B>Note:</B> If a stream <EM>has</EM> been put up (and maybe taken
135: down again) inside the Library, then request->error_block has been
136: set to YES. This indicates that it is NOT possible any more to use the
137: stream as output for the message.
138:
139: <PRE>
140: extern void HTErrorMsg PARAMS((HTRequest * request));
2.6 timbl 141:
2.12 frystyk 142: #endif
143: </PRE>
2.6 timbl 144:
2.12 frystyk 145: </BODY>
2.6 timbl 146: </HTML>
Webmaster