diff --git a/src/dialog.h b/src/dialog.h index 4f2643422..732306714 100644 --- a/src/dialog.h +++ b/src/dialog.h @@ -3,7 +3,11 @@ #include "dlg.h" +#ifndef VFS_STANDALONE #define MSG_ERROR ((char *) -1) +#else +#define MSG_ERROR "Error: " +#endif Dlg_head *message (int error, char *header, char *text, ...); int query_dialog (char *header, char *text, int flags, int count, ...); diff --git a/vfs/ChangeLog b/vfs/ChangeLog index e8a197707..258959641 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,13 @@ +Wed Sep 2 13:59:47 1998 Pavel Machek + + * ftpfs.c: cleanup of code, few static's added + + * extfs/uarj: added, still, you need patches to unarj to make this + work + + * util-alone.c: now includes code from libvfs.c, so we can kill + libvfs.c (which is good thing as it was non-standard in Makefiles) + Sun Aug 30 13:19:49 1998 Pavel Machek * undelfs.c: fixed, it has been broken for too long diff --git a/vfs/extfs/uarj b/vfs/extfs/uarj new file mode 100644 index 000000000..b6ea42d1b --- /dev/null +++ b/vfs/extfs/uarj @@ -0,0 +1,33 @@ +#! /bin/sh +# +# Copyright 1998 Pavel Machek, +# partly based on zip by Jakub Jelinek 1995 +# +# Distribute in terms of GPL. +# +# +ARJ=mcunarj + +mcarjfs_list () +{ +$ARJ v $1 | awk -v uid=${UID-0} ' +BEGIN { hyphens=0 } +/^----------/ { if (hyphens > 0) exit 0; hyphens=1; next } +{ +if (hyphens < 1) next; +path=$1; +getline; +printf "-rw-r--r-- 1 %-8d %-8d %8d %s-%s %s %s\n", uid, 0, $1, substr($4,4), substr($4,1,2), substr($5,1,5), path +}' 2>/dev/null +} + +mcarjfs_copyout () +{ +$ARJ p $1 $2 2> $3 > /dev/null +} + +case "$1" in + list) mcarjfs_list $2; exit 0;; + copyout) mcarjfs_copyout $2 $3 $4; exit 0;; +esac +exit 1 diff --git a/vfs/util-alone.c b/vfs/util-alone.c index 61ce9507f..9f2cf22ee 100644 --- a/vfs/util-alone.c +++ b/vfs/util-alone.c @@ -50,6 +50,10 @@ #include "vfs.h" #include "callback.h" +#ifndef VFS_STANDALONE +#error This has only sense when compiling standalone version +#endif + int source_route = 0; int cd_symlinks = 0; @@ -96,7 +100,7 @@ load_anon_passwd (void) return NULL; } -static char (*callbacks[NUM_CALLBACKS])(char *msg); +static char (*callbacks[NUM_CALLBACKS])(char *msg) = { NULL, NULL, NULL, }; void vfs_set_callback (int num, void *func) @@ -166,8 +170,8 @@ void message_1s (int i, char *c1, char *c2) { char buf [4096]; - - snprintf (buf, sizeof (buf), c1, c2); + + snprintf (buf, sizeof (buf), "%s %s", c1, c2); box_puts (buf); } @@ -176,7 +180,7 @@ message_2s (int i, char *c1, char *c2, char *c3) { char buf [4096]; - snprintf (buf, sizeof (buf), c1, c2, c3 ); + snprintf (buf, sizeof (buf), "%s %s %s", c1, c2, c3 ); box_puts (buf ); } @@ -184,6 +188,24 @@ void message_3s( int i, char *c1, char *c2, char *c3, const char *c4 ) { char buf [4096]; - snprintf (buf, sizeof (buf), c1, c2, c3, c4); + snprintf (buf, sizeof (buf), "%s %s %s %s", c1, c2, c3, c4); 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(); +}