ra_svn_wrapped_sasl.h revision 362181
1/*
2 * svn_wrapped_sasl.h :  wrapped SASL API
3 *
4 * ====================================================================
5 *    Licensed to the Apache Software Foundation (ASF) under one
6 *    or more contributor license agreements.  See the NOTICE file
7 *    distributed with this work for additional information
8 *    regarding copyright ownership.  The ASF licenses this file
9 *    to you under the Apache License, Version 2.0 (the
10 *    "License"); you may not use this file except in compliance
11 *    with the License.  You may obtain a copy of the License at
12 *
13 *      http://www.apache.org/licenses/LICENSE-2.0
14 *
15 *    Unless required by applicable law or agreed to in writing,
16 *    software distributed under the License is distributed on an
17 *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 *    KIND, either express or implied.  See the License for the
19 *    specific language governing permissions and limitations
20 *    under the License.
21 * ====================================================================
22 */
23
24#ifndef RA_SVN_WRAPPED_SASL_H
25#define RA_SVN_WRAPPED_SASL_H
26
27#include <stddef.h>
28
29#ifdef WIN32
30#  define APR_WANT_IOVEC
31#  include <apr_want.h>
32  /* This prevents sasl.h from redefining iovec,
33     which is always defined by APR on win32. */
34#  define STRUCT_IOVEC_DEFINED
35#  include <sasl.h>
36#else
37#  include <sasl/sasl.h>
38#endif
39
40/* Apple deprecated the SASL API on Mac OS X 10.11, causing a
41   moderately huge number of deprecation warnings to be emitted during
42   compilation. Consequently, we wrap the parts of the SASL API that
43   we use in a set of private functions and disable the deprecation
44   warnings for this header and the implementation file. */
45#ifdef __APPLE__
46#  if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
47#    pragma GCC diagnostic push
48#    pragma GCC diagnostic ignored "-Wdeprecated-declarations"
49#  endif
50#endif /* __APPLE__ */
51
52#ifdef __cplusplus
53extern "C" {
54#endif /* __cplusplus */
55
56void
57svn_sasl__set_mutex(sasl_mutex_alloc_t *, sasl_mutex_lock_t *,
58                    sasl_mutex_unlock_t *, sasl_mutex_free_t *);
59
60void
61svn_sasl__done(void);
62
63void
64svn_sasl__dispose(sasl_conn_t **);
65
66const char *
67svn_sasl__errstring(int, const char *, const char **);
68
69const char *
70svn_sasl__errdetail(sasl_conn_t *);
71
72int
73svn_sasl__getprop(sasl_conn_t *, int, const void **);
74
75int
76svn_sasl__setprop(sasl_conn_t *, int, const void *);
77
78int
79svn_sasl__client_init(const sasl_callback_t *);
80
81int
82svn_sasl__client_new(const char *, const char *, const char *, const char *,
83                     const sasl_callback_t *, unsigned, sasl_conn_t **);
84
85int
86svn_sasl__client_start(sasl_conn_t *, const char *, sasl_interact_t **,
87                       const char **, unsigned *, const char **);
88
89int
90svn_sasl__client_step(sasl_conn_t *, const char *, unsigned,
91                      sasl_interact_t **, const char **, unsigned *);
92
93int
94svn_sasl__server_init(const sasl_callback_t *, const char *);
95
96int
97svn_sasl__server_new(const char *, const char *, const char *,
98                     const char *, const char *, const sasl_callback_t *,
99                     unsigned, sasl_conn_t **);
100
101int
102svn_sasl__listmech(sasl_conn_t *, const char *, const char *, const char *,
103                   const char *, const char **, unsigned *, int *);
104
105int
106svn_sasl__server_start(sasl_conn_t *, const char *, const char *, unsigned,
107                       const char **, unsigned *);
108
109int
110svn_sasl__server_step(sasl_conn_t *, const char *, unsigned,
111                      const char **, unsigned *);
112
113int
114svn_sasl__encode(sasl_conn_t *, const char *, unsigned,
115                 const char **, unsigned *);
116
117int
118svn_sasl__decode(sasl_conn_t *, const char *, unsigned,
119                 const char **, unsigned *);
120
121#ifdef __cplusplus
122}
123#endif /* __cplusplus */
124
125#ifdef __APPLE__
126#  if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
127#    pragma GCC diagnostic pop
128#  endif
129#endif /* __APPLE__ */
130
131#endif /* RA_SVN_WRAPPED_SASL_H */
132