mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* Make-alone.am: Get rid of all standalone code, it has been
unmaintained for years.
This commit is contained in:
parent
08440f7e8d
commit
8568fc50d9
@ -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)));
|
||||
|
||||
|
@ -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 <libintl.h>
|
||||
# define _(String) gettext (String)
|
||||
|
@ -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 *
|
||||
|
@ -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 */
|
||||
|
@ -1,3 +1,8 @@
|
||||
2002-09-10 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* Make-alone.am: Get rid of all standalone code, it has been
|
||||
unmaintained for years.
|
||||
|
||||
2002-09-05 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* direntry.c [!USE_NETCODE]: Disable functions used in networked
|
||||
|
@ -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
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
210
vfs/util-alone.c
210
vfs/util-alone.c
@ -1,210 +0,0 @@
|
||||
/*
|
||||
* Author: 1998 Pavel Machek <pavel@ucw.cz>
|
||||
*
|
||||
* This is for making midnight commander's vfs stuff compile stand-alone
|
||||
*
|
||||
* Namespace pollution: horrible
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include <signal.h> /* my_system */
|
||||
#include <limits.h> /* INT_MAX */
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdarg.h>
|
||||
#include <errno.h> /* my_system */
|
||||
#ifndef OS2_NT
|
||||
# include <pwd.h>
|
||||
# include <grp.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
# include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
# if defined(__GLIBC__) && (__GLIBC__ < 2)
|
||||
# include <linux/termios.h> /* This is needed for TIOCLINUX */
|
||||
# else
|
||||
# include <termios.h>
|
||||
# endif
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#include <glib.h>
|
||||
#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();
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
#ifndef _UTIL_ALONE_H_
|
||||
#define _UTIL_ALONE_H_
|
||||
|
||||
char *load_anon_passwd (void);
|
||||
|
||||
#endif
|
14
vfs/vfs.c
14
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
|
||||
|
11
vfs/vfs.h
11
vfs/vfs.h
@ -6,14 +6,10 @@
|
||||
#include <sys/mman.h>
|
||||
#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 */
|
||||
|
Loading…
Reference in New Issue
Block a user