src/liflines/miscutls.c
/*===================================================
 * who_is_he_she -- Find who person is from key value
 *=================================================*/
- Find who person is from key value
- Find who person is from key value
void
who_is_he_she (void)
{
	STRING str, rawrec;
	NODE indi;
	INT len;
	char nkey[100];
	char key[20];
	if (!ask_for_string(_("Please enter person's internal key value."),
	    _("enter key:"), key, sizeof(key))
		 || !key[0])
		 return;
	nkey[0] = 'I';
	if (*key == 'I')
		strcpy(nkey, key);
	else
		strcpy(&nkey[1], key);
	if (!(rawrec = retrieve_raw_record(nkey, &len))) {
		msg_error(_("No one in database has key value %s."), key);
		return;
	}
	if (!(indi = string_to_node(rawrec))) {
		msg_error(_("No one in database has key value %s."), key);
		stdfree(rawrec);
		return;
	}
	if (!(str = indi_to_name(indi, 60)) || *str == 0) {
		msg_error(_("No one in database has key value %s."), key);
		stdfree(rawrec);
		return;
	}
	msg_info("%s - %s", key, str);
}
void who_is_he_she ( void ) { STRING str , rawrec ; NODE indi ; INT len ; char nkey [ 100 ] ; char key [ 20 ] ; if ( ! ask_for_string ( _ ( " " ) , _ ( " " ) , key , sizeof ( key ) ) || ! key [ 0 ] ) return ; nkey [ 0 ] = ' ' ; if ( * key == ' ' ) strcpy ( nkey , key ) ; else strcpy ( & nkey [ 1 ] , key ) ; if ( ! ( rawrec = retrieve_raw_record ( nkey , & len ) ) ) { msg_error ( _ ( " " ) , key ) ; return ; } if ( ! ( indi = string_to_node ( rawrec ) ) ) { msg_error ( _ ( " " ) , key ) ; stdfree ( rawrec ) ; return ; } if ( ! ( str = indi_to_name ( indi , 60 ) ) || * str == 0 ) { msg_error ( _ ( " " ) , key ) ; stdfree ( rawrec ) ; return ; } msg_info ( " " , key , str ) ; }
who_is_he_she -- Find who person is from key value
who_is_he_she -- Find who person is from key value
/* LEAK -- where is stdfree(rawrec) -- Perry 2001/11/18 */