Postpone captive_fs_new() to the process of lufsd(8)
[captive.git] / src / client / lufs / captivefs-misc.c
1 /* $Id$
2  * lufs interface module misc functions for libcaptive
3  * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
4  * 
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; exactly version 2 of June 1991 is required
8  * 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19
20 #include "config.h"
21
22 #include "captivefs-misc.h"     /* self */
23 #include <glib/gmessages.h>
24 #include "captivefs-vfs.h"
25
26 #include <captive/client-vfs.h>
27
28
29 /* module-scope lock for _any_ libcaptive access */
30 G_LOCK_DEFINE(libcaptive);
31
32
33 /* Resolve a link (if the info was not added to the dir cache when 
34  * reading the parent dir)
35  */
36 int captivefs_readlink(struct captivefs_vfs *captivefs_vfs,const char *link,char *buf,int buflen)
37 {
38         g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1);
39         g_return_val_if_fail(link!=NULL,-1);
40         g_return_val_if_fail(buf!=NULL,-1);
41         g_return_val_if_fail(buflen>0,-1);
42
43         if (captivefs_vfs->options.debug_messages)
44                 g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_readlink: link=%s,buflen=%d",link,buflen);
45
46         return -1;      /* unsupported by W32 */
47 }
48
49
50 /* Create a link
51  */
52 int captivefs_link(struct captivefs_vfs *captivefs_vfs,const char *target,const char *lnk)
53 {
54         g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1);
55         g_return_val_if_fail(target!=NULL,-1);
56         g_return_val_if_fail(lnk!=NULL,-1);
57
58         if (captivefs_vfs->options.debug_messages)
59                 g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_link: target=%s,lnk=%s",target,lnk);
60
61         return -1;      /* unsupported by W32 */
62 }
63
64
65 /* Create a symlink
66  */
67 int captivefs_symlink(struct captivefs_vfs *captivefs_vfs,const char *target,const char *link)
68 {
69         g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1);
70         g_return_val_if_fail(target!=NULL,-1);
71         g_return_val_if_fail(link!=NULL,-1);
72
73         if (captivefs_vfs->options.debug_messages)
74                 g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_symlink: target=%s,link=%s",target,link);
75
76         return -1;      /* unsupported by W32 */
77 }