File: mktmpdir.h

package info (click to toggle)
libpar-packer-perl 1.063-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,380 kB
  • sloc: perl: 12,859; ansic: 1,486; makefile: 30; sh: 5
file content (91 lines) | stat: -rw-r--r-- 1,651 bytes parent folder | download | duplicates (2)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifdef _MSC_VER
#  if _MSC_VER < 1900
#    define snprintf _snprintf
#  endif
#  if _MSC_VER < 1500
#    define vsnprintf _vsnprintf
#  endif
#  define strncasecmp _strnicmp
#  define strcasecmp _stricmp
#endif

#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#ifdef WIN32
#  include <direct.h>
#  define Direntry_t struct direct
#  include <windows.h>
#else
#  include <dirent.h>
#  define Direntry_t struct dirent
#  include <unistd.h>
#endif

#ifndef W_OK
#define W_OK 0x02
#endif

#ifndef X_OK
#define X_OK 0x04
#endif

#ifndef S_ISDIR
#   define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
#endif

#ifndef S_ISLNK
#   ifdef _S_ISLNK
#       define S_ISLNK(m) _S_ISLNK(m)
#   else
#       ifdef _S_IFLNK
#           define S_ISLNK(m) ((m & S_IFMT) == _S_IFLNK)
#       else
#           ifdef S_IFLNK
#               define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK)
#           else
#               define S_ISLNK(m) (0)
#           endif
#       endif
#   endif
#endif

#ifndef S_ISREG
#define S_ISREG(x) 1
#endif

#ifndef MAXPATHLEN
#define MAXPATHLEN 32767
#endif

#ifdef HAS_LSTAT
#define par_lstat lstat
#else
#define par_lstat stat
#endif

#define _stringify(s) #s
#define stringify(s) _stringify(s)

#if defined(WIN32) || defined(OS2)
static const char *dir_sep = "\\";
static const char *path_sep = ";";
#else
static const char *dir_sep = "/";
static const char *path_sep = ":";
#endif


#ifdef WIN32
#  include <process.h>
#  define my_mkdir(file, mode) _mkdir(file)
#else
#  define my_mkdir(file, mode) mkdir(file,mode)
#endif

#include "utils.c"
#include "usernamefrompwuid.c"