From 8568fc50d92da9eca9b732593d025c715e0bc729 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Tue, 10 Sep 2002 21:48:49 +0000 Subject: [PATCH] * Make-alone.am: Get rid of all standalone code, it has been unmaintained for years. --- src/dialog.h | 4 - src/i18n.h | 4 - src/util.c | 8 -- src/utilunix.c | 6 -- vfs/ChangeLog | 5 ++ vfs/Make-alone.am | 47 ----------- vfs/extfs.c | 4 - vfs/mcfs.c | 5 -- vfs/util-alone.c | 210 ---------------------------------------------- vfs/util-alone.h | 6 -- vfs/vfs.c | 14 ---- vfs/vfs.h | 11 +-- 12 files changed, 6 insertions(+), 318 deletions(-) delete mode 100644 vfs/Make-alone.am delete mode 100644 vfs/util-alone.c delete mode 100644 vfs/util-alone.h diff --git a/src/dialog.h b/src/dialog.h index 44eb11611..9c1969d45 100644 --- a/src/dialog.h +++ b/src/dialog.h @@ -3,11 +3,7 @@ #include "dlg.h" -#ifndef VFS_STANDALONE #define MSG_ERROR ((char *) -1) -#else -#define MSG_ERROR "Error: " -#endif Dlg_head *message (int error, char *header, const char *text, ...) __attribute__ ((format (printf, 3, 4))); diff --git a/src/i18n.h b/src/i18n.h index f487eb569..4c61db039 100644 --- a/src/i18n.h +++ b/src/i18n.h @@ -1,10 +1,6 @@ #ifndef _MC_I18N_H_ #define _MC_I18N_H_ -#ifdef VFS_STANDALONE /* We do not want vfs code to depend on internationalization, do we? */ -#undef ENABLE_NLS -#endif - #ifdef ENABLE_NLS # include # define _(String) gettext (String) diff --git a/src/util.c b/src/util.c index fed6cc551..b9b8d5868 100644 --- a/src/util.c +++ b/src/util.c @@ -52,7 +52,6 @@ static const char app_text [] = "Midnight-Commander"; int easy_patterns = 1; -#ifndef VFS_STANDALONE int is_printable (int c) { static const unsigned char xterm_printable[] = { @@ -138,7 +137,6 @@ trim (char *s, char *d, int len) strcpy (d, s); return d; } -#endif /* !VFS_STANDALONE */ char * name_quote (const char *s, int quote_percent) @@ -194,7 +192,6 @@ name_quote (const char *s, int quote_percent) return ret; } -#ifndef VFS_STANDALONE char * fake_name_quote (const char *s, int quote_percent) { @@ -759,7 +756,6 @@ char *x_basename (char *s) return ((where = strrchr (s, PATH_SEP))) ? where + 1 : s; } -#endif /* !VFS_STANDALONE */ char *unix_error_string (int error_num) { @@ -770,7 +766,6 @@ char *unix_error_string (int error_num) return buffer; } -#ifndef VFS_STANDALONE char *skip_separators (char *s) { for (;*s; s++) @@ -833,7 +828,6 @@ char *strip_ctrl_codes (char *s) return s; } -#endif /* !VFS_STANDALONE */ #ifndef USE_VFS char *get_current_wd (char *buffer, int size) @@ -922,7 +916,6 @@ decompress_extension (int type) return 0; } -#ifndef VFS_STANDALONE /* Hooks */ void add_hook (Hook **hook_list, void (*hook_fn)(void *), void *data) { @@ -1169,7 +1162,6 @@ char *diff_two_paths (char *first, char *second) g_free (second); return buf; } -#endif /* !VFS_STANDALONE */ /* If filename is NULL, then we just append PATH_SEP to the dir */ char * diff --git a/src/utilunix.c b/src/utilunix.c index 4f2bccdb3..6602de79d 100644 --- a/src/utilunix.c +++ b/src/utilunix.c @@ -44,7 +44,6 @@ struct sigaction startup_handler; -#ifndef VFS_STANDALONE /* uid of the MC user */ static uid_t current_user_uid = -1; /* List of the gids of the user */ @@ -209,7 +208,6 @@ void save_stop_handler (void) { sigaction (SIGTSTP, NULL, &startup_handler); } -#endif /* VFS_STANDALONE */ int my_system (int flags, const char *shell, const char *command) { @@ -299,7 +297,6 @@ char *tilde_expand (const char *directory) return g_strconcat (passwd->pw_dir, PATH_SEP_STR, p, NULL); } -#ifndef VFS_STANDALONE /* Pipes are guaranteed to be able to hold at least 4096 bytes */ /* More than that would be unportable */ @@ -394,7 +391,6 @@ void check_error_pipe (void) if (len > 0) message (0, _(" Warning "), "%s", error); } -#endif /* !VFS_STANDALONE */ static struct sigaction ignore, save_intr, save_quit, save_stop; @@ -617,7 +613,6 @@ char *canonicalize_pathname (char *path) return path; } -#ifndef VFS_STANDALONE #ifdef SCO_FLAVOR int gettimeofday( struct timeval * tv, struct timezone * tz) { @@ -805,4 +800,3 @@ int socketpair(int dummy1, int dummy2, int dummy3, int fd[2]) #endif /* ifndef HAVE_SOCKETPAIR */ #endif /* ifdef USE_NETCODE */ #endif /* SCO_FLAVOR */ -#endif /* VFS_STANDALONE */ diff --git a/vfs/ChangeLog b/vfs/ChangeLog index c93b9cb5d..bf6d10d95 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,8 @@ +2002-09-10 Pavel Roskin + + * Make-alone.am: Get rid of all standalone code, it has been + unmaintained for years. + 2002-09-05 Pavel Roskin * direntry.c [!USE_NETCODE]: Disable functions used in networked diff --git a/vfs/Make-alone.am b/vfs/Make-alone.am deleted file mode 100644 index 3d397a546..000000000 --- a/vfs/Make-alone.am +++ /dev/null @@ -1,47 +0,0 @@ -## Process this file with automake to produce Makefile.in. - -## FIXME: this is not nearly finished. It is pointless to try to use -## it without fixing it, and libvfs, first. Feel free! - - -## This file is used only by the Gnome libvfs build. If you make -## changes here, they must be synchronized with Make-mc.in. - -lib_LTLIBRARIES = libvfs.la - -libvfsincludedir=$(includedir)/vfs - -libvfsinclude_HEADERS=vfs.h - -libvfs_la_SOURCES = \ - container.c \ - direntry.c \ - extfs.c \ - fish.c \ - ftpfs.c \ - local.c \ - mcfs.c \ - mcserv.c \ - names.c \ - sfs.c \ - shared_tar_ext.c \ - tar.c \ - tcputil.c \ - undelfs.c \ - utilvfs.c \ - utilvfs.h \ - vfs.c \ - container.h \ - extfs.h \ - fish.h \ - ftpfs.h \ - mcfs.h \ - names.h \ - tar.h \ - tcputil.h \ - vfs.h \ - xdirentry.h - -libvfs_la_LDFLAGS = -version-info 27:0:27 - -SUBDIRS = extfs diff --git a/vfs/extfs.c b/vfs/extfs.c index 6da35f182..3435c2ceb 100644 --- a/vfs/extfs.c +++ b/vfs/extfs.c @@ -591,11 +591,7 @@ static void extfs_run (char *file) g_free (mc_extfsdir); g_free (archive_name); g_free (q); -#ifndef VFS_STANDALONE shell_execute(cmd, 0); -#else - vfs_die( "shell_execute: implement me!" ); -#endif g_free(cmd); } diff --git a/vfs/mcfs.c b/vfs/mcfs.c index d743b5189..05b5b6fd9 100644 --- a/vfs/mcfs.c +++ b/vfs/mcfs.c @@ -123,16 +123,11 @@ static int mcfs_login_server (int my_socket, char *user, int port, if (result == MC_NEED_PASSWORD){ if (port > 1024 && port_autodetected){ int v; -#ifndef VFS_STANDALONE v = query_dialog (_(" Warning "), _(" The remote server is not running on a system port \n" " you need a password to log in, but the information may \n" " not be safe on the remote side. Continue? \n"), 3, 2, _(" Yes "), _(" No ")); -#else - message_1s( 1, _(" MCFS "), _(" The remote server is running on strange port. Giving up.\n")); - v = 1; -#endif if (v == 1){ close (my_socket); diff --git a/vfs/util-alone.c b/vfs/util-alone.c deleted file mode 100644 index 622a290eb..000000000 --- a/vfs/util-alone.c +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Author: 1998 Pavel Machek - * - * This is for making midnight commander's vfs stuff compile stand-alone - * - * Namespace pollution: horrible - */ - -#include -#include -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include /* my_system */ -#include /* INT_MAX */ -#include -#include -#include -#include -#include /* my_system */ -#ifndef OS2_NT -# include -# include -#endif -#include -#include -#ifdef HAVE_SYS_SELECT_H -# include -#endif - -#ifdef __linux__ -# if defined(__GLIBC__) && (__GLIBC__ < 2) -# include /* This is needed for TIOCLINUX */ -# else -# include -# endif -# include -#endif - -#include -#include "../src/util.h" -#include "vfs.h" -#include "callback.h" - -#ifndef VFS_STANDALONE - #error "This file should only be used in standalone VFS" -#endif - -int source_route = 0; -int cd_symlinks = 0; - -/* User's shell */ -char *shell = "/bin/sh"; - -/* - * We do not want/need many of midnight's functions, stub routines. - */ - -void -enable_interrupt_key (void) -{ -} - -void -disable_interrupt_key (void) -{ -} - -int got_interrupt (void) -{ - return 0; -} - -void -rotate_dash (void) -{ -} - -char * -load_anon_passwd (void) -{ - return NULL; -} - -static char (*callbacks[NUM_CALLBACKS])(char *msg) = { NULL, NULL, NULL, }; - -void -vfs_set_callback (int num, void *func) -{ - if (num >= NUM_CALLBACKS) - vfs_die ("Attempt to set invalid callback.\n"); - callbacks [num] = func; -} - -static void -info_puts( char *s ) -{ - if (!callbacks [CALL_INFO]) - fprintf (stderr, "%s\n", s); - else - callbacks [CALL_INFO](s); -} - -static void -box_puts( char *s ) -{ - if (!callbacks [CALL_BOX]) - fprintf (stderr, "%s\n", s); - else - callbacks [CALL_BOX](s); -} - -char * -vfs_get_password (char *msg) -{ - if (!callbacks [CALL_PASSWD]) - return NULL; - else - callbacks [CALL_PASSWD](msg); -} - -void -print_vfs_message (char *msg, ...) -{ - char *str; - va_list args; - - va_start (args,msg); - str = g_strdup_vprintf (msg, args); - va_end (args); - - info_puts (str); - g_free (str); -} - -void -wipe_password (char *passwd) -{ - char *p = passwd; - - if (p == NULL) - return; - - for (;*p; p++) - *p = 0; - g_free (passwd); -} - -int -exist_file (char *name) -{ - return access (name, R_OK) == 0; -} - -void -message_1s (int i, char *header, const char *c2) -{ - char buf [4096]; - - snprintf (buf, sizeof (buf), "%s %s", header, c2); - box_puts (buf); -} - -void -message_2s (int i, char *header, const char *c2, const char *c3) -{ - char buf [4096]; - - snprintf (buf, sizeof (buf), "%s %s %s", header, c2, c3 ); - box_puts (buf ); -} - -void -message_3s( int i, char *header, const char *c2, const char *c3, const char *c4) -{ - char buf [4096]; - - snprintf (buf, sizeof (buf), "%s %s %s %s", header, c2, c3, c4); - box_puts (buf); -} - -void message_1s1d (int flags, char *title, char *str, int d) -{ - char buf [4096]; - - snprintf (buf, sizeof (buf), "%s %d", str, d); - box_puts (buf); -} - - -void vfs_init( void ); -void ftpfs_init_passwd( void ); - -char *mc_home = LIBDIR; - -void -mc_vfs_init( void ) -{ - vfs_init(); - ftpfs_init_passwd(); -} - -void -mc_vfs_done( void ) -{ - vfs_shut(); -} diff --git a/vfs/util-alone.h b/vfs/util-alone.h deleted file mode 100644 index 5b91d86ff..000000000 --- a/vfs/util-alone.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _UTIL_ALONE_H_ -#define _UTIL_ALONE_H_ - -char *load_anon_passwd (void); - -#endif diff --git a/vfs/vfs.c b/vfs/vfs.c index 6797918ab..58efa6a29 100644 --- a/vfs/vfs.c +++ b/vfs/vfs.c @@ -47,12 +47,10 @@ #include "../src/dir.h" #include "../src/main.h" -#ifndef VFS_STANDALONE #include "../src/panel.h" #include "../src/key.h" /* Required for the async alarm handler */ #include "../src/layout.h" /* For get_panel_widget and get_other_index */ #include "../src/wtools.h" /* input_dialog() */ -#endif #include "xdirentry.h" #include "vfs.h" @@ -62,10 +60,6 @@ # include "tcputil.h" #endif -#ifdef VFS_STANDALONE -#undef WITH_SMBFS -#endif - extern int get_other_type (void); int vfs_timeout = 60; /* VFS timeout in seconds */ @@ -788,7 +782,6 @@ is_parent (vfs * nvfs, vfsid nvfsid, struct vfs_stamping *parent) void vfs_add_noncurrent_stamps (vfs * oldvfs, vfsid oldvfsid, struct vfs_stamping *parent) { -#ifndef VFS_STANDALONE vfs *nvfs, *n2vfs, *n3vfs; vfsid nvfsid, n2vfsid, n3vfsid; struct vfs_stamping *par, *stamp; @@ -864,9 +857,6 @@ vfs_add_noncurrent_stamps (vfs * oldvfs, vfsid oldvfsid, struct vfs_stamping *pa vfs_addstamp (stamp->v, stamp->id, stamp->parent); } } -#else - vfs_addstamp (oldvfs, oldvfsid, parent); -#endif } static void @@ -885,7 +875,6 @@ vfs_stamp_path (char *path) vfs_rm_parents (par); } -#ifndef VFS_STANDALONE void vfs_add_current_stamps (void) { @@ -901,7 +890,6 @@ vfs_add_current_stamps (void) vfs_stamp_path (opanel->cwd); } } -#endif /* This function is really broken */ int @@ -1886,13 +1874,11 @@ vfs_print_stats (const char *fs_name, const char *action, const char *file_name, fs_name, action, file_name, (unsigned long) have); } -#ifndef VFS_STANDALONE char * vfs_get_password (char *msg) { return (char *) input_dialog (msg, _("Password:"), INPUT_PASSWORD); } -#endif /* * Returns vfs path corresponding to given url. If passed string is diff --git a/vfs/vfs.h b/vfs/vfs.h index fb6c808fa..64cfcc762 100644 --- a/vfs/vfs.h +++ b/vfs/vfs.h @@ -6,14 +6,10 @@ #include #endif -#ifdef VFS_STANDALONE -#undef USE_EXT2FSLIB -#else -#undef BROKEN_PATHS /* * Define this to allow /any/path/#ftp/ to access ftp tree. Broken, yes. */ -#endif +#undef BROKEN_PATHS /* * The following line is needed, because as usual, AIX pollutes every single @@ -385,11 +381,6 @@ extern gid_t vfs_gid; #define FL_NO_CWDSETUP 0x40000000 -#ifdef VFS_STANDALONE -extern void mc_vfs_init( void ); -extern void mc_vfs_done( void ); -#endif - #define O_ALL (O_CREAT | O_EXCL | O_NOCTTY | O_NDELAY | O_SYNC | O_WRONLY | O_RDWR | O_RDONLY) /* Midnight commander code should _not_ use other flags than those listed above and O_APPEND */