_CP_logon logs in to D3 from a C main program. This function must be called prior to any other function. This function returns -1 if an error occurs. The error code is contained in _CP_errno.


int _CP_logon(CPSTR* machine, CPSTR* user, CPSTR* u_passwd, CPSTR* md,
CPSTR* md_passwd, int pib, int flags);


machine D3 virtual machine.
user D3 user.
u_passwd D3 user password.
md D3 master dictionary.
md_passwd D3 master dictionary password.
pib Requested PIB or -1 for first available.
flags Reserved field - always pass a 0.


The example above logs in to D3 as the dm user in the dm account. It assumes that no passwords are present.

CPSTR * machine = _CP_mkstr("pick0");
CPSTR * user = _CP_mkstr("dm");
CPSTR * md = _CP_mkstr("dm");
int r;