175584Sru// -*- C++ -*-
2151497Sru/* Copyright (C) 1992, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
375584Sru     Written by James Clark (jjc@jclark.com)
475584Sru
575584SruThis file is part of groff.
675584Sru
775584Srugroff is free software; you can redistribute it and/or modify it under
875584Sruthe terms of the GNU General Public License as published by the Free
975584SruSoftware Foundation; either version 2, or (at your option) any later
1075584Sruversion.
1175584Sru
1275584Srugroff is distributed in the hope that it will be useful, but WITHOUT ANY
1375584SruWARRANTY; without even the implied warranty of MERCHANTABILITY or
1475584SruFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1575584Srufor more details.
1675584Sru
1775584SruYou should have received a copy of the GNU General Public License along
1875584Sruwith groff; see the file COPYING.  If not, write to the Free Software
19151497SruFoundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
2075584Sru
2175584Sru#include <sys/types.h>
2275584Sru#include <sys/stat.h>
2375584Sru
2475584Sru#ifdef HAVE_CC_OSFCN_H
2575584Sru#include <osfcn.h>
2675584Sru#else
2775584Sru#include <fcntl.h>
2875584Sru#ifdef HAVE_UNISTD_H
2975584Sru#include <unistd.h>
3075584Sru#endif
3175584Sru#endif
3275584Sru
3375584Sru#ifndef S_IRUSR
3475584Sru#define S_IRUSR 0400
3575584Sru#endif
3675584Sru
3775584Sru#ifndef S_IRGRP
3875584Sru#define S_IRGRP 0040
3975584Sru#endif
4075584Sru
4175584Sru#ifndef S_IROTH
4275584Sru#define S_IROTH 0004
4375584Sru#endif
4475584Sru
45104862Sru#ifndef S_IWUSR
46104862Sru#define S_IWUSR 0200
47104862Sru#endif
48104862Sru
49104862Sru#ifndef S_IXUSR
50104862Sru#define S_IXUSR 0100
51104862Sru#endif
52104862Sru
5375584Sru#ifndef S_ISREG
5475584Sru#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
5575584Sru#endif
5675584Sru
5775584Sru#ifndef O_RDONLY
5875584Sru#define O_RDONLY 0
5975584Sru#endif
60104862Sru
61151497Sru#ifndef F_OK
62151497Sru#define F_OK 0
63151497Sru#endif
64151497Sru
65104862Sru#ifndef HAVE_ISATTY
66104862Sru#define isatty(n) (1)
67104862Sru#endif
68