home *** CD-ROM | disk | FTP | other *** search
- /*
- oakdir.h
-
- % oakland standard file and directory MACROS (MS-DOS, UNIX, VMS, ...)
-
- OWL 1.2
- Copyright (c) 1990, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 10/02/90 mla/pmcm changed default OFILE_WILCARD from "*.*" to ""
- 10/02/90 mla/pmcm added default OFILE_CURRDIR ""
- 10/10/90 jmd added APOLLO defines
- 10/16/90 jmd finished APOLLO defines
- 10/18/90 jmd moved O_DIRECT stuff to oakland.h
- 10/22/90 mla added default OFILE_PARENTDIR ""
- 10/24/90 mla added odir_IsFullSpec
- 12/05/90 ted made DOS & OS2 ifdef's mutually exclusive.
- 12/05/90 jsm added QNX defines
- 12/06/90 ted added missing dummies to default-macro section.
- */
-
- /* include header for specific OS */
-
- #ifdef OAK_QNX
- # ifdef OAK_DOS
- # undef OAK_DOS
- # endif
- # include "qnxdir.h"
- # define _OAKDIR_
- #endif
-
- #ifdef OAK_DOS /* MS-DOS Dependent Code */
- # include "pcdir.h"
- # define _OAKDIR_
- #else
- # ifdef OAK_OS2 /* OS/2 Dependent Code */
- # include "os2dir.h"
- # define _OAKDIR_
- # endif
- #endif
-
- #ifdef OAK_UNIX /* Unix Dependent Code */
- # include "unixdir.h"
- # define _OAKDIR_
- #endif
-
- #ifdef OAK_APOLLO /* Apollo Dependent Code */
- # include "unixdir.h"
- # define _OAKDIR_
- #endif
-
- #ifdef OAK_VMS /* VMS Dependent Code */
- # include "vmsdir.h"
- # define _OAKDIR_
- #endif
-
- /* if no directory code is provided use default macros to allow compilation */
- #ifndef _OAKDIR_
-
- # define OFILE_NAMELEN 22
- # define OFILE_PATHLEN 128
- # define OFILE_ENVSEP ';'
- # define OFILE_WILDCARD "*"
- # define OFILE_CURRDIR "."
- # define OFILE_PARENTDIR ".."
-
- # define odir_Open(fname_spec,file_type) NULL
- # define odir_Read(odirpa,file_info) FALSE
- # define odir_Close(odirp)
- # define ofile_Remove(fname_spec) FALSE
-
- # define odir_Ascend(newpath,maxnewpath,oldpath) FALSE
- # define odir_Descend(newpath,maxnewpath,oldpath,subdir) FALSE
- # define odir_Split(spec,path,maxpath,name,maxname) FALSE
- # define odir_Join(spec,maxspec,path,name) FALSE
- # define odir_StripCase(str) (str)
- # define odir_GetCurrDir(buf,len) FALSE
- # define odir_IsFullSpec(spec) FALSE
-
- # define ofile_IsValid(name,wildok) FALSE
- # define odir_IsValid(dir) FALSE
- # define odir_MakePath(strbuf,buflen,dir) FALSE
- #endif
- /* -------------------------------------------------------------------------- */
-
- /* system independent file description info here */
- typedef struct _ofile {
- byte type;
- struct tm time;
- unsigned long size;
- char spec[OFILE_PATHLEN + OFILE_NAMELEN + 1]; /* system specific */
- } ofile_struct;
-
- /* file info macros */
- #define ofile_GetType(ofile) ((ofile).type)
- #define ofile_GetTime(ofile) ((ofile).time)
- #define ofile_GetSize(ofile) ((ofile).size)
- #define ofile_GetSpec(ofile) ((ofile).spec)
-
- /* masks for odir_Open */
- #define OFILE_ALL 0x01
- #define OFILE_FILES 0x02
- #define OFILE_DIRS 0x04
-
- typedef VOID *odir_type;
-
- /* Oakland directory handling functions */
- #define odir_Open_func(fname) odir_type fname(char *_fname_spec, byte _file_type)
- #define odir_Read_func(fname) boolean fname(odir_type _odirpa, ofile_struct *_file_info)
- #define odir_Close_func(fname) void fname(odir_type _odirp)
- #define ofile_Remove_func(fname) boolean fname(char *_fname_spec)
-
- /* Path name operator functions */
- #define odir_Ascend_func(fname) boolean fname(char *_newpath, int _maxnewpath, char *_oldpath)
- #define odir_Descend_func(fname) boolean fname(char *_newpath, int _maxnewpath, char *_oldpath, char *_subdir)
- #define odir_Split_func(fname) boolean fname(char *_spec, char *_path, int _maxpath, char *_name, int _maxname)
- #define odir_Join_func(fname) boolean fname(char *_spec, int _maxspec, char *_path, char *_name)
- #define odir_StripCase_func(fname) char *fname(char *_str)
- #define odir_GetCurrDir_func(fname) boolean fname(char *_buf, int _len)
- #define odir_IsFullSpec_func(fname) boolean fname(char *_spec)
-
- #define ofile_IsValid_func(fname) boolean fname(char *_name, boolean _wildok)
- #define odir_IsValid_func(fname) boolean fname(char *_dir)
- #define odir_MakePath_func(fname) boolean fname(char *_strbuf, int _buflen, char *_dir)
- /* -------------------------------------------------------------------------- */
-
- /* include header for specific OS */
- #ifdef OAK_DOS /* MS-DOS Dependent Code */
- # include "pcdir.h"
- #else
- # ifdef OAK_OS2 /* OS/2 Dependent Code */
- # include "os2dir.h"
- # endif
- #endif
-
- #ifdef OAK_UNIX /* Unix Dependent Code */
- # include "unixdir.h"
- #endif
-
- #ifdef OAK_APOLLO /* Apollo Dependent Code */
- # include "unixdir.h"
- #endif
-
- #ifdef OAK_VMS /* VMS Dependent Code */
- # include "vmsdir.h"
- #endif
-
- #ifdef OAK_QNX /* QNX Dependent Code */
- # include "qnxdir.h"
- #endif
-
- /* -------------------------------------------------------------------------- */
-
-