1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/lib/dbm/src/dirent.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,97 @@ 1.4 +#ifndef __DIRENT_H__ 1.5 +#define __DIRENT_H__ 1.6 +/* 1.7 + * @(#)msd_dir.h 1.4 87/11/06 Public Domain. 1.8 + * 1.9 + * A public domain implementation of BSD directory routines for 1.10 + * MS-DOS. Written by Michael Rendell ({uunet,utai}michael@garfield), 1.11 + * August 1897 1.12 + * 1.13 + * Extended by Peter Lim (lim@mullian.oz) to overcome some MS DOS quirks 1.14 + * and returns 2 more pieces of information - file size & attribute. 1.15 + * Plus a little reshuffling of some #define's positions December 1987 1.16 + * 1.17 + * Some modifications by Martin Junius 02-14-89 1.18 + * 1.19 + * AK900712 1.20 + * AK910410 abs_path - make absolute path 1.21 + * 1.22 + */ 1.23 + 1.24 +#ifdef __EMX__ 1.25 +#include <sys/param.h> 1.26 +#else 1.27 +#if defined(__IBMC__) || defined(__IBMCPP__) || defined(XP_W32_MSVC) 1.28 +#include <stdio.h> 1.29 +#ifdef MAXPATHLEN 1.30 + #undef MAXPATHLEN 1.31 +#endif 1.32 +#define MAXPATHLEN (FILENAME_MAX*4) 1.33 +#define MAXNAMLEN FILENAME_MAX 1.34 + 1.35 +#else 1.36 +#include <param.h> 1.37 +#endif 1.38 +#endif 1.39 + 1.40 +#ifdef __cplusplus 1.41 +extern "C" { 1.42 +#endif 1.43 + 1.44 +/* attribute stuff */ 1.45 +#ifndef A_RONLY 1.46 +# define A_RONLY 0x01 1.47 +# define A_HIDDEN 0x02 1.48 +# define A_SYSTEM 0x04 1.49 +# define A_LABEL 0x08 1.50 +# define A_DIR 0x10 1.51 +# define A_ARCHIVE 0x20 1.52 +#endif 1.53 + 1.54 +struct dirent { 1.55 +#if defined(OS2) || defined(WIN32) /* use the layout of EMX to avoid trouble */ 1.56 + int d_ino; /* Dummy */ 1.57 + int d_reclen; /* Dummy, same as d_namlen */ 1.58 + int d_namlen; /* length of name */ 1.59 + char d_name[MAXNAMLEN + 1]; 1.60 + unsigned long d_size; 1.61 + unsigned short d_attribute; /* attributes (see above) */ 1.62 + unsigned short d_time; /* modification time */ 1.63 + unsigned short d_date; /* modification date */ 1.64 +#else 1.65 + char d_name[MAXNAMLEN + 1]; /* garentee null termination */ 1.66 + char d_attribute; /* .. extension .. */ 1.67 + unsigned long d_size; /* .. extension .. */ 1.68 +#endif 1.69 +}; 1.70 + 1.71 +typedef struct _dirdescr DIR; 1.72 +/* the structs do not have to be defined here */ 1.73 + 1.74 +extern DIR *opendir(const char *); 1.75 +extern DIR *openxdir(const char *, unsigned); 1.76 +extern struct dirent *readdir(DIR *); 1.77 +extern void seekdir(DIR *, long); 1.78 +extern long telldir(DIR *); 1.79 +extern void closedir(DIR *); 1.80 +#define rewinddir(dirp) seekdir(dirp, 0L) 1.81 + 1.82 +extern char * abs_path(const char *name, char *buffer, int len); 1.83 + 1.84 +#ifndef S_IFMT 1.85 +#define S_IFMT ( S_IFDIR | S_IFREG ) 1.86 +#endif 1.87 + 1.88 +#ifndef S_ISDIR 1.89 +#define S_ISDIR( m ) (((m) & S_IFMT) == S_IFDIR) 1.90 +#endif 1.91 + 1.92 +#ifndef S_ISREG 1.93 +#define S_ISREG( m ) (((m) & S_IFMT) == S_IFREG) 1.94 +#endif 1.95 + 1.96 +#ifdef __cplusplus 1.97 +} 1.98 +#endif 1.99 + 1.100 +#endif