File:  [Public] / libwww / Library / src / HTUser.html
Revision 2.2: download - view: text, annotated - select for diffs
Tue Jul 2 22:55:17 1996 UTC (27 years, 10 months ago) by frystyk
Branches: MAIN
CVS tags: Release-5-0a, Release-5-0, Release-4-1b5, Release-4-1b4, Release-4-1b3, PIPELINE1, HEAD
4.1b2

<HTML>
<HEAD>
  <!-- Changed by: Henrik Frystyk Nielsen,  1-Jul-1996 -->
  <TITLE>W3C Reference Library libwww User Profile Class</TITLE>
</HEAD>
<BODY>
<H1>
  The User Profile Class
</H1>
<PRE>
/*
**	(c) COPYRIGHT MIT 1995.
**	Please first read the full copyright statement in the file COPYRIGH.
*/
</PRE>
<P>
The User profile&nbsp;class manages what we know about a <I>user on this
host</I>. This can for example be the FQDN of the host, the user's email
address, the time zone, the news server etc. Note that this information does
not correspond to the actual information for the host but instead represents
"the information that the user wants to show the world". The user may use
an arbitrary email address to be used in a <A HREF="HTTPGen.html">HTTP
request</A>, for example. The application may assign a context to each use
which gives the application to extend the use of this class.
<P>
This module is implemented by <A HREF="HTUser.c">HTUser.c</A>, and it is
a part of the <A HREF="http://www.w3.org/pub/WWW/Library/">W3C Reference
Library</A>.
<PRE>
#ifndef HTUSER_H
#define HTUSER_H

typedef struct _HTUserProfile HTUserProfile;
</PRE>
<H2>
  Creation and Deletion Methods
</H2>
<P>
The application may create any number of user profile objects. By default
the Library creates a generic user which is the default value used to initialize
a <A HREF="HTReq.html">Request object</A>. This can be replaced by other
user profiles at any point in time.
<H3>
  Create a User Profile
</H3>
<PRE>extern HTUserProfile * HTUserProfile_new (const char * name, void * context);
</PRE>
<H3>
  Localize a User Profile
</H3>
<P>
Localize a user profile by filling in all the information that we can figure
out automatically, for example the email address, news server etc.
<PRE>extern BOOL HTUserProfile_localize (HTUserProfile * up);
</PRE>
<H3>
  Delete a User Profile
</H3>
<PRE>extern BOOL HTUserProfile_delete (HTUserProfile * up);
</PRE>
<H2>
  User Profile Class Methods
</H2>
<H3>
  Fully Qualified Domain Name (FQDN)
</H3>
<P>
The FQDN is a fully qualified domain name in that it contains both a local
host name and the domain name. It turns out that this is in fact very difficult
to obtain a FQDN on a variety of platforms.
<PRE>
extern char * HTUserProfile_fqdn (HTUserProfile * up);
extern BOOL HTUserProfile_setFqdn (HTUserProfile * up, const char * fqdn);
</PRE>
<H3>
  User Email Address
</H3>
<P>
This is the email address that the user wants to send out for example as
a "password" when using anonymous <A HREF="HTFTP.html">FTP access</A> and
as a "From" field in a <A HREF="HTTPGen.html">HTTP request</A>.
<PRE>
extern char * HTUserProfile_email (HTUserProfile * up);
extern BOOL HTUserProfile_setEmail (HTUserProfile * up, const char * email);
</PRE>
<H3>
  News Server
</H3>
<P>
Control the news server that this user wishes to use
<PRE>
extern char * HTUserProfile_news (HTUserProfile * host);
extern BOOL HTUserProfile_setNews (HTUserProfile * host, const char * news);
</PRE>
<H3>
  Location of Temporary Files
</H3>
<P>
Control the location for temporary files for this profile. The format
<B>must</B> be in URL format which is different from local file syntax as
URL syntaz <I>always</I> uses '/' as delimiters and also encoding of special
characters. See the
<A HREF="http://www.w3.org/pub/WWW/Addressing/">documentation on URLs</A>
for more information about URL syntax.
<PRE>
extern char * HTUserProfile_tmp (HTUserProfile * host);
extern BOOL HTUserProfile_setTmp (HTUserProfile * host, const char * tmp);
</PRE>
<H3>
  Local Time Zone (in seconds)
</H3>
<P>
Another widely used piece information that is very hard toobtain is the local
time zone. As we often must convert to and from GMT (Universal Time) we must
have the correct time zone. If we for some reason guesses wrong then the
user must change it manually.
<PRE>
extern time_t HTUserProfile_timezone (HTUserProfile * up);
extern BOOL HTUserProfile_setTimezone (HTUserProfile * up, time_t timezone);
</PRE>
<H3>
  User Profile Context
</H3>
<P>
The applicatoin may have additional information that it wishes to assign
to a user profile. It can do this using the user context which is handled
as follows:
<PRE>
extern void * HTUserProfile_context (HTUserProfile * up);
extern BOOL HTUserProfile_setContext (HTUserProfile * up, void * context);
</PRE>
<PRE>
#endif /* HTUser_H */
</PRE>
<P>
  <HR>
<ADDRESS>
  @(#) $Id: HTUser.html,v 2.2 1996/07/02 22:55:17 frystyk Exp $
</ADDRESS>
</BODY></HTML>

Webmaster