"Fossies" - the Fresh Open Source Software Archive

Member "gawk-5.1.0/nonposix.h" (6 Feb 2020, 2997 Bytes) of package /linux/misc/gawk-5.1.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "nonposix.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 5.0.1_vs_5.1.0.

    1 /*
    2  * nonposix.h --- definitions needed on non-POSIX systems.
    3  */
    4 
    5 /*
    6  * Copyright (C) 2012, 2013, 2016, 2017, 2018, 2019
    7  * the Free Software Foundation, Inc.
    8  *
    9  * This file is part of GAWK, the GNU implementation of the
   10  * AWK Programming Language.
   11  *
   12  * GAWK is free software; you can redistribute it and/or modify
   13  * it under the terms of the GNU General Public License as published by
   14  * the Free Software Foundation; either version 3 of the License, or
   15  * (at your option) any later version.
   16  *
   17  * GAWK is distributed in the hope that it will be useful,
   18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   20  * GNU General Public License for more details.
   21  *
   22  * You should have received a copy of the GNU General Public License
   23  * along with this program; if not, write to the Free Software
   24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
   25  */
   26 
   27 /*
   28  * This is for fake directory file descriptors on systems that don't
   29  * allow to open() a directory.
   30  */
   31 
   32 #define FAKE_FD_VALUE 42
   33 
   34 #ifdef __MINGW32__
   35 /* Replacements for sys/wait.h macros.  */
   36 # define WEXITSTATUS(stv) (((unsigned)(stv)) & ~0xC0000000)
   37 /* MS-Windows programs that crash due to a fatal exception exit with
   38    an exit code whose 2 MSB bits are set.  */
   39 # define WIFEXITED(stv)   ((((unsigned)(stv)) & 0xC0000000) == 0)
   40 # define WIFSIGNALED(stv) ((((unsigned)(stv)) & 0xC0000000) == 0xC0000000)
   41 # define WTERMSIG(stv)    w32_status_to_termsig ((unsigned)stv)
   42 # define WIFSTOPPED(stv)  (0)
   43 # define WSTOPSIG(stv)    (0)
   44 
   45 int w32_status_to_termsig (unsigned);
   46 
   47 /* Prototypes of for Posix functions for which we define replacements
   48    in pc/ files.  */
   49 
   50 /* getid.c */
   51 unsigned int getuid (void);
   52 unsigned int geteuid (void);
   53 unsigned int getgid (void);
   54 unsigned int getegid (void);
   55 
   56 /* gawkmisc.pc */
   57 int unsetenv (const char *);
   58 int setenv (const char *, const char *, int);
   59 void w32_maybe_set_errno (void);
   60 char *w32_setlocale (int, const char *);
   61 /* libintl.h from GNU gettext defines setlocale to redirect that to
   62    its own function.  Note: this will have to be revisited if MinGW
   63    Gawk will support ENABLE_NLS at some point.  */
   64 #ifdef setlocale
   65 # undef setlocale
   66 #endif
   67 #define setlocale(c,v) w32_setlocale(c,v)
   68 
   69 #endif  /* __MINGW32__ */
   70 
   71 #if defined(VMS) || defined(__DJGPP__) || defined(__MINGW32__)
   72 int getpgrp(void);
   73 #endif
   74 
   75 #if defined(__DJGPP__) || defined(__MINGW32__)
   76 int getppid(void);
   77 #endif
   78 
   79 #ifdef __DJGPP__
   80 /* Prototypes of for Posix functions for which we define replacements
   81    in pc/ files.  */
   82 wint_t btowc (int c);
   83 wint_t putwc (wchar_t wc, FILE *stream);
   84 #endif
   85 
   86 #ifdef __EMX__
   87 
   88 char *os2_fixdllname(char *dst, const char *src, size_t n);
   89 
   90 #ifdef __KLIBC__
   91 #include <dlfcn.h>
   92 
   93 #define dlopen(f, m) os2_dlopen(f, m)
   94 void *os2_dlopen(const char *file, int mode);
   95 
   96 #define dlsym(h, n) os2_dlsym(h, n)
   97 void *os2_dlsym(void *handle, const char *name);
   98 #endif /* __KLIBC__ */
   99 
  100 #endif /* __EMX__ */