/*-*-ratfor-*-*/ /************************************************************************ * unique_name -- create a process unique name * * * * usage len = unique_name (seed, name) * * where unique_name is the length of the name * * seed is a 'seed' string passed in * * name is the name passed back out, null terminated * * note unique_name appends the pid to the seed, multiple * * calls to this routine with the same seed will not * * produce different names (see the LBLTOOLS routine * * for one of those). This routine is meant for * * creating a name to place in the group table (such * * as a mailbox name) so that others using the same * * routine will not have the same name and so cause * * confusion. * ************************************************************************/ longword function unique_name (seed, name) character seed, name longword jobid call get_proc_id (jobid) call sprintf (name, "%s%x", seed, jobid) unique_name = length (name) return end /************************************************************************ * get_proc_id -- return a process id * * * * usage call get_proc_id (id) * * where id is a longword in which to pass back the pid * ************************************************************************/ subroutine get_proc_id (id) longword id, get_proc_info, group, member, owner_id character name (16), term (8), user (13), image (65) if (^get_proc_info (id, group, member, owner_id, name, term, user, image)) id = 999 # constant in case of failure return end