~ubuntu-branches/ubuntu/trusty/bash/trusty-security

« back to all changes in this revision

Viewing changes to lib/glob/ndir.h

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-03-03 22:52:05 UTC
  • mfrom: (1.3.5) (2.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20140303225205-87ltrt5kspeq0g1b
Tags: 4.3-1ubuntu1
* Merge with Debian; remaining changes:
  - skel.bashrc:
    - Run lesspipe.
    - Enable ls aliases.
    - Set options in ll alias to -alF.
    - Define an alert alias.
    - Enabled colored grep aliases.
  - etc.bash.bashrc:
    - Add sudo hint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* <dir.h> -- definitions for 4.2BSD-compatible directory access.
 
2
   last edit:   09-Jul-1983     D A Gwyn. */
 
3
 
 
4
#if defined (VMS)
 
5
#  if !defined (FAB$C_BID)
 
6
#    include <fab.h>
 
7
#  endif
 
8
#  if !defined (NAM$C_BID)
 
9
#    include <nam.h>
 
10
#  endif
 
11
#  if !defined (RMS$_SUC)
 
12
#    include <rmsdef.h>
 
13
#  endif
 
14
#  include "dir.h"
 
15
#endif /* VMS */
 
16
 
 
17
/* Size of directory block. */
 
18
#define DIRBLKSIZ 512
 
19
 
 
20
/* NOTE:  MAXNAMLEN must be one less than a multiple of 4 */
 
21
 
 
22
#if defined (VMS)
 
23
#  define MAXNAMLEN (DIR$S_NAME + 7)    /* 80 plus room for version #.  */
 
24
#  define MAXFULLSPEC NAM$C_MAXRSS      /* Maximum full spec */
 
25
#else
 
26
#  define MAXNAMLEN 15                  /* Maximum filename length. */
 
27
#endif /* VMS */
 
28
 
 
29
/* Data from readdir (). */
 
30
struct direct {
 
31
  long d_ino;                   /* Inode number of entry. */
 
32
  unsigned short d_reclen;      /* Length of this record. */
 
33
  unsigned short d_namlen;      /* Length of string in d_name. */
 
34
  char d_name[MAXNAMLEN + 1];   /* Name of file. */
 
35
};
 
36
 
 
37
/* Stream data from opendir (). */
 
38
typedef struct {
 
39
  int dd_fd;                    /* File descriptor. */
 
40
  int dd_loc;                   /* Offset in block. */
 
41
  int dd_size;                  /* Amount of valid data. */
 
42
  char  dd_buf[DIRBLKSIZ];      /* Directory block. */
 
43
} DIR;
 
44
 
 
45
extern DIR *opendir ();
 
46
extern struct direct *readdir ();
 
47
extern long telldir ();
 
48
extern void seekdir (), closedir ();
 
49
 
 
50
#define rewinddir(dirp) seekdir (dirp, 0L)