File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / others / quipu / uips / sd / help.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

/* help.c - Display of assorted help texts */

#ifndef lint
static char *rcsid = "$Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/others/quipu/uips/sd/help.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $";
#endif

/*
 * $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/others/quipu/uips/sd/help.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $
 */

/*
 * $Log: help.c,v $
 * Revision 1.1.1.1  2018/04/24 16:12:56  root
 * BSD 4.3reno
 *
 * Revision 7.0  90/06/12  13:14:05  mrose
 * *** empty log message ***
 * 
 * Revision 1.6  90/04/26  10:36:36  emsrdsm
 * *** empty log message ***
 * 
 * Revision 1.5  90/04/25  15:07:48  emsrdsm
 * i) lint'ed
 * 
 * Revision 1.4  90/04/20  17:57:51  emsrdsm
 * i) no more freeing
 * 
 * Revision 1.3  90/04/18  18:27:48  emsrdsm
 * fixed i) does not move to leaves
 *       ii) added default mechanism described using "typeDefaults" file.
 * 	 iii) added 'sorting' to attribute display
 * 
 * Revision 1.2  90/03/15  16:31:56  emsrdsm
 * fixes i) Prints messages correctly on exit.
 *      ii) Added rfc822 to greybook mailbox conversion
 *     iii) Removed bug that caused crash if 'local_dit' undefined
 * 
 * Revision 1.1  90/03/09  17:40:26  emsrdsm
 * Initial revision
 * 
 * Revision 1.1  90/03/09  13:36:33  emsrdsm
 * Initial revision
 * 
 */

#include "sequence.h"
#include <stdio.h>
#include "quipu/util.h"
#include "tailor.h"

#define BUFLEN 1024
#define TEXT 1

#ifdef lint
#define ETCDIR "/etc"
#endif 

#define  HELPDIR "sd/helpdir/"

extern D_seq textseq;
extern D_seq dnseq;
extern int text_state;
extern int current_entry, entry_number, display_entry;

help_cncs()
{
  get_help("help", "   Press <KEY> to get detailed help.\n");
}

help_init()
{
  get_help("help", "   SD X.500 Directory Agent - Concise Help\n");
}

help_up()
{
  get_help("widen", "   The \"Widen Area\" Function.\n");
}

help_back()
{
  get_help("look", "   The \"Look Back\" Function.\n");
}

help_number()
{
  get_help("number", "   The \"Go To Number\" Function.\n");
}

help_srch()
{
    get_help("search", "   The \"Search\" Function");
}

help_list()
{
  get_help("list", "   The \"List\" Function");
}

get_help(filename, line)
char *filename, *line;
{
  FILE * helpfp;
  char helpbuf[BUFLEN];
  char filebuf[BUFLEN];
  char *str;

  text_state = TEXT;
  entry_number = 0;
  display_entry = current_entry = 1;
  free_seq(dnseq);
  free_seq(textseq);
  dnseq = 0;
  textseq = 0;
  
  (void) strcpy(filebuf, HELPDIR);
  (void) strcat(filebuf, filename);
  (void) strcpy(helpbuf, isodefile(filebuf, 0));
  
  if ((helpfp = fopen(helpbuf, "r")) == (FILE *)NULL ) {
    tprint("Can't open help file '%s'.\n",helpbuf);
    return;
  }
  
  if (line) {
    add_seq(&textseq, line);
    entry_number++;
  }

  while(fgets(filebuf, BUFLEN, helpfp) != (char *) NULL) {
    str = filebuf;
    while(*str != '\n' && *str != '\0') str++;
    *str = '\0';
    add_seq(&textseq, filebuf);
    entry_number++;
  }

  (void) fclose(helpfp);
  scrollbar('\0');
}
	 
            

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.