1
/* Copyright (C) 2000 Free Software Foundation, Inc.
2
Written by Eli Zaretskii (eliz@is.elta.co.il)
4
This file is part of groff.
6
groff is free software; you can redistribute it and/or modify it under
7
the terms of the GNU General Public License as published by the Free
8
Software Foundation; either version 2, or (at your option) any later
11
groff is distributed in the hope that it will be useful, but WITHOUT ANY
12
WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16
You should have received a copy of the GNU General Public License along
17
with groff; see the file COPYING. If not, write to the Free Software
18
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20
/* This header file compartmentalize all idiosyncrasies of non-Posix
21
systems, such as MS-DOS, MS-Windows, etc. */
27
# define setmode(f,m) _setmode(f,m)
30
#if defined(__MSDOS__) \
31
|| (defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN32__))
33
/* Binary I/O nuisances. Note: "setmode" is right for DJGPP and
34
Borland; Windows compilers might need _setmode or some such. */
40
# define SET_BINARY(f) do {if (!isatty(f)) setmode(f,O_BINARY);} while(0)
41
# define FOPEN_RB "rb"
42
# define FOPEN_WB "wb"
43
# define FOPEN_RWB "wb+"
45
# define POPEN_RT "rt"
46
# define POPEN_WT "wt"
47
# define popen(c,m) _popen(c,m)
48
# define pclose(p) _pclose(p)
53
# define O_BINARY (_O_BINARY)
57
/* The system shell. Groff assumes a Unixy shell, but non-Posix
58
systems don't have standard places where it lives, and might not
59
have it installed to begin with. We want to give them some leeway. */
60
# define BSHELL (system_shell_name())
61
# define BSHELL_DASH_C (system_shell_dash_c())
62
# define IS_BSHELL(s) (is_system_shell(s))
64
/* The separator for directories in PATH and other environment
68
/* Characters that separate directories in a path name. */
69
# define DIR_SEPS "/\\:"
71
/* How to tell if the argument is an absolute file name. */
72
# define IS_ABSOLUTE(f) \
73
((f)[0] == '/' || (f)[0] == '\\' || (f)[0] && (f)[1] == ':')
75
/* The executable extension. */
76
# define EXE_EXT ".exe"
78
/* The system null device. */
79
# define NULL_DEV "NUL"
85
const char * system_shell_name(void);
86
const char * system_shell_dash_c(void);
87
int is_system_shell(const char *);
94
/* Defaults, for Posix systems. */
100
# define FOPEN_WB "w"
103
# define FOPEN_RWB "w+"
106
# define POPEN_RT "r"
109
# define POPEN_WT "w"
115
# define BSHELL "/bin/sh"
117
#ifndef BSHELL_DASH_C
118
# define BSHELL_DASH_C "-c"
121
# define IS_BSHELL(s) ((s) && strcmp(s,BSHELL) == 0)
124
# define PATH_SEP ":"
127
# define DIR_SEPS "/"
130
# define IS_ABSOLUTE(f) ((f)[0] == '/')
136
# define NULL_DEV "/dev/null"