/* Created with PageBuilder version 4.01 on Fri Sep 21 14:16:06 2001 */

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "AsExtern.h"



/* *************************************** */
/* *    Built from "html\netarm1.htm"    * */
/* *************************************** */



/* *************************************** */
/* *    Built from "html\netarm2.htm"    * */
/* *************************************** */


char chDataValue[32] = "This is a string of data.";
char *getData(void) 
{
	return &chDataValue[0];
}

void setData(char *theValuePtr) 
{
    strcpy (chDataValue, theValuePtr);
}


char chSecretData[16];
char *getPassword(void) 
{
	return "";
}

void setPassword(void *theTaskDataPtr, char *theValuePtr, char *theNamePtr, Signed16Ptr theIndexValuesPtr) 
{
    strcpy (chSecretData, theValuePtr);
}



char *cSelections[] = { "Selection0",
                        "Selection1",
                        "Selection2",
                        "Selection3",
                        "Selection4",
                        "Selection5",
                        "Selection6",
                        "Selection7",
                        "Selection8",
                        ""   };

Boolean bSelections[] = {   0,
                            1,
                            0,
                            0,
                            1,
                            0,
                            1,
                            0,
                            0
                               };


void *getSelection(Unsigned8 theItemNumber, Boolean *theOptionSelectedFlag, Unsigned32Ptr theValuePtr) 
{

    if (strlen(cSelections[theItemNumber]) == 0) 
    {
        return (void *) 0;
    }
    else {
        *theOptionSelectedFlag = bSelections[theItemNumber];
        *theValuePtr = theItemNumber;
        return (void *) cSelections[theItemNumber];
    }
}

void setSelection(Unsigned32 theValue) 
{
	bSelections[theValue] = 1;
}

void rstSelection(void *theTaskDataPtr) 
{

	bSelections[0] = 0;
	bSelections[1] = 0;
	bSelections[2] = 0;
	bSelections[3] = 0;
	bSelections[4] = 0;
	bSelections[5] = 0;
	bSelections[6] = 0;
	bSelections[7] = 0;
	bSelections[8] = 0;
}


Boolean  bCheckboxData = 0;
Boolean getCheckbox(void) 
{
	return bCheckboxData;
}

void setCheckbox(Boolean theValue) 
{

	bCheckboxData = theValue;
}

Boolean ulCheckBox;

Unsigned32 u32Choice = 5;
char *cChoices[] = {    "Choice0",
                        "Choice1",
                        "Choice2",
                        "Choice3",
                        "Choice4",
                        "Choice5",
                        "Choice6",
                        "Choice7",
                        ""   };

void *getChoice(Unsigned8 theItemNumber, Boolean *theOptionSelectedFlag, Unsigned32Ptr theValuePtr) 
{

    if (strlen(cChoices[theItemNumber]) == 0) 
    {
        return (void *) 0;
    }
    else 
    {
    	if (theItemNumber == u32Choice) 
        {
            *theOptionSelectedFlag = 1;
        }
        else
        {
            *theOptionSelectedFlag = 0;
        }

        *theValuePtr = theItemNumber;
        return (void *) cChoices[theItemNumber];
    }
}

void setChoice(Unsigned32 theValue) 
{
	u32Choice = theValue;
}


char bigInfoBlock[204] = "This is a block of information that will get \nstuffed into a big block on your Web Page";
char *getInfoBlock(void) 
{
	return &bigInfoBlock[0];
}

void setInfoBlock(char *theValue) 
{
    int BufferSize = 0;
    /* protect against block of data large than bigInfoBlock */
    BufferSize = sizeof(bigInfoBlock);
    if (strlen(theValue) > BufferSize)
    {
	strncpy(bigInfoBlock, theValue, BufferSize);
	/* ensure we have a terminating null character */
	bigInfoBlock[BufferSize - 1] = '\0';
    }
    else
    {
    strcpy (bigInfoBlock, theValue);
    }
}

void initFormPage(void *theTaskDataPtr, Signed16Ptr theIndexValuesPtr) 
{
    /*  This function is called prior to the Form being servered    */
}

void initPage(void *theTaskDataPtr, Signed16Ptr theIndexValuesPtr) 
{
    /*  This function is called prior to the page being servered    */
	return;
}





/* ****************************************** */
/* *    Built from "html\logo.gif"    * */
/* ****************************************** */



/* ***************************************** */
/* *    Built from "html\formreply.htm"    * */
/* ***************************************** */

char *GetInfo(void)
{
	return chSecretData;
}


