|
@@ -1,47 +1,47 @@
|
|
-
|
|
|
|
/** \file global.h
|
|
/** \file global.h
|
|
* \brief Header: %global definitions for compatibility
|
|
* \brief Header: %global definitions for compatibility
|
|
*
|
|
*
|
|
* This file should be included after all system includes and before all local includes.
|
|
* This file should be included after all system includes and before all local includes.
|
|
*/
|
|
*/
|
|
|
|
|
|
-
|
|
|
|
#ifndef MC_GLOBAL_H
|
|
#ifndef MC_GLOBAL_H
|
|
#define MC_GLOBAL_H
|
|
#define MC_GLOBAL_H
|
|
|
|
|
|
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
|
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
|
-# include <string.h>
|
|
|
|
|
|
+#include <string.h>
|
|
/* An ANSI string.h and pre-ANSI memory.h might conflict */
|
|
/* An ANSI string.h and pre-ANSI memory.h might conflict */
|
|
-# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
|
|
|
|
-# include <memory.h>
|
|
|
|
-# endif /* !STDC_HEADERS & HAVE_MEMORY_H */
|
|
|
|
|
|
+#if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
|
|
|
|
+#include <memory.h>
|
|
|
|
+#endif /* !STDC_HEADERS & HAVE_MEMORY_H */
|
|
|
|
|
|
#else /* !STDC_HEADERS & !HAVE_STRING_H */
|
|
#else /* !STDC_HEADERS & !HAVE_STRING_H */
|
|
-# include <strings.h>
|
|
|
|
|
|
+#include <strings.h>
|
|
/* memory and strings.h conflict on other systems */
|
|
/* memory and strings.h conflict on other systems */
|
|
#endif /* !STDC_HEADERS & !HAVE_STRING_H */
|
|
#endif /* !STDC_HEADERS & !HAVE_STRING_H */
|
|
|
|
|
|
#ifdef HAVE_SYS_PARAM_H
|
|
#ifdef HAVE_SYS_PARAM_H
|
|
-# include <sys/param.h>
|
|
|
|
|
|
+#include <sys/param.h>
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+/*** typedefs(not structures) and defined constants **********************************************/
|
|
|
|
+
|
|
/* The O_BINARY definition was taken from gettext */
|
|
/* The O_BINARY definition was taken from gettext */
|
|
#if !defined O_BINARY && defined _O_BINARY
|
|
#if !defined O_BINARY && defined _O_BINARY
|
|
/* For MSC-compatible compilers. */
|
|
/* For MSC-compatible compilers. */
|
|
-# define O_BINARY _O_BINARY
|
|
|
|
|
|
+#define O_BINARY _O_BINARY
|
|
#endif
|
|
#endif
|
|
#ifdef __BEOS__
|
|
#ifdef __BEOS__
|
|
/* BeOS 5 has O_BINARY, but is has no effect. */
|
|
/* BeOS 5 has O_BINARY, but is has no effect. */
|
|
-# undef O_BINARY
|
|
|
|
|
|
+#undef O_BINARY
|
|
#endif
|
|
#endif
|
|
/* On reasonable systems, binary I/O is the default. */
|
|
/* On reasonable systems, binary I/O is the default. */
|
|
#ifndef O_BINARY
|
|
#ifndef O_BINARY
|
|
-# define O_BINARY 0
|
|
|
|
|
|
+#define O_BINARY 0
|
|
#endif
|
|
#endif
|
|
|
|
|
|
/* Replacement for O_NONBLOCK */
|
|
/* Replacement for O_NONBLOCK */
|
|
#ifndef O_NONBLOCK
|
|
#ifndef O_NONBLOCK
|
|
-#ifdef O_NDELAY /* SYSV */
|
|
|
|
|
|
+#ifdef O_NDELAY /* SYSV */
|
|
#define O_NONBLOCK O_NDELAY
|
|
#define O_NONBLOCK O_NDELAY
|
|
#else /* BSD */
|
|
#else /* BSD */
|
|
#define O_NONBLOCK FNDELAY
|
|
#define O_NONBLOCK FNDELAY
|
|
@@ -49,38 +49,38 @@
|
|
#endif /* !O_NONBLOCK */
|
|
#endif /* !O_NONBLOCK */
|
|
|
|
|
|
#ifdef HAVE_SYS_SELECT_H
|
|
#ifdef HAVE_SYS_SELECT_H
|
|
-# include <sys/select.h>
|
|
|
|
|
|
+#include <sys/select.h>
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#if defined(__QNX__) && !defined(__QNXNTO__)
|
|
#if defined(__QNX__) && !defined(__QNXNTO__)
|
|
/* exec*() from <process.h> */
|
|
/* exec*() from <process.h> */
|
|
-# include <unix.h>
|
|
|
|
|
|
+#include <unix.h>
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#include <glib.h>
|
|
#include <glib.h>
|
|
#include "glibcompat.h"
|
|
#include "glibcompat.h"
|
|
|
|
|
|
#ifndef __GNUC__
|
|
#ifndef __GNUC__
|
|
-# define __attribute__(x)
|
|
|
|
|
|
+#define __attribute__(x)
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifdef ENABLE_NLS
|
|
#ifdef ENABLE_NLS
|
|
-# include <libintl.h>
|
|
|
|
-# define _(String) gettext (String)
|
|
|
|
-# ifdef gettext_noop
|
|
|
|
-# define N_(String) gettext_noop (String)
|
|
|
|
-# else
|
|
|
|
-# define N_(String) (String)
|
|
|
|
-# endif
|
|
|
|
|
|
+#include <libintl.h>
|
|
|
|
+#define _(String) gettext (String)
|
|
|
|
+#ifdef gettext_noop
|
|
|
|
+#define N_(String) gettext_noop (String)
|
|
|
|
+#else
|
|
|
|
+#define N_(String) (String)
|
|
|
|
+#endif
|
|
#else /* Stubs that do something close enough. */
|
|
#else /* Stubs that do something close enough. */
|
|
-# define textdomain(String)
|
|
|
|
-# define gettext(String) (String)
|
|
|
|
-# define ngettext(String1,String2,Num) (((Num) == 1) ? (String1) : (String2))
|
|
|
|
-# define dgettext(Domain,Message) (Message)
|
|
|
|
-# define dcgettext(Domain,Message,Type) (Message)
|
|
|
|
-# define bindtextdomain(Domain,Directory)
|
|
|
|
-# define _(String) (String)
|
|
|
|
-# define N_(String) (String)
|
|
|
|
|
|
+#define textdomain(String)
|
|
|
|
+#define gettext(String) (String)
|
|
|
|
+#define ngettext(String1,String2,Num) (((Num) == 1) ? (String1) : (String2))
|
|
|
|
+#define dgettext(Domain,Message) (Message)
|
|
|
|
+#define dcgettext(Domain,Message,Type) (Message)
|
|
|
|
+#define bindtextdomain(Domain,Directory)
|
|
|
|
+#define _(String) (String)
|
|
|
|
+#define N_(String) (String)
|
|
#endif /* !ENABLE_NLS */
|
|
#endif /* !ENABLE_NLS */
|
|
|
|
|
|
#include "fs.h"
|
|
#include "fs.h"
|
|
@@ -90,8 +90,6 @@
|
|
#include "lib/logging.h"
|
|
#include "lib/logging.h"
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-extern const char *home_dir;
|
|
|
|
-
|
|
|
|
#ifdef min
|
|
#ifdef min
|
|
#undef min
|
|
#undef min
|
|
#endif
|
|
#endif
|
|
@@ -100,21 +98,19 @@ extern const char *home_dir;
|
|
#undef max
|
|
#undef max
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-#define min(x, y) ((x) > (y) ? (y) : (x))
|
|
|
|
-#define max(x, y) ((x) > (y) ? (x) : (y))
|
|
|
|
|
|
+#define min(x, y) ((x) > (y) ? (y) : (x))
|
|
|
|
+#define max(x, y) ((x) > (y) ? (x) : (y))
|
|
|
|
|
|
/* Just for keeping Your's brains from invention a proper size of the buffer :-) */
|
|
/* Just for keeping Your's brains from invention a proper size of the buffer :-) */
|
|
-#define BUF_10K 10240L
|
|
|
|
-#define BUF_8K 8192L
|
|
|
|
-#define BUF_4K 4096L
|
|
|
|
-#define BUF_1K 1024L
|
|
|
|
|
|
+#define BUF_10K 10240L
|
|
|
|
+#define BUF_8K 8192L
|
|
|
|
+#define BUF_4K 4096L
|
|
|
|
+#define BUF_1K 1024L
|
|
|
|
|
|
-#define BUF_LARGE BUF_1K
|
|
|
|
-#define BUF_MEDIUM 512
|
|
|
|
-#define BUF_SMALL 128
|
|
|
|
-#define BUF_TINY 64
|
|
|
|
-
|
|
|
|
-void refresh_screen (void *);
|
|
|
|
|
|
+#define BUF_LARGE BUF_1K
|
|
|
|
+#define BUF_MEDIUM 512
|
|
|
|
+#define BUF_SMALL 128
|
|
|
|
+#define BUF_TINY 64
|
|
|
|
|
|
/* AIX compiler doesn't understand '\e' */
|
|
/* AIX compiler doesn't understand '\e' */
|
|
#define ESC_CHAR '\033'
|
|
#define ESC_CHAR '\033'
|
|
@@ -125,14 +121,27 @@ void refresh_screen (void *);
|
|
|
|
|
|
#if 0
|
|
#if 0
|
|
#ifdef MC_ENABLE_DEBUGGING_CODE
|
|
#ifdef MC_ENABLE_DEBUGGING_CODE
|
|
-# undef NDEBUG
|
|
|
|
|
|
+#undef NDEBUG
|
|
#else
|
|
#else
|
|
-# define NDEBUG
|
|
|
|
|
|
+#define NDEBUG
|
|
#endif
|
|
#endif
|
|
#include <assert.h>
|
|
#include <assert.h>
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#define MC_ERROR mc_main_error_quark ()
|
|
#define MC_ERROR mc_main_error_quark ()
|
|
|
|
+
|
|
|
|
+/*** enums ***************************************************************************************/
|
|
|
|
+
|
|
|
|
+/*** structures declarations (and typedefs of structures)*****************************************/
|
|
|
|
+
|
|
|
|
+/*** global variables defined in .c file *********************************************************/
|
|
|
|
+
|
|
|
|
+extern const char *home_dir;
|
|
|
|
+
|
|
|
|
+/*** declarations of public functions ************************************************************/
|
|
|
|
+
|
|
|
|
+void refresh_screen (void *);
|
|
GQuark mc_main_error_quark (void);
|
|
GQuark mc_main_error_quark (void);
|
|
|
|
|
|
|
|
+/*** inline functions ****************************************************************************/
|
|
#endif
|
|
#endif
|