~alinuxninja/nginx-edge/trunk

« back to all changes in this revision

Viewing changes to debian/modules/ngx_pagespeed/psol/include/third_party/httpd/src/os/win32/os.h

  • Committer: Vivian
  • Date: 2015-12-04 18:20:11 UTC
  • Revision ID: git-v1:a36f2bc32e884f7473b3a47040e5411306144d7d
* Do not extract psol.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Licensed to the Apache Software Foundation (ASF) under one or more
2
 
 * contributor license agreements.  See the NOTICE file distributed with
3
 
 * this work for additional information regarding copyright ownership.
4
 
 * The ASF licenses this file to You under the Apache License, Version 2.0
5
 
 * (the "License"); you may not use this file except in compliance with
6
 
 * the License.  You may obtain a copy of the License at
7
 
 *
8
 
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 
 *
10
 
 * Unless required by applicable law or agreed to in writing, software
11
 
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 
 * See the License for the specific language governing permissions and
14
 
 * limitations under the License.
15
 
 */
16
 
 
17
 
/**
18
 
 * @file win32/os.h
19
 
 * @brief This file in included in all Apache source code. It contains definitions
20
 
 * of facilities available on _this_ operating system (HAVE_* macros),
21
 
 * and prototypes of OS specific functions defined in os.c or os-inline.c
22
 
 * 
23
 
 * @defgroup APACHE_OS_WIN32 win32
24
 
 * @ingroup  APACHE_OS
25
 
 * @{
26
 
 */
27
 
 
28
 
#ifdef WIN32
29
 
 
30
 
#ifndef AP_OS_H
31
 
#define AP_OS_H
32
 
/* Delegate windows include to the apr.h header, if USER or GDI declarations
33
 
 * are required (for a window rather than console application), include
34
 
 * windows.h prior to any other Apache header files.
35
 
 */
36
 
#include "apr_pools.h"
37
 
 
38
 
#include <io.h>
39
 
#include <fcntl.h>
40
 
 
41
 
#define PLATFORM "Win32"
42
 
 
43
 
/* going away shortly... */
44
 
#define HAVE_DRIVE_LETTERS
45
 
#define HAVE_UNC_PATHS
46
 
#define CASE_BLIND_FILESYSTEM
47
 
 
48
 
#define APACHE_MPM_DIR  "server/mpm/winnt" /* generated on unix */
49
 
 
50
 
#include <stddef.h>
51
 
 
52
 
#ifdef __cplusplus
53
 
extern "C" {
54
 
#endif
55
 
 
56
 
/* BIG RED WARNING: exit() is mapped to allow us to capture the exit
57
 
 * status.  This header must only be included from modules linked into
58
 
 * the ApacheCore.dll - since it's a horrible behavior to exit() from
59
 
 * any module outside the main() block, and we -will- assume it's a
60
 
 * fatal error.
61
 
 */
62
 
 
63
 
AP_DECLARE_DATA extern int ap_real_exit_code;
64
 
 
65
 
#define exit(status) ((exit)((ap_real_exit_code==2) \
66
 
                                ? (ap_real_exit_code = (status)) \
67
 
                                : ((ap_real_exit_code = 0), (status))))
68
 
 
69
 
#ifdef AP_DECLARE_EXPORT
70
 
 
71
 
/* Defined in util_win32.c and available only to the core module for
72
 
 * win32 MPM design.
73
 
 */
74
 
 
75
 
AP_DECLARE(apr_status_t) ap_os_proc_filepath(char **binpath, apr_pool_t *p);
76
 
 
77
 
typedef enum {
78
 
    AP_DLL_WINBASEAPI = 0,    // kernel32 From WinBase.h
79
 
    AP_DLL_WINADVAPI = 1,     // advapi32 From WinBase.h
80
 
    AP_DLL_WINSOCKAPI = 2,    // mswsock  From WinSock.h
81
 
    AP_DLL_WINSOCK2API = 3,   // ws2_32   From WinSock2.h
82
 
    AP_DLL_defined = 4        // must define as last idx_ + 1
83
 
} ap_dlltoken_e;
84
 
 
85
 
FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char* fnName, int ordinal);
86
 
 
87
 
PSECURITY_ATTRIBUTES GetNullACL();
88
 
void CleanNullACL(void *sa);
89
 
 
90
 
int set_listeners_noninheritable(apr_pool_t *p);
91
 
 
92
 
 
93
 
#define AP_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \
94
 
    typedef rettype (calltype *ap_winapi_fpt_##fn) args; \
95
 
    static ap_winapi_fpt_##fn ap_winapi_pfn_##fn = NULL; \
96
 
    __inline rettype ap_winapi_##fn args \
97
 
    {   if (!ap_winapi_pfn_##fn) \
98
 
            ap_winapi_pfn_##fn = (ap_winapi_fpt_##fn) ap_load_dll_func(lib, #fn, ord); \
99
 
        return (*(ap_winapi_pfn_##fn)) names; }; \
100
 
 
101
 
/* Win2K kernel only */
102
 
AP_DECLARE_LATE_DLL_FUNC(AP_DLL_WINADVAPI, BOOL, WINAPI, ChangeServiceConfig2A, 0, (
103
 
    SC_HANDLE hService, 
104
 
    DWORD dwInfoLevel, 
105
 
    LPVOID lpInfo),
106
 
    (hService, dwInfoLevel, lpInfo));
107
 
#undef ChangeServiceConfig2
108
 
#define ChangeServiceConfig2 ap_winapi_ChangeServiceConfig2A
109
 
 
110
 
/* WinNT kernel only */
111
 
AP_DECLARE_LATE_DLL_FUNC(AP_DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, (
112
 
    IN HANDLE hFile),
113
 
    (hFile));
114
 
#undef CancelIo
115
 
#define CancelIo ap_winapi_CancelIo
116
 
 
117
 
/* Win9x kernel only */
118
 
AP_DECLARE_LATE_DLL_FUNC(AP_DLL_WINBASEAPI, DWORD, WINAPI, RegisterServiceProcess, 0, (
119
 
    DWORD dwProcessId,
120
 
    DWORD dwType),
121
 
    (dwProcessId, dwType));
122
 
#define RegisterServiceProcess ap_winapi_RegisterServiceProcess
123
 
 
124
 
#endif /* def AP_DECLARE_EXPORT */
125
 
 
126
 
#ifdef __cplusplus
127
 
}
128
 
#endif
129
 
 
130
 
#endif  /* ndef AP_OS_H */
131
 
#endif  /* def WIN32 */
132
 
/** @} */