Fix compiler warning due to missing function prototype.
[svn.git] / subversion / bindings / swig / perl / libsvn_swig_perl / swigutil_pl.h
blob5ce1cde987e274a7dc5edc88db2880e5c053d265
1 /*
2 * swigutil_pl.h : utility functions and stuff for the SWIG Perl bindings
4 * ====================================================================
5 * Copyright (c) 2000-2006 CollabNet. All rights reserved.
7 * This software is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at http://subversion.tigris.org/license-1.html.
10 * If newer versions of this license are posted there, you may use a
11 * newer version instead, at your option.
13 * This software consists of voluntary contributions made by many
14 * individuals. For exact contribution history, see the revision
15 * history and logs, available at http://subversion.tigris.org/.
16 * ====================================================================
20 #ifndef SVN_SWIG_SWIGUTIL_PL_H
21 #define SVN_SWIG_SWIGUTIL_PL_H
23 #include <EXTERN.h>
24 #include <perl.h>
25 #include <XSUB.h>
27 #include <apr.h>
28 #include <apr_pools.h>
29 #include <apr_strings.h>
30 #include <apr_hash.h>
31 #include <apr_tables.h>
33 #include "svn_types.h"
34 #include "svn_string.h"
35 #include "svn_delta.h"
36 #include "svn_client.h"
37 #include "svn_repos.h"
38 #include "svn_private_config.h"
40 #ifdef __cplusplus
41 extern "C" {
42 #endif /* __cplusplus */
44 #if defined(_MSC_VER)
45 # if _MSC_VER >= 1300 && _INTEGRAL_MAX_BITS >= 64
46 # define strtoll _strtoi64
47 # else
48 # define strtoll(str, endptr, base) _atoi64(str)
49 # endif
50 #endif
54 #if defined(SVN_AVOID_CIRCULAR_LINKAGE_AT_ALL_COSTS_HACK)
55 typedef apr_pool_t *(*svn_swig_pl_get_current_pool_t)(void);
56 typedef void (*svn_swig_pl_set_current_pool_t)(apr_pool_t *pool);
58 void svn_swig_pl_bind_current_pool_fns(svn_swig_pl_get_current_pool_t get,
59 svn_swig_pl_set_current_pool_t set);
60 #endif
62 apr_pool_t *svn_swig_pl_make_pool(SV *obj);
64 typedef enum perl_func_invoker {
65 CALL_METHOD,
66 CALL_SV
67 } perl_func_invoker_t;
69 svn_error_t *svn_swig_pl_callback_thunk(perl_func_invoker_t caller_func,
70 void *func,
71 SV **result,
72 const char *fmt, ...);
74 SV *svn_swig_pl_prophash_to_hash(apr_hash_t *hash);
75 SV *svn_swig_pl_convert_hash(apr_hash_t *hash, swig_type_info *tinfo);
77 const apr_array_header_t *svn_swig_pl_strings_to_array(SV *source,
78 apr_pool_t *pool);
80 apr_hash_t *svn_swig_pl_strings_to_hash(SV *source,
81 apr_pool_t *pool);
82 apr_hash_t *svn_swig_pl_objs_to_hash(SV *source, swig_type_info *tinfo,
83 apr_pool_t *pool);
84 apr_hash_t *svn_swig_pl_objs_to_hash_by_name(SV *source,
85 const char *typename,
86 apr_pool_t *pool);
87 const apr_array_header_t *svn_swig_pl_objs_to_array(SV *source,
88 swig_type_info *tinfo,
89 apr_pool_t *pool);
91 SV *svn_swig_pl_array_to_list(const apr_array_header_t *array);
92 /* Formerly used by pre-1.0 APIs. Now unused
93 SV *svn_swig_pl_ints_to_list(const apr_array_header_t *array);
95 SV *svn_swig_pl_convert_array(const apr_array_header_t *array,
96 swig_type_info *tinfo);
98 /* thunked log receiver function. */
99 svn_error_t * svn_swig_pl_thunk_log_receiver(void *py_receiver,
100 apr_hash_t *changed_paths,
101 svn_revnum_t rev,
102 const char *author,
103 const char *date,
104 const char *msg,
105 apr_pool_t *pool);
106 /* thunked commit editor callback. */
107 svn_error_t *svn_swig_pl_thunk_commit_callback(svn_revnum_t new_revision,
108 const char *date,
109 const char *author,
110 void *baton);
112 /* thunked repos_history callback. */
113 svn_error_t *svn_swig_pl_thunk_history_func(void *baton,
114 const char *path,
115 svn_revnum_t revision,
116 apr_pool_t *pool);
118 /* thunked dir_delta authz read function. */
119 svn_error_t *svn_swig_pl_thunk_authz_func(svn_boolean_t *allowed,
120 svn_fs_root_t *root,
121 const char *path,
122 void *baton,
123 apr_pool_t *pool);
125 /* ra callbacks. */
126 svn_error_t *svn_ra_make_callbacks(svn_ra_callbacks_t **cb,
127 void **c_baton,
128 SV *perl_callbacks,
129 apr_pool_t *pool);
131 /* thunked simple_prompt callback function */
132 svn_error_t *svn_swig_pl_thunk_simple_prompt(svn_auth_cred_simple_t **cred,
133 void *baton,
134 const char *realm,
135 const char *username,
136 svn_boolean_t may_save,
137 apr_pool_t *pool);
139 /* thunked username_prompt callback function */
140 svn_error_t *svn_swig_pl_thunk_username_prompt(svn_auth_cred_username_t **cred,
141 void *baton,
142 const char *realm,
143 svn_boolean_t may_save,
144 apr_pool_t *pool);
146 /* thunked ssl_server_trust_prompt callback function */
147 svn_error_t *svn_swig_pl_thunk_ssl_server_trust_prompt
148 (svn_auth_cred_ssl_server_trust_t **cred,
149 void *baton,
150 const char *realm,
151 apr_uint32_t failures,
152 const svn_auth_ssl_server_cert_info_t *cert_info,
153 svn_boolean_t may_save,
154 apr_pool_t *pool);
156 /* thunked ssl_client_cert callback function */
157 svn_error_t *svn_swig_pl_thunk_ssl_client_cert_prompt
158 (svn_auth_cred_ssl_client_cert_t **cred,
159 void *baton,
160 const char *realm,
161 svn_boolean_t may_save,
162 apr_pool_t *pool);
164 /* thunked ssl_client_cert_pw callback function */
165 svn_error_t *svn_swig_pl_thunk_ssl_client_cert_pw_prompt
166 (svn_auth_cred_ssl_client_cert_pw_t **cred,
167 void *baton,
168 const char *realm,
169 svn_boolean_t may_save,
170 apr_pool_t *pool);
172 /* thunked callback for svn_ra_get_wc_prop_func_t */
173 svn_error_t *thunk_get_wc_prop(void *baton,
174 const char *relpath,
175 const char *name,
176 const svn_string_t **value,
177 apr_pool_t *pool);
179 /* Thunked version of svn_wc_notify_func_t callback type */
180 void svn_swig_pl_notify_func(void * baton,
181 const char *path,
182 svn_wc_notify_action_t action,
183 svn_node_kind_t kind,
184 const char *mime_type,
185 svn_wc_notify_state_t content_state,
186 svn_wc_notify_state_t prop_state,
187 svn_revnum_t revision);
190 /* Thunked version of svn_client_get_commit_log3_t callback type. */
191 svn_error_t *svn_swig_pl_get_commit_log_func(const char **log_msg,
192 const char **tmp_file,
193 const apr_array_header_t *
194 commit_items,
195 void *baton,
196 apr_pool_t *pool);
198 /* Thunked version of svn_client_info_t callback type. */
199 svn_error_t *svn_swig_pl_info_receiver(void *baton,
200 const char *path,
201 const svn_info_t *info,
202 apr_pool_t *pool);
204 /* Thunked version of svn_wc_cancel_func_t callback type. */
205 svn_error_t *svn_swig_pl_cancel_func(void *cancel_baton);
207 /* Thunked version of svn_wc_status_func_t callback type. */
208 void svn_swig_pl_status_func(void *baton,
209 const char *path,
210 svn_wc_status_t *status);
211 /* Thunked version of svn_client_blame_receiver_t callback type. */
212 svn_error_t *svn_swig_pl_blame_func(void *baton,
213 apr_int64_t line_no,
214 svn_revnum_t revision,
215 const char *author,
216 const char *date,
217 const char *line,
218 apr_pool_t *pool);
220 /* Thunked config enumerator */
221 svn_boolean_t svn_swig_pl_thunk_config_enumerator(const char *name, const char *value, void *baton);
223 /* helper for making the editor */
224 void svn_delta_make_editor(svn_delta_editor_t **editor,
225 void **edit_baton,
226 SV *perl_editor,
227 apr_pool_t *pool);
229 void svn_delta_wrap_window_handler(svn_txdelta_window_handler_t *handler,
230 void **h_baton,
231 SV *callback,
232 apr_pool_t *pool);
234 /* svn_stream_t helpers */
235 svn_error_t *svn_swig_pl_make_stream(svn_stream_t **stream, SV *obj);
236 SV *svn_swig_pl_from_stream(svn_stream_t *stream);
238 /* apr_file_t * */
239 apr_file_t *svn_swig_pl_make_file(SV *file, apr_pool_t *pool);
241 void svn_swig_pl_hold_ref_in_pool(apr_pool_t *pool, SV *sv);
243 /* md5 access class */
244 SV *svn_swig_pl_from_md5(unsigned char *digest);
247 #ifdef __cplusplus
249 #endif /* __cplusplus */
251 #endif /* SVN_SWIG_SWIGUTIL_PL_H */