CPPMyth
Library to interoperate with MythTV server
os-types.h
1
#pragma once
2
3
#include <unistd.h>
4
#include <string.h>
5
#include <errno.h>
6
#include <sys/time.h>
7
#include <stdint.h>
8
#include <sys/types.h>
9
#include <sys/stat.h>
10
#ifndef __STDC_FORMAT_MACROS
11
#define __STDC_FORMAT_MACROS
12
#endif
13
#include <inttypes.h>
14
15
typedef
int
net_socket_t;
16
#define INVALID_SOCKET_VALUE (-1)
17
18
typedef
long
LONG;
19
typedef
LONG HRESULT;
20
21
#define _FILE_OFFSET_BITS 64
22
#define FILE_BEGIN SEEK_SET
23
#define FILE_CURRENT SEEK_CUR
24
#define FILE_END SEEK_END
25
26
// Success codes
27
#define S_OK 0L
28
#define S_FALSE 1L
29
#define FAILED(hr) (((HRESULT)(hr)) < 0)
30
#define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0)
31
32
// Error codes
33
#define ERROR_FILENAME_EXCED_RANGE 206L
34
#define ERROR_INVALID_NAME 123L
35
#define E_OUTOFMEMORY 0x8007000EL
36
#define E_FAIL 0x8004005EL
37
38
#if defined(__linux__)
39
#include <limits.h>
40
#define MAX_PATH PATH_MAX
41
#elif defined(__APPLE__) || defined(__FreeBSD__)
42
#include <sys/cdefs.h>
43
#include <sys/syslimits.h>
44
#define MAX_PATH PATH_MAX
45
#else
46
#define MAX_PATH 256
47
#endif
48
49
#if defined(__APPLE__)
50
#include <stdio.h>
/* for fpos_t */
51
#include <sched.h>
52
#include <AvailabilityMacros.h>
53
typedef
int64_t off64_t;
54
typedef
off_t __off_t;
55
typedef
off64_t __off64_t;
56
typedef
fpos_t fpos64_t;
57
#define __stat64 stat
58
#define stat64 stat
59
#define statfs64 statfs
60
#define fstat64 fstat
61
#elif defined(__FreeBSD__)
62
#include <stdio.h>
/* for fpos_t */
63
typedef
int64_t off64_t;
64
typedef
off_t __off_t;
65
typedef
off64_t __off64_t;
66
typedef
fpos_t fpos64_t;
67
#define __stat64 stat
68
#define stat64 stat
69
#define statfs64 statfs
70
#define fstat64 fstat
71
#else
72
#define __stat64 stat64
73
#endif
74
75
#include <string.h>
76
#define strnicmp(X,Y,N) strncasecmp(X,Y,N)
77
78
typedef
unsigned
char
byte;
79
80
/* OS dependent path separator */
81
#ifndef PATH_SEPARATOR_CHAR
82
#define PATH_SEPARATOR_CHAR '/'
83
#define PATH_SEPARATOR_STRING "/"
84
#endif
cppmyth
src
private
os
unix
os-types.h
Generated on Thu Jan 9 2020 15:17:59 for CPPMyth by
1.8.13