File:  [Public] / libwww / Library / src / HTAlert.html
Revision 2.12.2.1: download - view: text, annotated - select for diffs
Thu Mar 9 18:15:57 1995 UTC (29 years, 2 months ago) by frystyk
Branches: without-configure
CVS tags: v3/0pre3
Diff to: branchpoint 2.12: preferred, colored
Library version 3.0beta

<HTML>
<HEAD>
<TITLE>Handling user messages in libwww</TITLE>
<NEXTID N="z3">
</HEAD>
<BODY>

<H1>Displaying Messages and Getting Input</H1>

<PRE>
/*
**	(c) COPYRIGHT CERN 1994.
**	Please first read the full copyright statement in the file COPYRIGH.
*/
</PRE>

This modue may be overridden for GUI clients. It allows progress
indications and warning messages to be communicated to the user in a
portable way.

<UL>
<LI>May 92 Created By C.T. Barker
<LI>Feb 93 Portablized etc TBL
</UL>

This module is implemented by <A HREF="HTAlert.c">HTAlert.c</A>, and
it is a part of the <A
HREF="http://info.cern.ch/hypertext/WWW/Library/User/Guide/Guide.html">
Library of Common Code</A>.

<PRE>
#ifndef HTALERT_H
#define HTALERT_H
#include <A NAME="z1" HREF="HTUtils.html">"HTUtils.h"</A>
</PRE>

<H2>Flags for This Module</H2>

<PRE>
extern BOOL HTInteractive;      	    /* Any prompts from the Library? */
</PRE>

<H2>HTPrompt and HTPromptPassword: Display a message and get the
input</H2>

HTPromptPassword() doesn't echo reply on the screen.

<H3>On entry,</H3>
<DL>
<DT>Msg
<DD> String to be displayed.
<DT>deflt
<DD> If NULL the default value (only
for HTPrompt())
</DL>

<H3>On exit,</H3>
<DL>
<DT>Return value
<DD> is malloc'd string which
must be freed.
</DL>

<PRE>		
extern char * HTPrompt PARAMS((CONST char * Msg, CONST char * deflt));
extern char * HTPromptPassword PARAMS((CONST char * Msg));

</PRE>
<H2>HTPromptUsernameAndPassword: Get both username and password</H2>
<H3>On entry,</H3>
<DL>
<DT>Msg<DD>String to be displayed.
<DT>username<DD> Pointer to char pointer, i.e. <CODE>*username</CODE>
points to a string.  If non-NULL it is taken to be a default value.
<DT>password<DD> Pointer to char pointer, i.e. <CODE>*password</CODE>
points to a string.  Initial value discarded.
</DL>
<H3>On exit,</H3>
<DL>
<DT>*username<DD> and
<DT>*password<DD> point to newly allocated strings representing
the typed-in username and password.  Initial strings pointed to
by them are NOT freed!
</DL>
<PRE>
extern void HTPromptUsernameAndPassword PARAMS((CONST char *	Msg,
						char **		username,
						char **		password));

</PRE>
<H2>Display a message, don't wait for
input</H2>
<H3>On entry,</H3>
<DL>
<DT>Msg
<DD> String to be displayed.
</DL>

<PRE>
extern void HTAlert PARAMS((CONST char * Msg));


</PRE>
<H2>Display a progress message for information
(and diagnostics) only</H2>
<H3>On entry,</H3>The input is a list of parameters
for printf.
<PRE>extern void HTProgress PARAMS((CONST char * Msg));


</PRE>
<H2>Display a message, then wait for
'yes' or 'no'.</H2>
<H3>On entry,</H3>
<DL>
<DT>Msg
<DD> String to be displayed
</DL>

<H3>On exit,</H3>
<DL>
<DT>Returns
<DD> If the user reacts in the
affirmative, returns TRUE, returns
FALSE otherwise.
</DL>

<PRE>
extern BOOL HTConfirm PARAMS ((CONST char * Msg));

#endif
</PRE>

</BODY>
</HTML>

Webmaster