security/nss/lib/dbm/include/winfile.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/lib/dbm/include/winfile.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,106 @@
     1.4 +
     1.5 +/* ---------------------------------------------------------------------------
     1.6 +    Stuff to fake unix file I/O on windows boxes
     1.7 +    ------------------------------------------------------------------------*/
     1.8 +
     1.9 +#ifndef WINFILE_H
    1.10 +#define WINFILE_H
    1.11 +
    1.12 +#ifdef _WINDOWS
    1.13 +/* hacked out of <dirent.h> on an SGI */
    1.14 +#if defined(XP_WIN32) || defined(_WIN32)
    1.15 +/* 32-bit stuff here */
    1.16 +#include <windows.h>
    1.17 +#include <stdlib.h>
    1.18 +#ifdef __MINGW32__
    1.19 +#include <sys/types.h>
    1.20 +#include <sys/stat.h>
    1.21 +#else
    1.22 +#include <sys\types.h>
    1.23 +#include <sys\stat.h>
    1.24 +#endif
    1.25 +
    1.26 +typedef struct DIR_Struct {
    1.27 +    void            * directoryPtr;
    1.28 +    WIN32_FIND_DATA   data;
    1.29 +} DIR;
    1.30 +
    1.31 +#define _ST_FSTYPSZ 16
    1.32 +
    1.33 +#if !defined(__BORLANDC__) && !defined(__GNUC__)
    1.34 + typedef unsigned long mode_t;
    1.35 + typedef          long uid_t;
    1.36 + typedef          long gid_t;
    1.37 + typedef          long off_t;
    1.38 + typedef unsigned long nlink_t;
    1.39 +#endif 
    1.40 +
    1.41 +typedef struct timestruc {
    1.42 +    time_t  tv_sec;         /* seconds */
    1.43 +    long    tv_nsec;        /* and nanoseconds */
    1.44 +} timestruc_t;
    1.45 +
    1.46 +
    1.47 +struct dirent {                                 /* data from readdir() */
    1.48 +        ino_t           d_ino;                  /* inode number of entry */
    1.49 +        off_t           d_off;                  /* offset of disk direntory entry */
    1.50 +        unsigned short  d_reclen;               /* length of this record */
    1.51 +        char            d_name[_MAX_FNAME];     /* name of file */
    1.52 +};
    1.53 +
    1.54 +#if !defined(__BORLANDC__) && !defined (__GNUC__)
    1.55 +#define S_ISDIR(s)  ((s) & _S_IFDIR)
    1.56 +#endif
    1.57 +
    1.58 +#else /* _WIN32 */
    1.59 +/* 16-bit windows stuff */
    1.60 +
    1.61 +#include <sys\types.h>
    1.62 +#include <sys\stat.h>
    1.63 +#include <dos.h>
    1.64 +
    1.65 +
    1.66 +
    1.67 +/*	Getting cocky to support multiple file systems */
    1.68 +typedef struct	dirStruct_tag	{
    1.69 +	struct _find_t	file_data;
    1.70 +	char			c_checkdrive;
    1.71 +} dirStruct;
    1.72 +
    1.73 +typedef struct DIR_Struct {
    1.74 +    void            * directoryPtr;
    1.75 +    dirStruct         data;
    1.76 +} DIR;
    1.77 +
    1.78 +#define _ST_FSTYPSZ 16
    1.79 +typedef unsigned long mode_t;
    1.80 +typedef          long uid_t;
    1.81 +typedef          long gid_t;
    1.82 +typedef          long off_t;
    1.83 +typedef unsigned long nlink_t;
    1.84 +
    1.85 +typedef struct timestruc {
    1.86 +    time_t  tv_sec;         /* seconds */
    1.87 +    long    tv_nsec;        /* and nanoseconds */
    1.88 +} timestruc_t;
    1.89 +
    1.90 +struct dirent {                             /* data from readdir() */
    1.91 +        ino_t           d_ino;              /* inode number of entry */
    1.92 +        off_t           d_off;              /* offset of disk direntory entry */
    1.93 +        unsigned short  d_reclen;           /* length of this record */
    1.94 +#ifdef XP_WIN32
    1.95 +        char            d_name[_MAX_FNAME]; /* name of file */
    1.96 +#else
    1.97 +        char            d_name[20]; /* name of file */
    1.98 +#endif
    1.99 +};
   1.100 +
   1.101 +#define S_ISDIR(s)  ((s) & _S_IFDIR)
   1.102 +
   1.103 +#endif /* 16-bit windows */
   1.104 +
   1.105 +#define CONST const
   1.106 +
   1.107 +#endif /* _WINDOWS */
   1.108 +
   1.109 +#endif /* WINFILE_H */

mercurial