/*  usrprompt.c   */
/*  Copyright 1989 Mountain Math Software  */
/*  All Rights Reserved                    */
#include <errno.h>
#include <stream.h>
#include <fcntl.h>
#include <unistd.h>
// #include "winmgr.h"
#include "sysintfc.h"
#include "cgidbg.h"
#include "usrprompt.h"


PromptStatus PrepareToWriteFile(const char * FileName,
	SuspendedRead TheCallBack, void * Object, const char * AbortMessage)
{
}

UserPrompt::UserPrompt(const char * prompt, SuspendedRead client,
	void * object, int change_active, int delete_prompt,
	InputType type, const char * def):
	the_default_string(def)
{
	Prompt = prompt ;
	Client = client ;
	Object = object ;
	ChangeActive = change_active ;
	DeletePrompt = delete_prompt ;
	Type = type ;
}

UserPrompt::UserPrompt(InputType type, const char * prompt,
		SuspendedRead client, void * object, int change_active,
		int delete_prompt, const char *def):
		the_default_string(def)
{
	Prompt = prompt ;
	Client = client ;
	Object = object ;
	ChangeActive = change_active ;
	DeletePrompt = delete_prompt ;
	Type = type ;
}


UserPrompt::~UserPrompt()
{
	if (DeletePrompt) delete[] (void *) Prompt ;
}

void UserPrompt::NewPrompt(const char * prompt, int NewDeletePrompt)
{
	if (DeletePrompt) delete[] (void *) Prompt ;
	Prompt  = prompt ;
	DeletePrompt = NewDeletePrompt ;
}

void UserPrompt::capture_read()
{
	Client = CaptureRead::capture(Client);
}

int UserPrompt::IsPromptString()
{
	if (Prompt) if (*Prompt) return 1 ;
	return 0;
}

