/*			USERS			module 4
						contents = Delete
    "us5.c"
*/
/*=============================================================================
			INCLUDES
*/
/*
#define		debug5		0
*/

#include	"users.os"
#include	"standard.inc"

#define		EXTERNal	0

#include	"users.dat"

/*=============================================================================
			HISTORY
date		4 February 1984
person		tpl

ver	0
rev	0
mod	b
patch	2

 ver/rev
""""""""
  0/0

     mod patch
    """""""""""
	b1		3 February 1984		tpl
		.Try to squeeze out some bytes.

	a0		30 January 1984		tpl
		.RELEASED TO SOFTWARE TEST.

	a0		22 December 1983	tpl
		.Begin this module from 'us4a.c'.

*/
/*page*/
/*=============================================================================
			ROUTINES
*/
/*---------------------------------------------------------------------------*/

Delete()
{
    register CHAR i;

    putz("\n\nDelete an entry in the Users Table.\n");
    if ( (i = Get_Entry()) == NuserTblEntries )
	return;

    putz("\n\n    Delete this entry\n\n");
    if( !Ask_if_entry_OK( &users_table[i], &config_table[i] ) )
	return;	/* Return if not ok.	*/

/* Else do the delete.	*/

    clear( &users_table[i], sizeof( struct users_entry ), 0);
    clear( &config_table[i], sizeof( struct config_entry ), 0);

    for ( ; i<NuserTblEntries-1
		&& users_table[i+1].name[0] != 0
		&& users_table[i+1].name[0] != 0xE5; ++i)
    {
	blockmv( &users_table[i], &users_table[i+1],
					sizeof( struct users_entry ) );
	blockmv( &config_table[i], &config_table[i+1],
					sizeof( struct config_entry ) );
	Reset_Entry (&users_table [i+1], &config_table [i+1]);
    }

    changes_made = TRUE;	/* Mark global flag that a change was made. */

} /* Delete */

/*---------------------------------------------------------------------------*/

/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

