/* Copyright 1996 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/************************************************************************/
/* � Acorn Computers Ltd, 1992.                                         */
/*                                                                      */
/* This file forms part of an unsupported source release of RISC_OSLib. */
/*                                                                      */
/* It may be freely used to create executable images for saleable       */
/* products but cannot be sold in source form or as an object library   */
/* without the prior written consent of Acorn Computers Ltd.            */
/*                                                                      */
/* If this file is re-distributed (even if modified) it should retain   */
/* this copyright notice.                                               */
/*                                                                      */
/************************************************************************/

/* Title: c.dboxfile
 * Purpose: display a file dbox and get input
 * History: IDJ: 05-Feb-92: prepared for source release
 *
 */

#define BOOL int
#define TRUE 1
#define FALSE 0

#include <stdio.h>
#include "dbox.h"
#include "dboxfile.h"
#include "trace.h"



/* fields for the DBox. */


#define dboxfile_FOK    0       /* OK action button. */
#define dboxfile_FMsg   1       /* message from sponsor */
#define dboxfile_FInput 2       /* input field. */



void dboxfile(char *message, unsigned filetype, char *a, int bufsize)
{
   dbox d = dbox_new("dboxfile_db");

   filetype = filetype ; /* supress compiler warning */
   if (d == 0) return;
   dbox_setfield(d, dboxfile_FMsg, message);
   dbox_setfield(d, dboxfile_FInput, a);
   dbox_show(d);
   if (dbox_fillin(d) == dboxfile_FOK)
     dbox_getfield(d, dboxfile_FInput, a, bufsize);
   else
     a[0] = 0;

   dbox_dispose(&d);
}

/* end */