/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "Licence").
 * You may not use this file except in compliance with the Licence.
 *
 * You can obtain a copy of the licence at RISC OS path @.^.LICENCE
 * or  http://www.riscosdev.com/lanman98/LICENCE.CDDL
 * See the Licence for the specific language governing permissions
 * and limitations under the Licence.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the Licence file. If applicable, add the
 * following below this CDDL HEADER, with the fields enclosed by
 * brackets "[]" replaced with your own identifying information:
 * Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
 
/*
 *   Portions Copyright 1996 Warm Silence Software Ltd.
 */

/******************************************************/
/*                                                    */
/* Name: PGfs.h                                       */
/* Author: Paul Gardiner.                             */
/* Function:                                          */
/*   Provides a library of file access functions for  */
/* use with either of the two modules, PGscn or       */
/* PGwin. They CAN be used in isolation.              */
/*                                                    */
/******************************************************/

#ifndef _PGfs_
#define _PGfs_

typedef int fs_handle;
typedef int fs_pointer;

void FsDelete(char *);
/*
 * Delete a named file.
 */

int FsType(char *);
/*
 * Return the type of a named file.
 */

void FsSetType(char *, int);
/*
 * Set the type of a named file.
 */

int  FsSize(char *);
/*
 * Return the size of a named file.
 * Returns -1 if the file does not exist.
 */

fs_handle FsOpen(char *);
/*
 * Open a named file.
 */

void FsClose(fs_handle);
/*
 * Close an open file.
 */

void FsRead(fs_handle, void *, int);
/*
 * Fills a buffer from an open file.
 */

void FsReadAt(fs_handle, fs_pointer, void *, int);
/*
 * Fills a buffer from an open file.
 */

char *FsName(fs_handle);
/*
 * Returns the full name of an open file.
 */

char *FsEnumerateDir(char *);
/*
   Enumerates a directory.  Present the path on the first call, and NULL
   on subsequent ones.  NULL is returned when finished.
*/

#endif /* _PGfs */
