2008-04-09 Marco Ciampa <ciampix@libero.it>
[midnight-commander.git] / vfs / README
blobc88df4a9d14be40575eee1dff10dc477b4437d48
1 NOTE: Although vfs has been meant to be implemented as a separate
2 entity redistributable under the LGPL in its current implementation it
3 uses GPLed code from src/. So there are two possibilities if you want
4 to use vfs:
6 1. Distribute your copy of vfs under the GPL. Then you can freely
7 include the GPLed functions from the rest of the mc source code.
9 2. Distribute your copy of vfs under the LGPL. Then you cannot include
10 the functions outside the vfs subdirectory. You must then either
11 rewrite them or work around them in other ways.
13 ========================================================================
15 Hi!
17 I'm midnight commander's vfs layer. Before you start hacking me,
18 please read this file. I'm integral part of midnight commander, but I
19 try to go out and live my life myself as a shared library, too. That
20 means that I should try to use as little functions from midnight as
21 possible (so I'm tiny, nice and people like me), that I should not
22 pollute name space by unnecessary symbols (so I do not crash fellow
23 programs) and that I should have a clean interface between myself and
24 midnight.
26 Because I'm rather close to midnight, try to:
28 * Keep updating ChangeLog file.
30 * Keep the indentation as the rest of the code. Following could help
31 you with your friend emacs:
33 (defun mc-c-mode ()
34         "C mode with adjusted defaults for use with the Midnight commander."
35         (interactive)
36         (c-mode)
37         (c-set-style "K&R")
38         (setq   c-indent-level 4
39                 c-continued-statement-offset 4
40                 c-brace-offset 0
41                 c-argdecl-indent 4
42                 c-label-offset -4
43                 c-brace-imaginary-offset 0
44                 c-continued-brace-offset 0
45                 c-tab-always-indent nil
46                 c-basic-offset 4
47                 tab-width 8
48                 comment-column 60))
50 (setq auto-mode-alist (cons '(".*/mc/.*\\.[ch]$" . mc-c-mode)
51                        auto-mode-alist))
53 And because I'm trying to live life on my own as libvfs.so, try to:
55 * Make sure all exported symbols are defined in vfs.h and begin with
56 'vfs_'.
58 * Do not make any references from midnight into modules like tar. It
59 would probably pollute name space and midnight would depend on concrete
60 configuration of libvfs. mc_setctl() and mc_ctl() are your
61 friends. (And mine too :-).
63                                                          Pavel Machek
64                                                          pavel@ucw.cz
66 PS: If you'd like to use my features in whole operating system, you
67 might want to link me to rpc.nfsd. On
68 http://atrey.karlin.mff.cuni.cz/~pavel/podfuk/podfuk.html you'll find
69 how to do it.
71 PPS: I have a friend, shared library called avfs, which is LD_PRELOAD
72 capable. You can reach her at http://www.inf.bme.hu/~mszeredi/avfs.