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
11 #if defined(__os2__) /* OS/2 need io.h! .ado */
15 #include <sys/types.h>
20 #include <signal.h> /* my_system */
21 #include <limits.h> /* INT_MAX */
22 #include <sys/param.h>
23 #include <sys/types.h>
26 #include <errno.h> /* my_system */
33 #ifdef HAVE_SYS_SELECT_H
34 # include <sys/select.h>
38 # if defined(__GLIBC__) && (__GLIBC__ < 2)
39 # include <linux/termios.h> /* This is needed for TIOCLINUX */
43 # include <sys/ioctl.h>
47 #include "../src/util.h"
51 #ifndef VFS_STANDALONE
52 #error "This file should only be used in standalone VFS"
59 char *shell
= "/bin/sh";
62 * We do not want/need many of midnight's functions, stub routines.
66 enable_interrupt_key (void)
71 disable_interrupt_key (void)
75 int got_interrupt (void)
86 load_anon_passwd (void)
91 static char (*callbacks
[NUM_CALLBACKS
])(char *msg
) = { NULL
, NULL
, NULL
, };
94 vfs_set_callback (int num
, void *func
)
96 if (num
>= NUM_CALLBACKS
)
97 vfs_die ("Attempt to set invalid callback.\n");
98 callbacks
[num
] = func
;
104 if (!callbacks
[CALL_INFO
])
105 fprintf (stderr
, "%s\n", s
);
107 callbacks
[CALL_INFO
](s
);
113 if (!callbacks
[CALL_BOX
])
114 fprintf (stderr
, "%s\n", s
);
116 callbacks
[CALL_BOX
](s
);
120 vfs_get_password (char *msg
)
122 if (!callbacks
[CALL_PASSWD
])
125 callbacks
[CALL_PASSWD
](msg
);
129 print_vfs_message (char *msg
, ...)
135 str
= g_strdup_vprintf (msg
, args
);
143 wipe_password (char *passwd
)
156 exist_file (char *name
)
158 return access (name
, R_OK
) == 0;
162 message_1s (int i
, char *header
, const char *c2
)
166 snprintf (buf
, sizeof (buf
), "%s %s", header
, c2
);
171 message_2s (int i
, char *header
, const char *c2
, const char *c3
)
175 snprintf (buf
, sizeof (buf
), "%s %s %s", header
, c2
, c3
);
180 message_3s( int i
, char *header
, const char *c2
, const char *c3
, const char *c4
)
184 snprintf (buf
, sizeof (buf
), "%s %s %s %s", header
, c2
, c3
, c4
);
188 void message_1s1d (int flags
, char *title
, char *str
, int d
)
192 snprintf (buf
, sizeof (buf
), "%s %d", str
, d
);
197 void vfs_init( void );
198 void ftpfs_init_passwd( void );
200 char *mc_home
= LIBDIR
;