summaryrefslogtreecommitdiffstats
path: root/dirtree.h
blob: 23b0dc3fd0389855e1007ef1f8391ebc73150c50 (plain)
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
/* $Id$ */
/* ----------------------------------------------------------------------- *
 *   
 *   Copyright 2001 H. Peter Anvin - All Rights Reserved
 *
 *   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, Inc., 675 Mass Ave, Cambridge MA 02139,
 *   USA; either version 2 of the License, or (at your option) any later
 *   version; incorporated herein by reference.
 *
 * ----------------------------------------------------------------------- */

/*
 * dirtree.h
 *
 * Directory tree data structure
 */

#ifndef DIRTREE_H
#define DIRTREE_H

#include <sys/stat.h>

struct direntry {
  char *name;			/* Filename */
  char *path;			/* Full path */
  char mangled_name[12];	/* Mangled */
  struct stat st;		/* stat info */
  struct direntry *dir;		/* Directory contents (directory only) */
  unsigned int dirsize;		/* Cardinality of directory */
  struct direntry *parent;	/* Parent directory */
  struct direntry *next;	/* Linked list */
  void *data;			/* If path is null, in-core data here */
  unsigned int attribute;	/* DOS attribute byte */
  unsigned int clusters;	/* Number of clusters allocated */
  unsigned int cluster;		/* Assigned cluster (once we get there) */
  struct direntry *nextbyclust;	/* Next pointer in on-disk order */
};

struct direntry *
make_dir_tree(const char *, int *, struct direntry *parent);

#endif