Subject: c-client initialization

From: John-Paul Robinson <[email-masked]>
Date: Tue, 15 Feb 2000 15:37:06 -0600

Is is necessary to initialize c-client using either env_init() or
myusername_full()?  It appears that env_init() sets paths which could be
set with equivalent mail_parameters() calls and myusername_full() is a
convenience routine to get the user name of the process.  I'm not
suggesting these functions aren't useful, just wondering when the need
to be used. 

I intend to "relocate" c-client at run-time using mail_parameters(), so
do I need to call env_init().  Also, if I have no use for the user name,
do I need to call myusername_full()?

Thanks,

John-Paul Robinson
-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Tue, 15 Feb 2000 13:44:40 -0800 (PST)

On Tue, 15 Feb 2000 15:37:06 -0600, John-Paul Robinson wrote:
> myusername_full()?

Or by myhomedir(), or sysinbox(), or any of the other routines that lead to
env_init()...

The basic answer is "yes".  myusername() or myusername_full() is generally the
one that most people use rather than calling env_init() directly.

> It appears that env_init() sets paths which could be
> set with equivalent mail_parameters() calls

Yes, but you should call env_init() before doing any of these calls().

> just wondering when the need
> to be used.

env_init() does quite a lot of initialization, and needs to be called one way
or another before any other use..

> do I need to call myusername_full()?

I think that I've answered this, but to reiterate just in case:

env_init() must be called at the startup of your application.  Prior to the
call, c-client is in a state used only by unlogged-in imapd and ipop[23]d, and
is not otherwise supported.  Note that this state is also that used by root; I
do not support general use of c-client by UID 0.

The easiest way to do the required env_init() is with myusername().  Even a
	(void) myusername ();
is good enough.