2 * Author: 1998 Pavel Machek <pavel@ucw.cz>
4 * This is for making midnight commander's vfs stuff compile stand-alone
6 * Namespace pollution: horrible
12 #include <sys/types.h>
17 #include <signal.h> /* my_system */
18 #include <limits.h> /* INT_MAX */
19 #include <sys/param.h>
20 #include <sys/types.h>
23 #include <errno.h> /* my_system */
30 #ifdef HAVE_SYS_SELECT_H
31 # include <sys/select.h>
35 # if defined(__GLIBC__) && (__GLIBC__ < 2)
36 # include <linux/termios.h> /* This is needed for TIOCLINUX */
40 # include <sys/ioctl.h>
44 #include "../src/util.h"
48 #ifndef VFS_STANDALONE
49 #error "This file should only be used in standalone VFS"
56 char *shell
= "/bin/sh";
59 * We do not want/need many of midnight's functions, stub routines.
63 enable_interrupt_key (void)
68 disable_interrupt_key (void)
72 int got_interrupt (void)
83 load_anon_passwd (void)
88 static char (*callbacks
[NUM_CALLBACKS
])(char *msg
) = { NULL
, NULL
, NULL
, };
91 vfs_set_callback (int num
, void *func
)
93 if (num
>= NUM_CALLBACKS
)
94 vfs_die ("Attempt to set invalid callback.\n");
95 callbacks
[num
] = func
;
101 if (!callbacks
[CALL_INFO
])
102 fprintf (stderr
, "%s\n", s
);
104 callbacks
[CALL_INFO
](s
);
110 if (!callbacks
[CALL_BOX
])
111 fprintf (stderr
, "%s\n", s
);
113 callbacks
[CALL_BOX
](s
);
117 vfs_get_password (char *msg
)
119 if (!callbacks
[CALL_PASSWD
])
122 callbacks
[CALL_PASSWD
](msg
);
126 print_vfs_message (char *msg
, ...)
132 str
= g_strdup_vprintf (msg
, args
);
140 wipe_password (char *passwd
)
153 exist_file (char *name
)
155 return access (name
, R_OK
) == 0;
159 message_1s (int i
, char *header
, const char *c2
)
163 snprintf (buf
, sizeof (buf
), "%s %s", header
, c2
);
168 message_2s (int i
, char *header
, const char *c2
, const char *c3
)
172 snprintf (buf
, sizeof (buf
), "%s %s %s", header
, c2
, c3
);
177 message_3s( int i
, char *header
, const char *c2
, const char *c3
, const char *c4
)
181 snprintf (buf
, sizeof (buf
), "%s %s %s %s", header
, c2
, c3
, c4
);
185 void message_1s1d (int flags
, char *title
, char *str
, int d
)
189 snprintf (buf
, sizeof (buf
), "%s %d", str
, d
);
194 void vfs_init( void );
195 void ftpfs_init_passwd( void );
197 char *mc_home
= LIBDIR
;