File: rfile.h

package info (click to toggle)
yafc 1.1.1.dfsg.1-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,248 kB
  • ctags: 1,679
  • sloc: ansic: 19,338; sh: 10,365; makefile: 155; perl: 38; ruby: 33
file content (67 lines) | stat: -rw-r--r-- 1,877 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* $Id: rfile.h,v 1.7 2004/05/20 11:10:52 mhe Exp $
 *
 * rfile.h -- representation of a remote file
 *
 * Yet Another FTP Client
 * Copyright (C) 1998-2001, Martin Hedenfalk <mhe@stacken.kth.se>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version. See COPYING for more details.
 */

#ifndef _rfile_h_included
#define _rfile_h_included

#include "syshdr.h"

typedef struct rfile
{
	char *perm;
	char *owner;
	char *group;
	char *color;
	char *date;         /* date and time as a string */
	time_t mtime;       /* modification time */
	unsigned int nhl;   /* number of hard links */
	char *link;         /* target of link */
	char *path;         /* filename with absolute path */
   unsigned long long int size;
} rfile;

rfile *rfile_create(void);
void rfile_clear(rfile *f);
void rfile_destroy(rfile *f);
rfile *rfile_clone(const rfile *f);

bool risdir(const rfile *f);
bool risdotdir(const rfile *f);
bool risreg(const rfile *f);
bool rispipe(const rfile *f);
bool risexec(const rfile *f);
bool rissock(const rfile *f);
bool rischardev(const rfile *f);
bool risblockdev(const rfile *f);
bool rislink(const rfile *f);

void rfile_fake(rfile *f, const char *path);
int rfile_parse(rfile *f, char *str, const char *dirpath, bool is_mlsd);
void rfile_parse_colors(rfile *f);

int month_number(const char *str);
void rfile_parse_time(rfile *f, const char *m, const char *d, const char *y);

char rfile_classchar(const rfile *f);
mode_t rfile_getmode(const rfile *f);

char *endcolor(void);

mode_t str2mode_t(const char *p);

int rfile_search_filename(rfile *f, const char *filename);
int rfile_search_path(rfile *f, const char *path);

char *time_to_string(time_t t);

#endif