~ubuntu-branches/ubuntu/lucid/mc/lucid

« back to all changes in this revision

Viewing changes to vfs/local.c

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Winnertz
  • Date: 2008-09-16 10:38:59 UTC
  • mfrom: (3.1.6 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080916103859-2uwn8w61xk5mbxxq
Tags: 2:4.6.2~git20080311-4
Corrected fix for odt2txt issue (Closes: #492019) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
#include <string.h>
7
7
 
8
8
 
 
9
#include "../src/global.h"
 
10
#include "../src/tty.h"         /* enable/disable interrupt key */
 
11
#include "../src/wtools.h"      /* message() */
 
12
#include "../src/main.h"        /* print_vfs_message */
9
13
#include "utilvfs.h"
10
 
 
11
14
#include "vfs.h"
12
15
#include "local.h"
13
16
 
24
27
    int *local_info;
25
28
    int fd;
26
29
 
 
30
    (void) me;
 
31
 
27
32
    fd = open (file, NO_LINEAR (flags), mode);
28
33
    if (fd == -1)
29
34
        return 0;
70
75
int
71
76
local_errno (struct vfs_class *me)
72
77
{
 
78
    (void) me;
73
79
    return errno;
74
80
}
75
81
 
79
85
    DIR **local_info;
80
86
    DIR *dir;
81
87
 
 
88
    (void) me;
 
89
 
82
90
    dir = opendir (dirname);
83
91
    if (!dir)
84
92
        return 0;
108
116
static int
109
117
local_stat (struct vfs_class *me, const char *path, struct stat *buf)
110
118
{
 
119
    (void) me;
 
120
 
111
121
    return stat (path, buf);
112
122
}
113
123
 
114
124
static int
115
125
local_lstat (struct vfs_class *me, const char *path, struct stat *buf)
116
126
{
 
127
    (void) me;
 
128
 
117
129
#ifndef HAVE_STATLSTAT
118
130
    return lstat (path,buf);
119
131
#else
124
136
int
125
137
local_fstat (void *data, struct stat *buf)
126
138
{
127
 
    return fstat (*((int *) data), buf);    
 
139
    /* FIXME: avoid type cast */
 
140
    return fstat (*((int *) data), buf);
128
141
}
129
142
 
130
143
static int
131
144
local_chmod (struct vfs_class *me, const char *path, int mode)
132
145
{
 
146
    (void) me;
 
147
 
133
148
    return chmod (path, mode);
134
149
}
135
150
 
136
151
static int
137
152
local_chown (struct vfs_class *me, const char *path, int owner, int group)
138
153
{
 
154
    (void) me;
 
155
 
139
156
    return chown (path, owner, group);
140
157
}
141
158
 
142
159
static int
143
160
local_utime (struct vfs_class *me, const char *path, struct utimbuf *times)
144
161
{
 
162
    (void) me;
 
163
 
145
164
    return utime (path, times);
146
165
}
147
166
 
148
167
static int
149
168
local_readlink (struct vfs_class *me, const char *path, char *buf, size_t size)
150
169
{
 
170
    (void) me;
 
171
 
151
172
    return readlink (path, buf, size);
152
173
}
153
174
 
154
175
static int
155
176
local_unlink (struct vfs_class *me, const char *path)
156
177
{
 
178
    (void) me;
 
179
 
157
180
    return unlink (path);
158
181
}
159
182
 
160
183
static int
161
184
local_symlink (struct vfs_class *me, const char *n1, const char *n2)
162
185
{
 
186
    (void) me;
 
187
 
163
188
    return symlink (n1, n2);
164
189
}
165
190
 
188
213
static int
189
214
local_rename (struct vfs_class *me, const char *a, const char *b)
190
215
{
 
216
    (void) me;
 
217
 
191
218
    return rename (a, b);
192
219
}
193
220
 
194
221
static int
195
222
local_chdir (struct vfs_class *me, const char *path)
196
223
{
 
224
    (void) me;
 
225
 
197
226
    return chdir (path);
198
227
}
199
228
 
208
237
static int
209
238
local_mknod (struct vfs_class *me, const char *path, int mode, int dev)
210
239
{
 
240
    (void) me;
 
241
 
211
242
    return mknod (path, mode, dev);
212
243
}
213
244
 
214
245
static int
215
246
local_link (struct vfs_class *me, const char *p1, const char *p2)
216
247
{
 
248
    (void) me;
 
249
 
217
250
    return link (p1, p2);
218
251
}
219
252
 
220
253
static int
221
254
local_mkdir (struct vfs_class *me, const char *path, mode_t mode)
222
255
{
 
256
    (void) me;
 
257
 
223
258
    return mkdir (path, mode);
224
259
}
225
260
 
226
261
static int
227
262
local_rmdir (struct vfs_class *me, const char *path)
228
263
{
 
264
    (void) me;
 
265
 
229
266
    return rmdir (path);
230
267
}
231
268
 
232
269
static char *
233
270
local_getlocalcopy (struct vfs_class *me, const char *path)
234
271
{
 
272
    (void) me;
 
273
 
235
274
    return g_strdup (path);
236
275
}
237
276
 
239
278
local_ungetlocalcopy (struct vfs_class *me, const char *path,
240
279
                      const char *local, int has_changed)
241
280
{
 
281
    (void) me;
 
282
    (void) path;
 
283
    (void) local;
 
284
    (void) has_changed;
 
285
 
242
286
    return 0;
243
287
}
244
288
 
245
 
#ifdef HAVE_MMAP
246
 
caddr_t
247
 
local_mmap (struct vfs_class *me, caddr_t addr, size_t len, int prot, int flags, void *data, off_t offset)
248
 
{
249
 
    int fd = * (int *)data;
250
 
 
251
 
    return mmap (addr, len, prot, flags, fd, offset);
252
 
}
253
 
 
254
 
int
255
 
local_munmap (struct vfs_class *me, caddr_t addr, size_t len, void *data)
256
 
{
257
 
    return munmap (addr, len);
258
 
}
259
 
#endif
260
 
 
261
289
static int
262
290
local_which (struct vfs_class *me, const char *path)
263
291
{
 
292
    (void) me;
 
293
    (void) path;
 
294
 
264
295
    return 0;           /* Every path which other systems do not like is expected to be ours */
265
296
}
266
297
 
296
327
    vfs_local_ops.ungetlocalcopy = local_ungetlocalcopy;
297
328
    vfs_local_ops.mkdir = local_mkdir;
298
329
    vfs_local_ops.rmdir = local_rmdir;
299
 
#ifdef HAVE_MMAP
300
 
    vfs_local_ops.mmap = local_mmap;
301
 
    vfs_local_ops.munmap = local_munmap;
302
 
#endif
303
330
    vfs_register_class (&vfs_local_ops);
304
331
}