cfunc.logon C Function/C Functions

cfunc.logon

Command cfunc.logon C Function/C Functions
Applicable release versions: AP 6.1
Category C Functions (120)
Description logs into Pick from a C main program.
This function must be called prior to any other function. The parameters used are the following:

machine
Pick virtual machine

user
Pick user

u_passwd
Pick user password

md
Pick master dictionary

md_passwd
Pick master dictionary password

pib
Requested pib or -1 for first available

flags
Reserved field - always pass a 0

This function returns -1 if an error occurs. The error code is contained in _CP_errno.
Syntax int _CP_logon(CPSTR* machine, CPSTR* user, CPSTR* u_passwd, CPSTR* md, CPSTR* md_passwd, int pib, int flags);
Options
Example
The following example logs into Pick 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;

r=_CP_logon(machine,user,_CP_str_null,md,_CP_str_null,-1,0);
Purpose
Related cfunc.introduction