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 #ifndef MOD_XML2ENC
18 #define MOD_XML2ENC
19 
20 #define ENCIO_INPUT 0x01
21 #define ENCIO_OUTPUT 0x02
22 #define ENCIO_INPUT_CHECKS 0x04
23 #define ENCIO (ENCIO_INPUT|ENCIO_OUTPUT|ENCIO_INPUT_CHECKS)
24 #define ENCIO_SKIPTO 0x10
25 
26 /* declarations to deal with WIN32 compile-flag-in-source-code crap */
27 #if !defined(WIN32)
28 #define XML2ENC_DECLARE(type)            type
29 #define XML2ENC_DECLARE_NONSTD(type)     type
30 #define XML2ENC_DECLARE_DATA
31 #elif defined(XML2ENC_DECLARE_STATIC)
32 #define XML2ENC_DECLARE(type)            type __stdcall
33 #define XML2ENC_DECLARE_NONSTD(type)     type
34 #define XML2ENC_DECLARE_DATA
35 #elif defined(XML2ENC_DECLARE_EXPORT)
36 #define XML2ENC_DECLARE(type)            __declspec(dllexport) type __stdcall
37 #define XML2ENC_DECLARE_NONSTD(type)     __declspec(dllexport) type
38 #define XML2ENC_DECLARE_DATA             __declspec(dllexport)
39 #else
40 #define XML2ENC_DECLARE(type)            __declspec(dllimport) type __stdcall
41 #define XML2ENC_DECLARE_NONSTD(type)     __declspec(dllimport) type
42 #define XML2ENC_DECLARE_DATA             __declspec(dllimport)
43 #endif
44 
45 APR_DECLARE_OPTIONAL_FN(apr_status_t, xml2enc_charset,
46                         (request_rec* r, xmlCharEncoding* enc,
47                          const char** cenc));
48 
49 APR_DECLARE_OPTIONAL_FN(apr_status_t, xml2enc_filter,
50                         (request_rec* r, const char* enc, unsigned int mode));
51 
52 APR_DECLARE_EXTERNAL_HOOK(xml2enc, XML2ENC, int, preprocess,
53                           (ap_filter_t *f, char** bufp, apr_size_t* bytesp))
54 
55 #endif
56