/* $Id: h,v.riscos 3.2 1998/08/01 01:23:53 stoklund Exp stoklund $ */
/* riscos.h: Special functions for RISC OS support

   Copyright (C) 1998 Jakob Stoklund Olesen

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */

#ifndef KPATHSEA_RISCOS_H
#define KPATHSEA_RISCOS_H

/*
   Our concept of the currently set directory. We need this to handle DDEUtils'
   Prefix$Dir and a possibly changing directory under the desktop.
 */
extern const_string riscos_prefix;
extern int riscos_prefix_length;
/*
   Put riscos_prefix in front of NAME if necessary,
   and return it in fresh memory.
 */
string riscos_ensure_prefix (const_string name);

/*
   Setup riscos_prefix, either from <Prefix$Dir / @ or from FILE.

   If riscos_desktop_flag is set and FILE is non-null, the dir part of
   FILE is used and riscos_desktop_flag is reset.
 */
void riscos_initialise_prefix (const_string file);
extern boolean riscos_desktop_flag;

/*
   We have two ways of creating output files with extensions:
   dot-mode: file is put in a directory.
   slash-mode: extension separator is '/'.
   The mode is determined by the filename conventions used by the
   first input file read.

   The program should call riscos_set_output_mode with a filename that
   uses the desired convention.
 */
extern enum riscos_output_mode_enum
  {
    output_mode_unset,		/* defaults to '/' */
    output_mode_dot,		/* use '.' filenames */
    output_mode_slash		/* use '/' names */
  }
riscos_output_mode;

void riscos_set_output_mode (const_string);

/* Return the canonicalised version of PATH_NAME in fresh memory.
   PATH may be a comma-separated list of directories to search or NULL. */
string riscos_canonicalise (const_string /* path_name */ ,
			    const_string /* path */ );

/* Do filename translation and return name in fresh memory or NULL. */
string riscos_translate_input (const_string /* filename */ );
string riscos_translate_output (const_string /* filename */ );

/*
   Return true if FILE exists and has read access.
   NO filename translation is done.
 */
boolean riscos_read_access (const_string);

#endif /* not KPATHSEA_RISCOS_H */
