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