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
28 #include <apr_pools.h>
29 #include <apr_strings.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"
42 #endif /* __cplusplus */
45 # if _MSC_VER >= 1300 && _INTEGRAL_MAX_BITS >= 64
46 # define strtoll _strtoi64
48 # define strtoll(str, endptr, base) _atoi64(str)
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
);
62 apr_pool_t
*svn_swig_pl_make_pool(SV
*obj
);
64 typedef enum perl_func_invoker
{
67 } perl_func_invoker_t
;
69 svn_error_t
*svn_swig_pl_callback_thunk(perl_func_invoker_t caller_func
,
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
,
80 apr_hash_t
*svn_swig_pl_strings_to_hash(SV
*source
,
82 apr_hash_t
*svn_swig_pl_objs_to_hash(SV
*source
, swig_type_info
*tinfo
,
84 apr_hash_t
*svn_swig_pl_objs_to_hash_by_name(SV
*source
,
87 const apr_array_header_t
*svn_swig_pl_objs_to_array(SV
*source
,
88 swig_type_info
*tinfo
,
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
,
106 /* thunked commit editor callback. */
107 svn_error_t
*svn_swig_pl_thunk_commit_callback(svn_revnum_t new_revision
,
112 /* thunked repos_history callback. */
113 svn_error_t
*svn_swig_pl_thunk_history_func(void *baton
,
115 svn_revnum_t revision
,
118 /* thunked dir_delta authz read function. */
119 svn_error_t
*svn_swig_pl_thunk_authz_func(svn_boolean_t
*allowed
,
126 svn_error_t
*svn_ra_make_callbacks(svn_ra_callbacks_t
**cb
,
131 /* thunked simple_prompt callback function */
132 svn_error_t
*svn_swig_pl_thunk_simple_prompt(svn_auth_cred_simple_t
**cred
,
135 const char *username
,
136 svn_boolean_t may_save
,
139 /* thunked username_prompt callback function */
140 svn_error_t
*svn_swig_pl_thunk_username_prompt(svn_auth_cred_username_t
**cred
,
143 svn_boolean_t may_save
,
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
,
151 apr_uint32_t failures
,
152 const svn_auth_ssl_server_cert_info_t
*cert_info
,
153 svn_boolean_t may_save
,
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
,
161 svn_boolean_t may_save
,
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
,
169 svn_boolean_t may_save
,
172 /* thunked callback for svn_ra_get_wc_prop_func_t */
173 svn_error_t
*thunk_get_wc_prop(void *baton
,
176 const svn_string_t
**value
,
179 /* Thunked version of svn_wc_notify_func_t callback type */
180 void svn_swig_pl_notify_func(void * baton
,
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
*
198 /* Thunked version of svn_client_info_t callback type. */
199 svn_error_t
*svn_swig_pl_info_receiver(void *baton
,
201 const svn_info_t
*info
,
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
,
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
,
214 svn_revnum_t revision
,
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
,
229 void svn_delta_wrap_window_handler(svn_txdelta_window_handler_t
*handler
,
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
);
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
);
249 #endif /* __cplusplus */
251 #endif /* SVN_SWIG_SWIGUTIL_PL_H */