home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume26
/
maint
/
part01
/
help.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-13
|
7KB
|
326 lines
/******************************************************************************
*******************************************************************************
Site: Western Michigan University Academic Computer Center
System: Directory/File System Maintenance
Program: maint
Version=01 Level=00 01/24/92 Leonard J. Peirce
Purpose: On-line help for maint.
Arguments: See individual routine(s).
External variables: None
Maint external functions:
Defined: give_help
Called: info_mess, clear_mess
Files accessed: None
Return codes: See individual routine(s).
Compiling instructions: See Makefile
Linking instructions: See Makefile
Other information: (C) Copyright 1992, Leonard J. Peirce
********************************************************************************
*******************************************************************************/
/******************************************************************************/
/* */
/* # I N C L U D E F I L E S */
/* */
/******************************************************************************/
#ifdef ultrix
#include <cursesX.h>
#else
#include <curses.h>
#endif
#include "maint.h"
/******************************************************************************/
/* */
/* # D E F I N E S */
/* */
/******************************************************************************/
/******************************************************************************/
/* */
/* S T R U C T U R E S , U N I O N S , T Y P E D E F S */
/* */
/******************************************************************************/
/******************************************************************************/
/* */
/* E X T E R N A L D E F I N I T I O N S & D E C L A R A T I O N S */
/* */
/******************************************************************************/
extern void clear_mess();
void give_help();
/******************************************************************************/
/* */
/* S T A T I C D E F I N I T I O N S & D E C L A R A T I O N S */
/* */
/******************************************************************************/
/*******************************************************************************
********************************************************************************
Function: give_help
Purpose: Give the user some on-line help for a single key.
Global variables:
Name Examine/Modify/Use/Read/Write
---- -----------------------------
none
Return Codes:
Code Reason
---- ------
none
********************************************************************************
*******************************************************************************/
void give_help(window)
/******* FORMAL PARAMETERS *******/
WINDOW *window; /* where to read/write */
{ /*** give_help ***/
char buf[MAXNAMLEN + 100];
info_mess("Key you want help with [use `?' for detailed help] ? ");
switch(wgetch(window))
{
case(CONTROL_I):
case(' '):
case('>'):
case('L'):
case('l'):
case(KEY_RIGHT):
info_mess("Right -- Move right one column");
break;
case(BACKSPACE):
case('<'):
case('H'):
case(KEY_BACKSPACE):
case('h'):
case(KEY_LEFT):
info_mess("Left -- Move left one column");
break;
case(LINEFEED):
case('J'):
case('j'):
case(KEY_DOWN):
info_mess("Down -- Move down one row");
break;
case('^'):
case('K'):
case('k'):
case(KEY_UP):
info_mess("Up -- Move up one row");
break;
case(CARRIAGE_RETURN):
info_mess("Down and Left -- Move down one row, left of screen");
break;
case('='):
case('+'):
case(CONTROL_F):
case(KEY_NPAGE):
info_mess("Next Page -- Move forward one page");
break;
case('_'):
case('-'):
case(CONTROL_B):
case(KEY_PPAGE):
info_mess("Previous Page -- Move backward one page");
break;
case('/'):
info_mess("/Search -- Search for filename");
break;
case('U'):
case('u'):
info_mess("Unmark -- Cancel all marks for a file");
break;
case('S'):
case('s'):
info_mess("Select -- Select file (browse) or directory (change \
directory)");
break;
case('B'):
case('b'):
info_mess("Branch -- Branch to another directory");
break;
case('X'):
case('x'):
info_mess("Xecute -- Perform the commands in the current directory");
break;
case(CONTROL_R):
info_mess("Rebuild -- Rebuild directory information");
break;
case('D'):
case('d'):
info_mess("Delete -- Delete file/directory");
break;
case('P'):
case('p'):
info_mess("Protect -- Set protection (mode) for file");
break;
case('F'):
case('f'):
info_mess("Finish -- Finish directory, returning to previous \
directory");
break;
case('E'):
case('e'):
info_mess("Edit -- Call editor for file");
break;
case('I'):
case('i'):
info_mess("Info -- Give full information for file");
break;
case('R'):
case('r'):
info_mess("Rename -- Rename file to another file");
break;
case('C'):
case('c'):
info_mess("Copy -- Copy file to another file");
break;
case('T'):
case('t'):
info_mess("Text -- Enter text mode or add/edit text descriptor for \
file");
break;
case('Q'):
case('q'):
info_mess("Quit -- Leave maint and return to shell");
break;
case('!'):
info_mess("! -- Escape to shell");
break;
case(CONTROL_W):
case(CONTROL_L):
info_mess("Refresh -- Refresh screen");
break;
case(CONTROL_G):
info_mess("^Goto -- Goto specific page in directory");
break;
case('W'):
case('w'):
info_mess("Who -- Display name of author");
break;
case('V'):
case('v'):
info_mess("Version -- Display current version");
break;
case('O'):
case('o'):
info_mess("Owner -- Change owner of file/directory");
break;
case('G'):
case('g'):
info_mess("Group -- Change group of file/directory");
break;
case('.'):
info_mess("Repeat -- repeat last file command");
break;
case('?'):
if (!file_select(HELPFILE))
{
(void) sprintf(buf,"Error accessing help file `%s'",HELPFILE);
info_mess(buf);
}
/* fall through and clear the message */
case(ESCAPE):
default:
clear_mess(window);
break;
}
return;
} /*** give_help ***/