/*---------------------------------------------------------------------------*/
/* */
/* Copyright 1992-1998 Silicon Graphics, Inc. */
/* All Rights Reserved. */
/* */
/* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics Inc.; */
/* contents of this file may not be disclosed to third parties, copied or */
/* duplicated in any form, in whole or in part, without the prior written */
/* permission of Silicon Graphics, Inc. */
/* */
/* RESTRICTED RIGHTS LEGEND: */
/* Use,duplication or disclosure by the Government is subject to restrictions*/
/* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data */
/* and Computer Software clause at DFARS 252.227-7013, and/or in similar or */
/* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - */
/* rights reserved under the Copyright Laws of the United States. */
/* */
/*---------------------------------------------------------------------------*/
#ident "$Revision: 1.5 $"
#include "subsrg.h"
/*---------------------------------------------------------------------------*/
/* Function Prototypes */
/*---------------------------------------------------------------------------*/
void SUBSRGDisplayHeader(int, int, char *, char *, char *);
void SUBSRGDisplayFooter(int, int);
void SUBSRGDisplayConfirmation(char *, int, class_data_t *);
void SUBSRGDisplayError(int, int, __uint32_t, char *, ...);
void SUBSRGPrintOptionString(char *, int);
int MyStrTokR(char *, char *, char **);
int SUBSRGPrintSelectBox(char *, char *, char *, int, int);
void SUBSRGErr(__uint32_t);
/*---------------------------------------------------------------------------*/
/* SUBSRGDisplayHeader */
/* Displays HTML Header information */
/*---------------------------------------------------------------------------*/
void SUBSRGDisplayHeader(int displayhelp,
int displayscript,
char *formname,
char *varname,
char *action)
{
Body("\n");
Body("
\n");
Body("\n");
Body("System Support Software - Ver 1.0\n");
Body("\n");
if ( displayhelp || (displayscript && formname && varname) ) {
Body(" \n");
}
Body("\n");
Body("\n");
if ( displayhelp || (displayscript && formname && varname) ) {
Body("\n");
}
Body("\n");
Body("\n");
return;
}
/*---------------------------------------------------------------------------*/
/* SUBSRGDisplayConfirmation */
/* Displays confirmation of operation performed */
/*---------------------------------------------------------------------------*/
void SUBSRGDisplayConfirmation(char *host, int proc, class_data_t *myclass)
{
class_data_t *tmpclass = myclass;
type_data_t *tmptype;
SUBSRGDisplayHeader(0, 0, NULL, NULL, NULL);
RowBegin("");
CellBegin("");
CellEnd();
CellBegin("");
Body("The following events from \n");
FormatedBody("host %s have been %s for class %s ",host,(proc==SUBSCRIBEPROC?"subscribed":"unsubscribed"),tmpclass->class_desc);
Body("
\n");
CellEnd();
RowEnd();
SUBSRGDisplayFooter(0, 0);
return;
}
/*---------------------------------------------------------------------------*/
/* SUBSRGDisplayError */
/* Displays an error message. If an error is passed, then it decodes */
/* the error message and prints it. */
/*---------------------------------------------------------------------------*/
void SUBSRGDisplayError(int proc, int func, __uint32_t err, char *format, ...)
{
va_list args;
char errStr[1024];
int nobytes = 0;
if ( format != NULL ) {
va_start(args, format);
nobytes = vsnprintf(errStr, sizeof(errStr), format, args);
}
SUBSRGDisplayHeader(0, 0, NULL, NULL, NULL);
RowBegin("");
CellBegin("");
CellEnd();
CellBegin("");
Body("\n");
Body("The following error happened in \n");
FormatedBody(" %s",(proc==SUBSCRIBEPROC?"Subscription":"UnSubscription"));
Body(" while\n");
switch(func)
{
case GETCLASSDATA:
Body("retrieving Class Information : \n");
break;
case GETTYPEDATA:
Body("retrieving Event Information :\n");
break;
case PROCESSDATA:
Body("processing Event Information :\n");
break;
}
Body(" \n");
Body("
\n");
if ( err ) {
Body("
\n");
FormatedBody("Error Number : %d",err);
Body("
\n");
SUBSRGErr(err);
}
if (nobytes) {
Body("
\n");
FormatedBody("%s",errStr);
}
Body("
\n");
Body("\n");
CellEnd();
RowEnd();
SUBSRGDisplayFooter(0, 0);
return;
}
/*---------------------------------------------------------------------------*/
/* SUBSRGPrintOptionString */
/* Takes a string and converts all special characters to their relevent */
/* tags and prints an