/*
 *	  -------------------------------------------------------
 *        Neither  York  University,   Department  of   Computer
 *        Science   nor   the  authors assume any responsibility
 *        for the use or reliability of this software.
 *
 *        Copyright (C) 1986, York University
 *                            Department of Computer Science
 *
 *        General permission to copy  or  modify,  but  not  for
 *        profit,  is  hereby granted, provided  that  the above
 *        copyright notice is included  and  reference  made  to
 *        the fact that reproduction  privileges  were   granted
 *        by the York University, Department of Computer Science.
 *	  -------------------------------------------------------
 *
 *	  Written by: Edward Fung and James P. Lewis
 *		      Department of Computer Science
 *		      York University
 *		      1984, 1985, 1986
 *
 */

/*
 * Facility:  Bulletin
 *
 * Environment:  User mode, non-privileged code.
 *
 * Modified by:
 *
 * 1-000 - EF   ??-???-1984
 * 2-000 - JPL  ??-???-1984
 * 3-000 - JPL  01-JAN-1986
 * 4-000 - JPL  10-JUL-1986
 *
 */

#module bullmaint

#include        ssdef.h 
#include        "bull.h"

main()
{
        char    helplib[QUAL_LEN];
        long    status,
		video_type;
        struct  bull_lst_struct	*bull_lst;

        get_term(&video_type, &status);	/* Video terminal ? */

        if (get_val(HELP_QUAL, 0, 0) & SS$_NORMAL) {	/* /HELP */
                if (trn_lnm("LNM$SYSTEM_TABLE", 0, "MAINT_HELPLIB", 0, 
		    helplib, QUAL_LEN) == SS$_NORMAL) 
                        help(helplib, MAINT_HELPSTR);
                else	help(MAINT_HELPLIB, MAINT_HELPSTR); 
        }
        else {
		bull_lst = (struct bull_lst_struct *)
			   malloc(sizeof(struct bull_lst_struct));
		get_bull(bull_lst, FALSE);

                if (get_val(ADD_QUAL, 0, 0) & SS$_NORMAL)	/* /ADD */
                        add_bull(bull_lst);
                else 
		if (get_val(DEL_QUAL, 0, 0) & SS$_NORMAL)	/* /DELETE */
                        del_bull(bull_lst, video_type, status);
                else 
		if (get_val(EDT_QUAL, 0, 0) & SS$_NORMAL)	/* /EDIT */
                        edit_bull(bull_lst, video_type, status);
                else 
		if (get_val(EXP_QUAL, 0, 0) & SS$_NORMAL)	/* /EXPIRE */
                        exp_bull(bull_lst);
                else    add_bull(bull_lst); 
        }
}
