Merge branch '1866_filesystem_reorganization'

* 1866_filesystem_reorganization: (27 commits)
  src/viewer/display.c: added forgotten #include "src/charsets.h"
  Removed src/pipethrough.* files.
  Move src/cons.saver into src/consaver/* subdir
  Changes for build after moving logging.[ch] into library
  Move logging.[ch] into library
  Changes for build after moving strutils into library
  Moved strecape.[ch] into library
  Added include of "fileloc.h" into subshell.c file
  Changes for build after moving interface includes
  Move all interface includes from subdirs lib/*/*.h into lib/*.h
  Reorganization of usage external libs
  Changes for build after moving strutil into lib
  Change maint/template.c matched with new place of global.h
  Moved strutil-related stuff from src into lib/strutil/*
  Changes for build after moving util.[ch]
  Moved src/util.[ch] into lib, also moved unixcompat.h and utilunix.c.
  Reorganization of sources. Part 2
  Reorganization of sources. Part 1.
  global.h Removed unneeded include of file "textconf.h"
  Reorganized pathes to files in '#include' directives
  ...
This commit is contained in:
Slava Zanko 2010-01-26 10:30:48 +02:00
commit 173d2d4b90
366 changed files with 998 additions and 1550 deletions

View File

@ -1,7 +1,7 @@
## Process this file with automake to create Makefile.in.
AUTOMAKE_OPTIONS = 1.5
SUBDIRS = intl po vfs edit src doc syntax contrib misc
SUBDIRS = intl po lib src doc contrib misc
EXTRA_DIST =

View File

@ -29,7 +29,7 @@ fi
cd "$srcdir"
# The autoconf cache (version after 2.52) is not reliable yet.
rm -rf autom4te.cache vfs/samba/autom4te.cache
rm -rf autom4te.cache lib/vfs/mc-vfs/samba/autom4te.cache
if test ! -d config; then
mkdir config
@ -72,16 +72,16 @@ $AUTOMAKE -a
test -f Makefile.in || \
{ echo "automake failed to generate Makefile.in" >&2; exit 1; }
cd vfs/samba
cd lib/vfs/mc-vfs/samba
date -u >include/stamp-h.in
$AUTOHEADER
test -f include/config.h.in || \
{ echo "autoheader failed to generate vfs/samba/include/config.h.in" >&2; exit 1; }
{ echo "autoheader failed to generate lib/vfs/mc-vfs/samba/include/config.h.in" >&2; exit 1; }
$AUTOCONF
test -f configure || \
{ echo "autoconf failed to generate vfs/samba/configure" >&2; exit 1; }
{ echo "autoconf failed to generate lib/vfs/mc-vfs/samba/configure" >&2; exit 1; }
) || exit 1
$srcdir/maint/version.sh "$srcdir"

View File

@ -545,7 +545,7 @@ dnl Libraries used only when building the mc binary
AC_SUBST(MCLIBS)
if test -n "$use_smbfs"; then
AC_CONFIG_SUBDIRS([vfs/samba])
AC_CONFIG_SUBDIRS([lib/vfs/mc-vfs/samba])
fi
AM_CONDITIONAL(USE_MAINTAINER_MODE, [test x"$USE_MAINTAINER_MODE" = xyes])
@ -575,43 +575,47 @@ misc/skins/Makefile
misc/mc.ext
src/Makefile
src/filehighlight/Makefile
src/mcconfig/Makefile
src/search/Makefile
src/skin/Makefile
src/tty/Makefile
src/consaver/Makefile
src/editor/Makefile
src/viewer/Makefile
edit/Makefile
syntax/Makefile
lib/Makefile
lib/filehighlight/Makefile
lib/mcconfig/Makefile
lib/search/Makefile
lib/skin/Makefile
lib/strutil/Makefile
lib/tty/Makefile
lib/vfs/Makefile
lib/vfs/mc-vfs/Makefile
lib/vfs/mc-vfs/extfs/Makefile
lib/vfs/mc-vfs/extfs/a
lib/vfs/mc-vfs/extfs/apt
lib/vfs/mc-vfs/extfs/audio
lib/vfs/mc-vfs/extfs/deb
lib/vfs/mc-vfs/extfs/deba
lib/vfs/mc-vfs/extfs/debd
lib/vfs/mc-vfs/extfs/dpkg
lib/vfs/mc-vfs/extfs/iso9660
lib/vfs/mc-vfs/extfs/hp48
lib/vfs/mc-vfs/extfs/lslR
lib/vfs/mc-vfs/extfs/mailfs
lib/vfs/mc-vfs/extfs/patchfs
lib/vfs/mc-vfs/extfs/rpms
lib/vfs/mc-vfs/extfs/s3
lib/vfs/mc-vfs/extfs/uace
lib/vfs/mc-vfs/extfs/ualz
lib/vfs/mc-vfs/extfs/uar
lib/vfs/mc-vfs/extfs/uarc
lib/vfs/mc-vfs/extfs/uarj
lib/vfs/mc-vfs/extfs/uc1541
lib/vfs/mc-vfs/extfs/uha
lib/vfs/mc-vfs/extfs/ulha
lib/vfs/mc-vfs/extfs/urar
lib/vfs/mc-vfs/extfs/uzip
lib/vfs/mc-vfs/extfs/uzoo
vfs/Makefile
vfs/extfs/Makefile
vfs/extfs/a
vfs/extfs/apt
vfs/extfs/audio
vfs/extfs/deb
vfs/extfs/deba
vfs/extfs/debd
vfs/extfs/dpkg
vfs/extfs/iso9660
vfs/extfs/hp48
vfs/extfs/lslR
vfs/extfs/mailfs
vfs/extfs/patchfs
vfs/extfs/rpms
vfs/extfs/s3
vfs/extfs/uace
vfs/extfs/ualz
vfs/extfs/uar
vfs/extfs/uarc
vfs/extfs/uarj
vfs/extfs/uc1541
vfs/extfs/uha
vfs/extfs/ulha
vfs/extfs/urar
vfs/extfs/uzip
vfs/extfs/uzoo
misc/syntax/Makefile
doc/Makefile
doc/hints/Makefile

45
lib/Makefile.am Normal file
View File

@ -0,0 +1,45 @@
SUBDIRS = filehighlight mcconfig search skin tty vfs strutil
noinst_LTLIBRARIES = libmc.la
SUBLIB_includes = \
filehighlight.h \
mcconfig.h \
search.h \
strescape.h \
strutil.h
SRC_mc_utils = \
utilunix.c \
unixcompat.h \
util.c util.h
libmc_la_SOURCES = \
$(SUBLIB_includes) \
$(SRC_mc_utils) \
fileloc.h \
fs.h \
glibcompat.c glibcompat.h \
global.h \
timefmt.h
if USE_MAINTAINER_MODE
libmc_la_SOURCES += logging.c logging.h
endif
libmc_la_CFLAGS= $(GLIB_CFLAGS) -I$(top_srcdir) $(PCRE_CFLAGS)
libmc_la_LIBADD = \
filehighlight/libmcfilehighlight.la \
mcconfig/libmcconfig.la \
search/libsearch.la \
strutil/libmcstrutil.la \
skin/libmcskin.la \
tty/libmctty.la
if ENABLE_VFS
libmc_la_LIBADD += vfs/mc-vfs/libvfs-mc.la
endif

View File

@ -1,9 +1,9 @@
#ifndef MC__FILEHIGHLIGHT_H
#define MC__FILEHIGHLIGHT_H
#include "../../src/mcconfig/mcconfig.h"
#include "../../src/search/search.h"
#include "../src/dir.h"
#include "lib/mcconfig.h"
#include "lib/search.h"
#include "src/dir.h"
/*** typedefs(not structures) and defined constants **********************************************/

View File

@ -2,13 +2,10 @@ noinst_LTLIBRARIES = libmcfilehighlight.la
libmcfilehighlight_la_SOURCES = \
common.c \
fhl.h \
get-color.c \
ini-file-read.c \
internal.h
libmcfilehighlight_la_CFLAGS=-I../ -I$(top_srcdir)/src \
libmcfilehighlight_la_CFLAGS = -I$(top_srcdir) \
$(GLIB_CFLAGS) $(PCRE_CFLAGS) \
-DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\"
libmcfilehighlight_la_LIBADD = $(PCRE_LIBS)

View File

@ -28,8 +28,8 @@
#include <config.h>
#include "../src/global.h"
#include "../src/filehighlight/fhl.h"
#include "lib/global.h"
#include "lib/filehighlight.h"
#include "internal.h"
/*** global variables ****************************************************************************/

View File

@ -29,10 +29,9 @@
#include <string.h>
#include "../src/global.h"
#include "../src/util.h"
#include "../src/skin/skin.h"
#include "../src/filehighlight/fhl.h"
#include "lib/global.h"
#include "lib/skin.h"
#include "lib/filehighlight.h"
#include "internal.h"
/*** global variables ****************************************************************************/

View File

@ -28,13 +28,14 @@
#include <config.h>
#include <string.h>
#include "../src/global.h"
#include "../src/main.h"
#include "../src/fileloc.h"
#include "../src/strescape.h"
#include "../src/skin/skin.h"
#include "../../src/util.h"
#include "fhl.h"
#include "lib/global.h"
#include "lib/fileloc.h"
#include "lib/strescape.h"
#include "lib/skin.h"
#include "lib/filehighlight.h"
#include "src/main.h"
#include "internal.h"
/*** global variables ****************************************************************************/

View File

View File

@ -87,11 +87,9 @@
#include "util.h"
#ifdef USE_MAINTAINER_MODE
#include "../src/logging.h"
#include "lib/logging.h"
#endif
#include "textconf.h"
extern const char *home_dir;
#ifdef min

View File

@ -32,11 +32,12 @@
#include <stdarg.h>
#include <stdio.h>
#include "global.h"
#include "lib/global.h"
#include "logging.h"
#include "setup.h"
#include "../src/mcconfig/mcconfig.h"
#include "fileloc.h"
#include "lib/mcconfig.h"
#include "lib/fileloc.h"
#include "src/setup.h"
/*** file scope functions **********************************************/

View File

@ -2,12 +2,11 @@
noinst_LTLIBRARIES = libmcconfig.la
libmcconfig_la_SOURCES = \
mcconfig.h \
common.c \
get.c \
set.c
libmcconfig_la_CFLAGS=-I../ -I$(top_srcdir)/src \
libmcconfig_la_CFLAGS = -I$(top_srcdir) \
$(GLIB_CFLAGS) \
-DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\"

View File

@ -25,13 +25,9 @@
#include <fcntl.h>
#include <errno.h> /* extern int errno */
#include "global.h"
#include "../../vfs/vfs.h" /* mc_stat */
#include "../../src/util.h"
#include "mcconfig.h"
#include "lib/global.h"
#include "lib/vfs/mc-vfs/vfs.h" /* mc_stat */
#include "lib/mcconfig.h"
/*** global variables **************************************************/

View File

@ -19,10 +19,9 @@
#include <config.h>
#include "global.h"
#include "mcconfig.h"
#include "../src/strutil.h"
#include "lib/global.h"
#include "lib/strutil.h"
#include "lib/mcconfig.h"
/*** global variables **************************************************/

View File

@ -19,10 +19,9 @@
#include <config.h>
#include "global.h"
#include "mcconfig.h"
#include "../src/strutil.h"
#include "lib/global.h"
#include "lib/strutil.h"
#include "lib/mcconfig.h"
/*** global variables **************************************************/

View File

@ -3,7 +3,7 @@
#include <config.h>
#include "../src/global.h" /* <glib.h> */
#include "lib/global.h" /* <glib.h> */
#include <sys/types.h>

View File

@ -2,7 +2,6 @@ noinst_LTLIBRARIES = libsearch.la
libsearch_la_SOURCES = \
search.c \
search.h \
internal.h \
lib.c \
normal.c \
@ -10,8 +9,6 @@ libsearch_la_SOURCES = \
glob.c \
hex.c
libsearch_la_CFLAGS=-I../ -I$(top_srcdir)/src \
libsearch_la_CFLAGS = -I$(top_srcdir) \
$(GLIB_CFLAGS) \
-DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" $(PCRE_CFLAGS)
libsearch_la_LIBADD = $(PCRE_LIBS)

View File

@ -28,12 +28,14 @@
#include <config.h>
#include "../src/global.h"
#include "../src/search/search.h"
#include "../src/search/internal.h"
#include "../src/strutil.h"
#include "../src/strescape.h"
#include "../src/charsets.h"
#include "lib/global.h"
#include "lib/strutil.h"
#include "lib/search.h"
#include "lib/strescape.h"
#include "src/charsets.h"
#include "internal.h"
/*** global variables ****************************************************************************/

View File

@ -29,12 +29,14 @@
#include <stdio.h>
#include "../src/global.h"
#include "../src/search/search.h"
#include "../src/search/internal.h"
#include "../src/strutil.h"
#include "../src/strescape.h"
#include "../src/charsets.h"
#include "lib/global.h"
#include "lib/strutil.h"
#include "lib/search.h"
#include "lib/strescape.h"
#include "src/charsets.h"
#include "internal.h"
/*** global variables ****************************************************************************/

View File

@ -30,11 +30,12 @@
#include <stdlib.h>
#include <sys/types.h>
#include "../src/global.h"
#include "../src/search/search.h"
#include "../src/search/internal.h"
#include "../src/strutil.h"
#include "../src/charsets.h"
#include "lib/global.h"
#include "lib/strutil.h"
#include "lib/search.h"
#include "internal.h"
#include "src/charsets.h"
/*** global variables ****************************************************************************/

View File

@ -27,12 +27,13 @@
#include <config.h>
#include "lib/global.h"
#include "lib/strutil.h"
#include "lib/search.h"
#include "../src/global.h"
#include "../src/search/search.h"
#include "../src/search/internal.h"
#include "../src/strutil.h"
#include "../src/charsets.h"
#include "src/charsets.h"
#include "internal.h"
/*** global variables ****************************************************************************/

View File

@ -29,12 +29,14 @@
#include <stdlib.h>
#include "../src/global.h"
#include "../src/search/search.h"
#include "../src/search/internal.h"
#include "../src/strutil.h"
#include "../src/strescape.h"
#include "../src/charsets.h"
#include "lib/global.h"
#include "lib/strutil.h"
#include "lib/search.h"
#include "lib/strescape.h"
#include "src/charsets.h"
#include "internal.h"
/*** global variables ****************************************************************************/

View File

@ -30,11 +30,13 @@
#include <stdlib.h>
#include <sys/types.h>
#include "../src/global.h"
#include "../src/search/search.h"
#include "../src/search/internal.h"
#include "../src/strutil.h"
#include "../src/charsets.h"
#include "lib/global.h"
#include "lib/strutil.h"
#include "lib/search.h"
#include "src/charsets.h"
#include "internal.h"
/*** global variables ****************************************************************************/

View File

@ -1,11 +1,11 @@
#ifndef MC__SKIN_H
#define MC__SKIN_H
#include "../../src/global.h"
#include "lib/global.h"
#include "../../src/mcconfig/mcconfig.h"
#include "lib/mcconfig.h"
#include "../src/tty/color.h"
#include "lib/tty/color.h"
/*** typedefs(not structures) and defined constants **********************************************/

View File

@ -7,11 +7,8 @@ libmcskin_la_SOURCES = \
hc-skins.c \
ini-file.c \
lines.c \
skin.h \
internal.h
libmcskin_la_CFLAGS=-I../ -I$(top_srcdir)/src \
libmcskin_la_CFLAGS = -I$(top_srcdir) \
$(GLIB_CFLAGS) $(PCRE_CFLAGS) \
-DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\"
libmcskin_la_LIBADD = $(PCRE_LIBS)

View File

@ -28,13 +28,12 @@
#include <config.h>
#include <stdlib.h>
#include <sys/types.h> /* size_t */
#include "../src/tty/color.h"
#include "lib/tty/color.h"
#include "../src/global.h"
#include "../src/setup.h"
#include "skin.h"
#include "internal.h"
#include "src/setup.h"
/*** global variables ****************************************************************************/

View File

@ -28,11 +28,10 @@
#include <config.h>
#include <string.h>
#include "../src/global.h"
#include "../src/args.h"
#include "../src/tty/color.h"
#include "skin.h"
#include "internal.h"
#include "lib/tty/color.h"
#include "src/args.h"
/*** global variables ****************************************************************************/

View File

@ -28,11 +28,10 @@
#include <config.h>
#include <stdlib.h>
#include "../src/global.h"
#include "../src/args.h"
#include "skin.h"
#include "internal.h"
#include "src/args.h"
/*** global variables ****************************************************************************/
mc_skin_t mc_skin__default;

View File

@ -26,9 +26,7 @@
*/
#include <config.h>
#include "../src/global.h"
#include "skin.h"
#include "internal.h"

View File

@ -28,12 +28,11 @@
#include <config.h>
#include <string.h>
#include "../src/global.h"
#include "../src/main.h"
#include "../src/fileloc.h"
#include "../../src/util.h"
#include "skin.h"
#include "internal.h"
#include "lib/fileloc.h"
#include "src/main.h"
/*** global variables ****************************************************************************/

View File

@ -1,9 +1,8 @@
#ifndef MC__SKIN_INTERNAL_H
#define MC__SKIN_INTERNAL_H
#include "../../src/global.h"
#include "skin.h"
#include "lib/global.h"
#include "lib/skin.h"
/*** typedefs(not structures) and defined constants **********************************************/

View File

@ -28,11 +28,11 @@
#include <config.h>
#include <stdlib.h>
#include "../src/global.h"
#include "../src/args.h"
#include "../src/tty/tty.h"
#include "skin.h"
#include "internal.h"
#include "lib/tty/tty.h"
#include "src/args.h"
/*** global variables ****************************************************************************/

View File

@ -3,7 +3,7 @@
#include <config.h>
#include "../src/global.h" /* <glib.h> */
#include "lib/global.h" /* <glib.h> */
/*** typedefs(not structures) and defined constants **********************************************/

View File

@ -1,7 +1,7 @@
#ifndef MC_STRUTIL_H
#define MC_STRUTIL_H
#include "global.h" /* include glib.h */
#include "lib/global.h" /* include glib.h */
/* Header file for strutil.c, strutilascii.c, strutil8bit.c, strutilutf8.c.
* There are two sort of functions:

12
lib/strutil/Makefile.am Normal file
View File

@ -0,0 +1,12 @@
noinst_LTLIBRARIES = libmcstrutil.la
libmcstrutil_la_SOURCES = \
strescape.c \
strutil8bit.c \
strutilascii.c \
strutil.c \
strutilutf8.c
libmcstrutil_la_CFLAGS = -I$(top_srcdir) $(GLIB_CFLAGS)

View File

@ -26,7 +26,7 @@
*/
#include <config.h>
#include "../src/strescape.h"
#include "lib/strescape.h"
/*** global variables ****************************************************************************/

View File

@ -30,8 +30,8 @@
#include <errno.h>
#include <stdarg.h>
#include "global.h"
#include "strutil.h"
#include "lib/global.h"
#include "lib/strutil.h"
/*names, that are used for utf-8 */
static const char *str_utf8_encodings[] = {

View File

@ -27,9 +27,8 @@
#include <ctype.h>
#include <errno.h>
#include "global.h"
#include "strutil.h"
#include "fs.h"
#include "lib/global.h"
#include "lib/strutil.h"
/* functions for singlebyte encodings, all characters have width 1
* using standard system functions

View File

@ -27,8 +27,8 @@
#include <ctype.h>
#include <config.h>
#include <errno.h>
#include "global.h"
#include "strutil.h"
#include "lib/global.h"
#include "lib/strutil.h"
/* using g_ascii function from glib
* on terminal are showed only ascii characters (lower then 0x80)

View File

@ -30,8 +30,8 @@
#include <langinfo.h>
#include <string.h>
#include "global.h"
#include "strutil.h"
#include "lib/global.h"
#include "lib/strutil.h"
/* using function for utf-8 from glib */

View File

@ -22,6 +22,6 @@ TTY_SRC = \
libmctty_la_SOURCES = $(TTY_SRC) $(TTY_SCREEN_SRC)
libmctty_la_CFLAGS = -I../ -I$(top_srcdir)/src \
libmctty_la_CFLAGS = -I$(top_srcdir) \
$(GLIB_CFLAGS) \
-DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\"

View File

@ -28,8 +28,8 @@
#include <string.h> /* strcmp */
#include "../../src/tty/color.h" /* colors and attributes */
#include "../../src/tty/color-internal.h"
#include "color.h" /* colors and attributes */
#include "color-internal.h"
/*** global variables ****************************************************************************/

View File

@ -8,12 +8,12 @@
#include <sys/types.h> /* size_t */
#include "../../src/global.h"
#include "lib/global.h"
#ifdef HAVE_SLANG
# include "../../src/tty/tty-slang.h"
# include "tty-slang.h"
#else
# include "../../src/tty/tty-ncurses.h"
# include "tty-ncurses.h"
#endif /* HAVE_SLANG */
extern gboolean use_colors;

View File

@ -30,11 +30,11 @@
#include <string.h>
#include <sys/types.h> /* size_t */
#include "../../src/global.h"
#include "lib/global.h"
#include "../../src/tty/tty-ncurses.h"
#include "../../src/tty/color.h" /* variables */
#include "../../src/tty/color-internal.h"
#include "tty-ncurses.h"
#include "color.h" /* variables */
#include "color-internal.h"
/*** global variables ****************************************************************************/

View File

@ -30,13 +30,13 @@
#include <string.h>
#include <sys/types.h> /* size_t */
#include "../../src/global.h"
#include "lib/global.h"
#include "../../src/tty/tty-slang.h"
#include "../../src/tty/color.h" /* variables */
#include "../../src/tty/color-internal.h"
#include "tty-slang.h"
#include "color.h" /* variables */
#include "color-internal.h"
#include "../../src/setup.h" /* color_terminal_string */
#include "src/setup.h" /* color_terminal_string */
static int
has_colors (gboolean disable, gboolean force)

View File

@ -6,7 +6,7 @@
#ifndef MC_COLOR_SLANG_H
#define MC_COLOR_SLANG_H
#include "../../src/tty/tty-slang.h" /* S-Lang headers */
#include "tty-slang.h" /* S-Lang headers */
enum {
COLOR_BLACK = 0,

View File

@ -33,12 +33,12 @@
#include <string.h>
#include <sys/types.h> /* size_t */
#include "../../src/global.h"
#include "lib/global.h"
#include "../../src/tty/tty.h"
#include "../../src/tty/color.h"
#include "tty.h"
#include "color.h"
#include "../../src/tty/color-internal.h"
#include "color-internal.h"
/*** global variables ****************************************************************************/

View File

@ -12,12 +12,12 @@
#ifndef MC_COLOR_H
#define MC_COLOR_H
#include "../../src/global.h" /* glib.h */
#include "lib/global.h" /* glib.h */
#ifdef HAVE_SLANG
# include "../../src/tty/color-slang.h"
# include "color-slang.h"
#else
# include "../../src/tty/tty-ncurses.h"
# include "tty-ncurses.h"
#endif
extern char *command_line_colors;

View File

@ -37,27 +37,28 @@
#include <sys/types.h>
#include <unistd.h>
#include "../../src/global.h"
#include "lib/global.h"
#include "lib/strutil.h" /* str_casecmp */
#include "../../src/tty/tty.h"
#include "../../src/tty/tty-internal.h" /* mouse_enabled */
#include "../../src/tty/mouse.h"
#include "../../src/tty/key.h"
#include "../../src/tty/win.h" /* xterm_flag */
#include "../../src/main.h"
#include "../../src/layout.h" /* winch_flag, mc_refresh() */
#include "../../src/cons.saver.h"
#include "../../src/strutil.h" /* str_casecmp */
#include "../../vfs/vfs.h"
#include "lib/vfs/mc-vfs/vfs.h"
#ifdef ENABLE_VFS
#include "../../vfs/gc.h"
#include "lib/vfs/mc-vfs/gc.h"
#endif /* ENABLE_VFS */
#include "tty.h"
#include "tty-internal.h" /* mouse_enabled */
#include "mouse.h"
#include "key.h"
#include "win.h" /* xterm_flag */
#include "src/main.h"
#include "src/layout.h" /* winch_flag, mc_refresh() */
#include "src/consaver/cons.saver.h"
#ifdef HAVE_TEXTMODE_X11_SUPPORT
#include "../src/tty/x11conn.h"
#include "x11conn.h"
#endif
#ifdef __linux__

View File

@ -6,10 +6,10 @@
#ifndef MC_KEY_H
#define MC_KEY_H
#include "../../src/global.h" /* <glib.h> */
#include "../../src/dialog.h" /* cb_ret_t */
#include "lib/global.h" /* <glib.h> */
#include "src/dialog.h" /* cb_ret_t */
#include "../../src/tty/tty.h" /* KEY_F macro */
#include "tty.h" /* KEY_F macro */
gboolean define_sequence (int code, const char *seq, int action);

View File

@ -41,11 +41,11 @@
#include <config.h>
#include "../../src/global.h"
#include "lib/global.h"
#include "../../src/tty/tty.h"
#include "../../src/tty/mouse.h" /* required before key.h */
#include "../../src/tty/key.h"
#include "tty.h"
#include "mouse.h" /* required before key.h */
#include "key.h"
#if defined (__QNX__) && !defined (__QNXNTO__)
#define HAVE_QNX_KEYS

View File

@ -31,12 +31,12 @@
#include <sys/types.h>
#include <unistd.h>
#include "../../src/global.h"
#include "lib/global.h"
#include "../../src/tty/tty.h"
#include "../../src/tty/tty-internal.h" /* mouse_enabled */
#include "../../src/tty/mouse.h"
#include "../../src/tty/key.h" /* define sequence */
#include "tty.h"
#include "tty-internal.h" /* mouse_enabled */
#include "mouse.h"
#include "key.h" /* define sequence */
gboolean mouse_enabled = FALSE;
const char *xmouse_seq;

View File

@ -6,7 +6,7 @@
#ifndef MC_TTY_INTERNAL_H
#define MC_TTY_INTERNAL_H
#include "../../src/global.h" /* include <glib.h> */
#include "lib/global.h" /* include <glib.h> */
/* If true lines are shown by spaces */
extern gboolean slow_tty;

View File

@ -36,19 +36,19 @@
#include <stdarg.h>
#include <signal.h>
#include "../../src/global.h"
#include "lib/global.h"
#include "lib/strutil.h" /* str_term_form */
#include "src/main.h"
#ifndef WANT_TERM_H
# define WANT_TERM_H
#endif
#include "../../src/tty/tty-internal.h" /* slow_tty */
#include "../../src/tty/tty.h"
#include "../../src/tty/color-internal.h"
#include "../../src/tty/win.h"
#include "../../src/main.h"
#include "../../src/strutil.h" /* str_term_form */
#include "tty-internal.h" /* slow_tty */
#include "tty.h"
#include "color-internal.h"
#include "win.h"
/* include at last !!! */
#ifdef WANT_TERM_H

View File

@ -39,17 +39,17 @@
#include <unistd.h>
#include <signal.h>
#include "../../src/global.h"
#include "lib/global.h"
#include "lib/strutil.h" /* str_term_form */
#include "../../src/tty/tty-internal.h" /* slow_tty */
#include "../../src/tty/tty.h"
#include "../../src/tty/color-slang.h"
#include "../../src/tty/color-internal.h"
#include "../../src/tty/mouse.h" /* Gpm_Event is required in key.h */
#include "../../src/tty/key.h" /* define_sequence */
#include "../../src/tty/win.h"
#include "tty-internal.h" /* slow_tty */
#include "tty.h"
#include "color-slang.h"
#include "color-internal.h"
#include "mouse.h" /* Gpm_Event is required in key.h */
#include "key.h" /* define_sequence */
#include "win.h"
#include "../../src/strutil.h" /* str_term_form */
/*** global variables **************************************************/
extern int reset_hp_softkeys;

View File

@ -34,12 +34,12 @@
#include <signal.h>
#include <stdarg.h>
#include "../../src/global.h"
#include "lib/global.h"
#include "lib/strutil.h"
#include "../../src/tty/tty.h"
#include "../../src/tty/tty-internal.h"
#include "tty.h"
#include "tty-internal.h"
#include "../../src/strutil.h"
/*** global variables **************************************************/

View File

@ -11,12 +11,12 @@
#ifndef MC_TTY_H
#define MC_TTY_H
#include "../../src/global.h" /* include <glib.h> */
#include "lib/global.h" /* include <glib.h> */
#ifdef HAVE_SLANG
# include "../../src/tty/tty-slang.h"
# include "tty-slang.h"
#else
# include "../../src/tty/tty-ncurses.h"
# include "tty-ncurses.h"
#endif
/* {{{ Input }}} */

View File

@ -32,10 +32,10 @@
#include <sys/types.h>
#include <unistd.h>
#include "../../src/tty/tty.h" /* tty_gotoyx, tty_print_char */
#include "../../src/tty/win.h"
#include "../../src/util.h"
#include "../../src/cons.saver.h" /* console_flag */
#include "lib/global.h"
#include "tty.h" /* tty_gotoyx, tty_print_char */
#include "win.h"
#include "src/consaver/cons.saver.h" /* console_flag */
/*** global variables **************************************************/

View File

@ -6,7 +6,7 @@
#ifndef MC_WIN_H
#define MC_WIN_H
#include "../../src/global.h" /* <glib.h> */
#include "lib/global.h" /* <glib.h> */
extern int xterm_flag;

View File

@ -39,8 +39,8 @@ typedef int dummy; /* C99 forbids empty compilation unit */
# include <gmodule.h>
#endif
#include "../../src/global.h"
#include "../../src/tty/x11conn.h"
#include "lib/global.h"
#include "x11conn.h"
/*** file scope type declarations **************************************/

View File

@ -40,28 +40,16 @@
#include <sys/stat.h>
#include <unistd.h>
#include "global.h"
#include "lib/global.h"
#include "lib/tty/win.h" /* xterm_flag */
#include "lib/search.h"
#include "lib/mcconfig.h"
#include "lib/timefmt.h"
#include "lib/fileloc.h"
#include "lib/vfs/mc-vfs/vfs.h"
#include "lib/strutil.h"
#include "../src/tty/win.h" /* xterm_flag */
#include "../src/search/search.h"
#include "main.h" /* mc_home */
#include "cmd.h" /* guess_message_value */
#include "mountlist.h"
#include "timefmt.h"
#include "strutil.h"
#include "./src/mcconfig/mcconfig.h"
#include "fileopctx.h"
#include "file.h" /* copy_file_file() */
#include "dir.h"
#include "fileloc.h"
#include "../vfs/vfs.h"
#ifdef HAVE_CHARSET
#include "charsets.h"
#endif
#include "src/file.h" /* copy_file_file() */
/*In order to use everywhere the same setup
for the locale we use defines */
@ -71,6 +59,15 @@
int easy_patterns = 1;
/*
* If true, SI units (1000 based) will be used for
* larger units (kilobyte, megabyte, ...).
* If false binary units (1024 based) will be used.
*/
int kilobyte_si = 0;
extern void str_replace(char *s, char from, char to)
{
for (; *s != '\0'; s++) {
@ -590,13 +587,13 @@ load_file (const char *filename)
}
char *
load_mc_home_file (const char *filename, char **allocated_filename)
load_mc_home_file (const char *_mc_home, const char *_mc_home_alt, const char *filename, char **allocated_filename)
{
char *hintfile_base, *hintfile;
char *lang;
char *data;
hintfile_base = concat_dir_and_file (mc_home, filename);
hintfile_base = concat_dir_and_file (_mc_home, filename);
lang = guess_message_value ();
hintfile = g_strconcat (hintfile_base, ".", lang, (char *) NULL);
@ -605,7 +602,7 @@ load_mc_home_file (const char *filename, char **allocated_filename)
if (!data) {
g_free (hintfile);
g_free (hintfile_base);
hintfile_base = concat_dir_and_file (mc_home_alt, filename);
hintfile_base = concat_dir_and_file (_mc_home_alt, filename);
hintfile = g_strconcat (hintfile_base, ".", lang, (char *) NULL);
data = load_file (hintfile);
@ -1587,3 +1584,35 @@ mc_util_unlink_backup_if_possible (const char *file_name, const char *backup_suf
g_free(backup_path);
return TRUE;
}
/* partly taken from dcigettext.c, returns "" for default locale */
/* value should be freed by calling function g_free() */
char *guess_message_value (void)
{
static const char * const var[] = {
/* Setting of LC_ALL overwrites all other. */
/* Do not use LANGUAGE for check user locale and drowing hints */
"LC_ALL",
/* Next comes the name of the desired category. */
"LC_MESSAGES",
/* Last possibility is the LANG environment variable. */
"LANG",
/* NULL exit loops */
NULL
};
unsigned i = 0;
const char *locale = NULL;
while (var[i] != NULL) {
locale = getenv (var[i]);
if (locale != NULL && locale[0] != '\0')
break;
i++;
}
if (locale == NULL)
locale = "";
return g_strdup (locale);
}

View File

@ -6,7 +6,7 @@
#ifndef MC_UTIL_H
#define MC_UTIL_H
#include "global.h" /* include <glib.h> */
#include "lib/global.h" /* include <glib.h> */
#include <string.h>
#include <assert.h>
@ -97,7 +97,7 @@ char *diff_two_paths (const char *first, const char *second);
const char *x_basename (const char *fname);
char *load_file (const char *filename);
char *load_mc_home_file (const char *filename, char ** allocated_filename);
char *load_mc_home_file (const char *, const char *, const char *filename, char ** allocated_filename);
/* uid/gid managing */
void init_groups (void);
@ -295,6 +295,8 @@ gboolean mc_util_make_backup_if_possible (const char *, const char *);
gboolean mc_util_restore_from_backup_if_possible (const char *, const char *);
gboolean mc_util_unlink_backup_if_possible (const char *, const char *);
char *guess_message_value (void);
#define MC_PTR_FREE(ptr) do { g_free(ptr); (ptr) = NULL; } while (0)
#endif

View File

@ -48,9 +48,9 @@
#include <pwd.h>
#include <grp.h>
#include "global.h"
#include "execute.h"
#include "wtools.h" /* message() */
#include "lib/global.h"
#include "src/execute.h"
#include "src/wtools.h" /* message() */
struct sigaction startup_handler;

1
lib/vfs/Makefile.am Normal file
View File

@ -0,0 +1 @@
SUBDIRS = mc-vfs

View File

@ -76,21 +76,23 @@ distclean-local:
else :; fi
if ENABLE_VFS
noinst_LIBRARIES = libvfs-mc.a
noinst_LTLIBRARIES = libvfs-mc.la
else
noinst_LIBRARIES =
noinst_LTLIBRARIES =
endif
if ENABLE_VFS_NET
libvfs_mc_a_SOURCES = $(NETFILES) $(NONETFILES)
libvfs_mc_la_SOURCES = $(NETFILES) $(NONETFILES)
else
libvfs_mc_a_SOURCES = $(NONETFILES)
libvfs_mc_la_SOURCES = $(NONETFILES)
endif
if ENABLE_VFS
if ENABLE_MCSERVER
sbin_PROGRAMS = mcserv
mcserv_SOURCES = mcserv.c mcfsutil.c
mcserv_LDADD = $(MCSERVLIBS) $(GLIB_LIBS)
mcserv_SOURCES = mcserv.c
mcserv_LDADD = $(MCSERVLIBS) $(GLIB_LIBS) libvfs-mc.la
endif
endif

View File

@ -29,11 +29,12 @@
#include <errno.h>
#include <fcntl.h>
#include "../src/global.h"
#include "../src/wtools.h" /* message() */
#include "../src/main.h" /* print_vfs_message */
#include "../src/unixcompat.h"
#include "../vfs/vfs.h"
#include "lib/global.h"
#include "lib/unixcompat.h"
#include "src/wtools.h" /* message() */
#include "src/main.h" /* print_vfs_message */
#include "vfs.h"
#include "utilvfs.h"
#include "vfs-impl.h"

View File

@ -35,12 +35,13 @@
#include <time.h>
#include <sys/time.h> /* gettimeofday() */
#include "../src/global.h"
#include "lib/global.h"
#include "../src/tty/tty.h" /* enable/disable interrupt key */
#include "../src/wtools.h" /* message() */
#include "../src/main.h" /* print_vfs_message */
#include "../vfs/vfs.h"
#include "lib/tty/tty.h" /* enable/disable interrupt key */
#include "src/wtools.h" /* message() */
#include "src/main.h" /* print_vfs_message */
#include "vfs.h"
#include "utilvfs.h"
#include "vfs-impl.h"

View File

@ -45,11 +45,11 @@
#include <errno.h>
#include <sys/wait.h>
#include "../src/global.h"
#include "lib/global.h"
#include "../src/wtools.h" /* message() */
#include "../src/main.h" /* print_vfs_message */
#include "../src/execute.h" /* For shell_execute */
#include "src/wtools.h" /* message() */
#include "src/main.h" /* print_vfs_message */
#include "src/execute.h" /* For shell_execute */
#include "utilvfs.h"
#include "vfs.h"

Some files were not shown because too many files have changed in this diff Show More