1/*
2 * ====================================================================
3 *    Licensed to the Apache Software Foundation (ASF) under one
4 *    or more contributor license agreements.  See the NOTICE file
5 *    distributed with this work for additional information
6 *    regarding copyright ownership.  The ASF licenses this file
7 *    to you under the Apache License, Version 2.0 (the
8 *    "License"); you may not use this file except in compliance
9 *    with the License.  You may obtain a copy of the License at
10 *
11 *      http://www.apache.org/licenses/LICENSE-2.0
12 *
13 *    Unless required by applicable law or agreed to in writing,
14 *    software distributed under the License is distributed on an
15 *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 *    KIND, either express or implied.  See the License for the
17 *    specific language governing permissions and limitations
18 *    under the License.
19 * ====================================================================
20 *
21 * svn_containers.swg: This is a child file of svn_types.swg, and
22 *   should not be included directly.  This file contains typemaps
23 *   that deal with "container" data types (e.g. apr_hash_t,
24 *   apr_array_header_t, etc.).
25 */
26
27/* =======================================================================
28   %typemap(argout) apr_hash_t **
29*/
30
31#ifdef SWIGPYTHON
32%define %hash_argout_typemap(ParamName, ValueType)
33%typemap(argout) apr_hash_t **ParamName {
34  %append_output(svn_swig_py_convert_hash(*$1,
35                                          $descriptor(ValueType),
36                                          _global_py_pool));
37}
38%enddef
39#endif
40#ifdef SWIGPERL
41%define %hash_argout_typemap(ParamName, ValueType)
42%typemap(argout) apr_hash_t **ParamName {
43  %append_output(svn_swig_pl_convert_hash(*$1, $descriptor(ValueType)));
44}
45%enddef
46#endif
47#ifdef SWIGRUBY
48%define %hash_argout_typemap(ParamName, ValueType)
49%typemap(argout) apr_hash_t **ParamName {
50  %append_output(svn_swig_rb_apr_hash_to_hash_swig_type(*$1,
51                                                        #ValueType));
52}
53%enddef
54#endif
55
56%hash_argout_typemap(dirents, svn_dirent_t *)
57%hash_argout_typemap(locks, svn_lock_t *)
58%hash_argout_typemap(cfg_hash, svn_config_t *)
59
60/* -----------------------------------------------------------------------
61   Output of apr_hash_t * <const char *, svn_string_t *>
62   (commonly used for property name and value pairs)
63*/
64
65#ifdef SWIGPYTHON
66%typemap(argout) apr_hash_t **HASH_SVN_STRING {
67  %append_output(svn_swig_py_prophash_to_dict(*$1));
68}
69%typemap(argout) apr_hash_t **HASH_SVN_STRING_MAYBENULL {
70  %append_output(!*$1 ? Py_None : svn_swig_py_prophash_to_dict(*$1));
71}
72#endif
73#ifdef SWIGPERL
74%typemap(argout) apr_hash_t **HASH_SVN_STRING {
75  %append_output(svn_swig_pl_prophash_to_hash(*$1));
76}
77%typemap(argout) apr_hash_t **HASH_SVN_STRING_MAYBENULL {
78  %append_output(!*$1 ? &PL_sv_undef : svn_swig_pl_prophash_to_hash(*$1));
79}
80#endif
81#ifdef SWIGRUBY
82%typemap(argout) apr_hash_t **HASH_SVN_STRING {
83  %append_output(svn_swig_rb_apr_hash_to_hash_svn_string(*$1));
84}
85%typemap(argout) apr_hash_t **HASH_SVN_STRING_MAYBENULL {
86  %append_output(!*$1 ? Qnil : svn_swig_rb_apr_hash_to_hash_svn_string(*$1));
87}
88#endif
89%apply apr_hash_t **HASH_SVN_STRING {
90  apr_hash_t **props,
91  apr_hash_t **original_props,
92  apr_hash_t **table_p,
93  apr_hash_t **revprops
94};
95%apply apr_hash_t **HASH_SVN_STRING_MAYBENULL {
96  /* svn_config_read_auth_data() */
97  apr_hash_t **hash
98};
99
100
101/* -----------------------------------------------------------------------
102   Output of apr_hash_t * <const char *, const char *>
103*/
104
105#ifdef SWIGRUBY
106%typemap(argout) apr_hash_t **HASH_CSTRING {
107  %append_output(svn_swig_rb_apr_hash_to_hash_string(*$1));
108}
109#endif
110#ifdef SWIGPYTHON
111%typemap(argout) apr_hash_t **HASH_CSTRING {
112  %append_output(svn_swig_py_stringhash_to_dict(*$1));
113}
114#endif
115
116%apply apr_hash_t **HASH_CSTRING {
117  apr_hash_t **type_map,
118  apr_hash_t **externals_old,
119  apr_hash_t **externals_new,
120  apr_hash_t **depths
121};
122
123/* -----------------------------------------------------------------------
124   apr_hash_t **locations
125   svn_repos_trace_node_locations()
126   svn_ra_get_locations()
127*/
128
129#ifdef SWIGPYTHON
130%typemap(argout) apr_hash_t **locations {
131  %append_output(svn_swig_py_locationhash_to_dict(*$1));
132}
133#endif
134#ifdef SWIGRUBY
135%typemap(argout) apr_hash_t **locations
136{
137  %append_output(svn_swig_rb_apr_revnum_key_hash_to_hash_string(*$1));
138}
139#endif
140
141/* -----------------------------------------------------------------------
142   apr_hash_t **externals_old
143   apr_hash_t **externals_new
144   svn_wc_edited_externals()
145*/
146
147#ifdef SWIGRUBY
148%typemap(argout) apr_hash_t **externals_old, apr_hash_t **externals_new {
149  %append_output(svn_swig_rb_apr_hash_to_hash_string(*$1));
150}
151#endif
152
153
154/* =======================================================================
155   %typemap(in) apr_hash_t *
156*/
157
158/* -----------------------------------------------------------------------
159   Input of apr_hash_t * <const char *, svn_string_t *>
160   (commonly used for property name and value pairs)
161*/
162
163#ifdef SWIGPYTHON
164%typemap(in) apr_hash_t *PROPHASH
165  (apr_pool_t *_global_pool = NULL, PyObject *_global_py_pool = NULL)
166{
167  if (_global_pool == NULL)
168  {
169    if (svn_swig_py_get_parent_pool(args, $descriptor(apr_pool_t *),
170                                    &_global_py_pool, &_global_pool))
171      SWIG_fail;
172  }
173
174  $1 = svn_swig_py_prophash_from_dict($input, _global_pool);
175  if (PyErr_Occurred()) {
176    SWIG_fail;
177  }
178}
179
180%typemap(out) apr_hash_t *PROPHASH
181{
182  %append_output(svn_swig_py_prophash_to_dict($1));
183}
184#endif
185
186#ifdef SWIGPYTHON
187%typemap(in) apr_hash_t *changed_paths
188  (apr_pool_t *_global_pool = NULL, PyObject *_global_py_pool = NULL)
189{
190  if (_global_pool == NULL)
191  {
192    if (svn_swig_py_get_parent_pool(args, $descriptor(apr_pool_t *),
193                                    &_global_py_pool, &_global_pool))
194      SWIG_fail;
195  }
196
197  $1 = svn_swig_py_struct_ptr_hash_from_dict($input,
198    $descriptor(svn_log_changed_path_t *), _global_pool);
199  if (PyErr_Occurred()) {
200    SWIG_fail;
201  }
202}
203%typemap(out) apr_hash_t *changed_paths
204{
205  %append_output(svn_swig_py_changed_path_hash_to_dict($1));
206}
207
208%typemap(in) apr_hash_t *changed_paths2
209  (apr_pool_t *_global_pool = NULL, PyObject *_global_py_pool = NULL)
210{
211  if (_global_pool == NULL)
212  {
213    if (svn_swig_py_get_parent_pool(args, $descriptor(apr_pool_t *),
214                                    &_global_py_pool, &_global_pool))
215      SWIG_fail;
216  }
217
218  $1 = svn_swig_py_struct_ptr_hash_from_dict($input,
219    $descriptor(svn_log_changed_path2_t *), _global_pool);
220  if (PyErr_Occurred()) {
221    SWIG_fail;
222  }
223}
224%typemap(out) apr_hash_t *changed_paths2
225{
226  %append_output(svn_swig_py_changed_path2_hash_to_dict($1));
227}
228
229/* apr_hash_t * <const char *, svn_config_t *> */
230%typemap(in) apr_hash_t *config
231  (apr_pool_t *_global_pool = NULL, PyObject *_global_py_pool = NULL)
232{
233  if (_global_pool == NULL)
234  {
235    if (svn_swig_py_get_parent_pool(args, $descriptor(apr_pool_t *),
236                                    &_global_py_pool, &_global_pool))
237      SWIG_fail;
238  }
239
240  $1 = svn_swig_py_struct_ptr_hash_from_dict($input,
241    $descriptor(svn_config_t *), _global_pool);
242  if (PyErr_Occurred())
243    SWIG_fail;
244}
245
246%typemap(out) apr_hash_t *config
247{
248  /* HACK. We don't know which pool the config comes from, and we
249     can't copy it, because svn_config_t is not copyable. So we'll just
250     assume that it's the parent struct's pool. It shouldn't matter
251     anyway, because the only way a non-null config can end up in
252     svn_client_ctx_t is if we assigned it ourselves, in which case the copy
253     that's stored in the Python object will become the result; so this is just
254     a safety net. */
255  apr_pool_t *parent_pool;
256  PyObject *parent_py_pool;
257
258  if (svn_swig_py_get_parent_pool(args, $descriptor(apr_pool_t *),
259                                  &parent_py_pool, &parent_pool))
260    SWIG_fail;
261
262  %append_output(svn_swig_py_convert_hash($1, $descriptor(svn_config_t *),
263    parent_py_pool));
264}
265
266#endif
267
268#ifdef SWIGPERL
269%typemap(in) apr_hash_t *PROPHASH
270  (apr_pool_t *_global_pool = NULL)
271{
272  if (_global_pool == NULL) {
273    _global_pool = svn_swig_pl_make_pool((SV *)NULL);
274    SPAGAIN;
275  }
276  $1 = svn_swig_pl_hash_to_prophash($input, _global_pool);
277}
278%typemap(out) apr_hash_t *PROPHASH
279{
280  %append_output(svn_swig_pl_prophash_to_hash($1));
281}
282
283%typemap(out) apr_hash_t *changed_paths2
284{
285  %append_output(
286    ($1) ? svn_swig_pl_convert_hash($1, $descriptor(svn_log_changed_path2_t *))
287         : &PL_sv_undef);
288}
289#endif
290
291#ifdef SWIGRUBY
292%typemap(in) apr_hash_t *PROPHASH
293{
294  VALUE rb_pool = Qnil;
295  if (!_global_pool) {
296    svn_swig_rb_get_pool(argc, argv, self, &rb_pool, &_global_pool);
297    svn_swig_rb_push_pool(rb_pool);
298  }
299  $1 = svn_swig_rb_hash_to_apr_hash_svn_string($input, _global_pool);
300  _global_pool = NULL;
301  if (!NIL_P(rb_pool)) {
302    if (NIL_P($1)) {
303      svn_swig_rb_destroy_pool(rb_pool);
304    } else {
305      svn_swig_rb_set_pool_for_no_swig_type($input, rb_pool);
306    }
307    svn_swig_rb_pop_pool(_global_svn_swig_rb_pool);
308  }
309}
310
311%typemap(out) apr_hash_t *PROPHASH
312{
313  %append_output(svn_swig_rb_apr_hash_to_hash_svn_string($1));
314}
315#endif
316
317%apply apr_hash_t *PROPHASH {
318  apr_hash_t *target_props,
319  apr_hash_t *source_props,
320  apr_hash_t *hash,
321  apr_hash_t *props,
322  apr_hash_t *revprop_table,
323  apr_hash_t *revprops
324};
325
326#ifdef SWIGRUBY
327%typemap(out) apr_hash_t *CHANGED_PATH_HASH
328{
329  VALUE rb_changed_path_hash;
330  rb_changed_path_hash =
331    svn_swig_rb_apr_hash_to_hash_swig_type($1, "svn_log_changed_path_t *");
332  %append_output(rb_changed_path_hash);
333}
334
335%apply apr_hash_t *CHANGED_PATH_HASH {
336  apr_hash_t *changed_paths
337};
338#endif
339
340/* -----------------------------------------------------------------------
341   Input of scripting hash/dictionary (string => string)
342   converted to apr_hash_t (const char * => const char *)
343*/
344#ifdef SWIGPYTHON
345%typemap(in) apr_hash_t *HASH_CSTRING {
346  $1 = svn_swig_py_stringhash_from_dict($input, _global_pool);
347}
348%typemap(in) apr_hash_t *HASH_CSTRING_MAYBENULL {
349  /* PYTHON-FIXME: Handle None -> NULL. */
350  $1 = svn_swig_py_stringhash_from_dict($input, _global_pool);
351}
352#endif
353#ifdef SWIGPERL
354%typemap(in) apr_hash_t *HASH_CSTRING {
355  $1 = svn_swig_pl_strings_to_hash($input, _global_pool);
356}
357%typemap(in) apr_hash_t *HASH_CSTRING_MAYBENULL {
358  /* PERL-FIXME: Handle undef -> NULL. */
359  $1 = svn_swig_pl_strings_to_hash($input, _global_pool);
360}
361#endif
362#ifdef SWIGRUBY
363%typemap(in) apr_hash_t *HASH_CSTRING {
364  $1 = svn_swig_rb_hash_to_apr_hash_string($input, _global_pool);
365}
366%typemap(in) apr_hash_t *HASH_CSTRING_MAYBENULL {
367  VALUE rb_pool = Qnil;
368  if (!_global_pool) {
369    svn_swig_rb_get_pool(argc, argv, self, &rb_pool, &_global_pool);
370    svn_swig_rb_push_pool(rb_pool);
371  }
372  $1 = (NIL_P($input)) ? NULL :
373    svn_swig_rb_hash_to_apr_hash_string($input, _global_pool);
374  _global_pool = NULL;
375  if (!NIL_P(rb_pool)) {
376    if (NIL_P($1)) {
377      svn_swig_rb_destroy_pool(rb_pool);
378    } else {
379      svn_swig_rb_set_pool_for_no_swig_type($input, rb_pool);
380    }
381    svn_swig_rb_pop_pool(_global_svn_swig_rb_pool);
382  }
383}
384
385%typemap(out) apr_hash_t *HASH_CSTRING_MAYBENULL {
386  $result = $1 ? svn_swig_rb_apr_hash_to_hash_string($1) : Qnil;
387}
388#endif
389
390%apply apr_hash_t *HASH_CSTRING {
391  apr_hash_t *path_tokens
392};
393%apply apr_hash_t *HASH_CSTRING_MAYBENULL {
394  apr_hash_t *fs_config,
395  apr_hash_t *lock_tokens
396};
397
398/* -----------------------------------------------------------------------
399   handle config and fs_config in svn_{fs,repos}_create
400*/
401
402#ifdef SWIGPERL
403%typemap(in) apr_hash_t *config {
404    $1 = svn_swig_pl_objs_to_hash_by_name ($input, "svn_config_t *",
405                                           _global_pool);
406}
407#endif
408#ifdef SWIGRUBY
409%typemap(in) apr_hash_t *config
410{
411  if (NIL_P($input)) {
412    $1 = NULL;
413  } else {
414    $1 = svn_swig_rb_hash_to_apr_hash_swig_type($input, "svn_config_t *", _global_pool);
415  }
416}
417#endif
418
419#ifdef SWIGRUBY
420%typemap(in) apr_hash_t *path_revs
421{
422  $1 = svn_swig_rb_hash_to_apr_hash_revnum($input, _global_pool);
423}
424#endif
425
426#ifdef SWIGPYTHON
427%typemap(in) apr_hash_t *path_revs
428{
429  $1 = svn_swig_py_path_revs_hash_from_dict($input, _global_pool);
430}
431%typemap(in) apr_hash_t *unlock_targets
432{
433  $1 = svn_swig_py_stringhash_from_dict($input, _global_pool);
434}
435%typemap(in) apr_hash_t *lock_targets
436  (apr_pool_t *_global_pool, PyObject *_global_pool = NULL)
437{
438  if (_global_pool == NULL)
439  {
440    if (svn_swig_py_get_parent_pool(args, $descriptor(apr_pool_t *),
441                                    &_global_py_pool, &_global_pool))
442      SWIG_fail;
443  }
444  $1 = svn_swig_py_struct_ptr_hash_from_dict($input,
445     $descriptor(svn_fs_lock_target_t *), _global_pool);
446  if (PyErr_Occurred()) {
447    SWIG_fail;
448  }
449}
450#endif
451
452#ifdef SWIGPERL
453%typemap(in) apr_hash_t *path_revs
454{
455  $1 = svn_swig_pl_objs_to_hash_of_revnum_t($input, _global_pool);
456}
457#endif
458
459/* =======================================================================
460   %typemap(argout) apr_array_header_t **
461*/
462
463/* -----------------------------------------------------------------------
464   Output of apr_array_header_t * <svn_prop_inherited_item_t *>
465*/
466#ifdef SWIGPYTHON
467%typemap(argout) apr_array_header_t **OUTPUT_OF_PROP_INHERITED_ITEM {
468  %append_output(svn_swig_py_propinheriteditemarray_to_dict(*$1));
469}
470
471%apply apr_array_header_t **OUTPUT_OF_PROP_INHERITED_ITEM {
472  apr_array_header_t **inherited_props
473};
474#endif
475
476/* -----------------------------------------------------------------------
477   Output of apr_array_header_t * <svn_prop_t *>
478*/
479#ifdef SWIGRUBY
480%typemap(argout) apr_array_header_t **OUTPUT_OF_PROP {
481  %append_output(svn_swig_rb_prop_apr_array_to_hash_prop(*$1));
482}
483
484%apply apr_array_header_t **OUTPUT_OF_PROP {
485  apr_array_header_t **entry_props,
486  apr_array_header_t **wc_props,
487  apr_array_header_t **regular_props,
488  apr_array_header_t **propdiffs
489};
490#endif
491
492#ifdef SWIGPYTHON
493%typemap(argout) apr_array_header_t **OUTPUT_OF_PROP {
494  %append_output(svn_swig_py_proparray_to_dict(*$1));
495}
496
497%apply apr_array_header_t **OUTPUT_OF_PROP {
498  apr_array_header_t **entry_props,
499  apr_array_header_t **wc_props,
500  apr_array_header_t **regular_props,
501  apr_array_header_t **propdiffs
502};
503#endif
504
505/* -----------------------------------------------------------------------
506   Output of apr_array_header_t * <const char *>
507*/
508
509#ifdef SWIGPYTHON
510%typemap(argout) apr_array_header_t **OUTPUT_OF_CONST_CHAR_P {
511  %append_output(svn_swig_py_array_to_list(*$1));
512}
513#endif
514#ifdef SWIGPERL
515%typemap(argout) apr_array_header_t **OUTPUT_OF_CONST_CHAR_P {
516  %append_output(svn_swig_pl_array_to_list(*$1));
517}
518#endif
519#ifdef SWIGRUBY
520%typemap(argout) apr_array_header_t **OUTPUT_OF_CONST_CHAR_P {
521  %append_output(svn_swig_rb_apr_array_to_array_string(*$1));
522}
523#endif
524
525%apply apr_array_header_t **OUTPUT_OF_CONST_CHAR_P {
526  apr_array_header_t **patterns,
527  apr_array_header_t **logfiles,
528  apr_array_header_t **names_p,
529  apr_array_header_t **targets_p,
530  apr_array_header_t **args_p,
531  apr_array_header_t **props_conflicted,
532  apr_array_header_t **possible_moved_to_repos_relpaths,
533  apr_array_header_t **possible_moved_to_abspaths
534};
535
536/* -----------------------------------------------------------------------
537   apr_array_header_t **externals_p
538   svn_wc_parse_externals_description3()
539*/
540
541#ifdef SWIGPYTHON
542%typemap(argout) apr_array_header_t **externals_p {
543  %append_output
544    (svn_swig_py_pointerlist_to_list(*$1, $descriptor(svn_wc_external_item2_t *),
545                                     _global_py_pool));
546  if (PyErr_Occurred()) {
547    SWIG_fail;
548  }
549}
550#endif
551#ifdef SWIGPERL
552%typemap(argout) apr_array_header_t **externals_p {
553  %append_output
554    (svn_swig_pl_convert_array(*$1, $descriptor(svn_wc_external_item2_t *)));
555}
556#endif
557#ifdef SWIGRUBY
558%typemap(argout) apr_array_header_t **externals_p {
559  %append_output(svn_swig_rb_apr_array_to_array_external_item2(*$1));
560}
561#endif
562
563/* svn_client_update3/svn_client_update2 */
564#ifdef SWIGPYTHON
565%typemap(argout) apr_array_header_t **result_revs {
566  %append_output(svn_swig_py_revarray_to_list(*$1));
567  if (PyErr_Occurred()) {
568    SWIG_fail;
569  }
570}
571#endif
572#ifdef SWIGPERL
573%typemap(argout) apr_array_header_t **result_revs {
574  %append_output(svn_swig_pl_revnums_to_list(*$1));
575}
576#endif
577#ifdef SWIGRUBY
578%typemap(argout) apr_array_header_t **result_revs {
579  %append_output(svn_swig_rb_apr_array_to_array_svn_rev(*$1));
580}
581#endif
582
583/* -----------------------------------------------------------------------
584   apr_array_header_t **options
585   For svn_client_conflict_option_t
586*/
587
588#ifdef SWIGPYTHON
589%typemap(argout) apr_array_header_t **options {
590  %append_output
591    (svn_swig_py_pointerlist_to_list(*$1,
592                                     $descriptor(svn_client_conflict_option_t *),
593                                     _global_py_pool));
594  if (PyErr_Occurred()) {
595    SWIG_fail;
596  }
597}
598#endif
599
600/* -----------------------------------------------------------------------
601   apr_array_header_t **versions_p
602   For svn_client__shelf_get_all_versions
603*/
604
605#ifdef SWIGPYTHON
606%typemap(argout) apr_array_header_t **versions_p {
607  %append_output
608    (svn_swig_py_pointerlist_to_list(*$1,
609                                     $descriptor(svn_client__shelf_version_t *),
610                                     _global_py_pool));
611  if (PyErr_Occurred()) {
612    SWIG_fail;
613  }
614}
615#endif
616
617/* =======================================================================
618   %typemap(in) apr_array_header_t *
619*/
620
621/* -----------------------------------------------------------------------
622   apr_array_header_t *location_revisions
623   svn_repos_trace_node_locations()
624   svn_ra_get_locations()
625*/
626
627#ifdef SWIGPYTHON
628%typemap(in) apr_array_header_t *location_revisions {
629    $1 = (apr_array_header_t *) svn_swig_py_seq_to_array($input,
630      sizeof(svn_revnum_t),
631      svn_swig_py_unwrap_revnum,
632      NULL,
633      _global_pool);
634    if (PyErr_Occurred())
635      SWIG_fail;
636}
637#endif
638#ifdef SWIGRUBY
639%typemap(in) apr_array_header_t *location_revisions {
640  $1 = svn_swig_rb_array_to_apr_array_revnum($input, _global_pool);
641}
642#endif
643
644/* -----------------------------------------------------------------------
645   define a general INPUT param of an array of const char * items.
646 */
647
648#ifdef SWIGPYTHON
649%typemap(in) const apr_array_header_t *STRINGLIST {
650    $1 = (apr_array_header_t *) svn_swig_py_seq_to_array($input,
651      sizeof(const char *),
652      svn_swig_py_unwrap_string,
653      NULL,
654      _global_pool);
655    if (PyErr_Occurred())
656      SWIG_fail;
657}
658#endif
659#ifdef SWIGPERL
660%typemap(in) const apr_array_header_t *STRINGLIST {
661    $1 = svn_swig_pl_strings_to_array($input,
662                                                             _global_pool);
663}
664%typemap(in) const apr_array_header_t *STRINGLIST_MAY_BE_NULL {
665    $1 = SvOK($input) ? svn_swig_pl_strings_to_array(
666        $input, _global_pool) : NULL;
667}
668#endif
669#ifdef SWIGRUBY
670%typemap(in) const apr_array_header_t *STRINGLIST {
671  $1 = svn_swig_rb_strings_to_apr_array($input, _global_pool);
672}
673%typemap(in) const apr_array_header_t *STRINGLIST_MAY_BE_NULL {
674  $1 = (NIL_P($input)) ? NULL :
675    svn_swig_rb_strings_to_apr_array($input, _global_pool);
676}
677#endif
678
679/* svn_delta_path_driver() mutates its 'paths' argument (by sorting it),
680   despite the fact that it is notionally an input parameter - hence, the
681   lack of 'const' in that one case.
682
683   svn_wc_get_update_editor3() and svn_wc_get_switch_editor3() aren't changing
684   their 'preserved_exts' argument, but it is forwarded to
685   svn_cstring_match_glob_list which also doesn't modify it, but does not have
686   const in its prototype.  */
687%apply const apr_array_header_t *STRINGLIST {
688  const apr_array_header_t *args,
689  const apr_array_header_t *diff_options,
690  apr_array_header_t *paths,
691  apr_array_header_t *revprops,
692  const apr_array_header_t *targets,
693  apr_array_header_t *preserved_exts
694};
695
696#if defined(SWIGPERL) || defined(SWIGRUBY)
697%apply const apr_array_header_t *STRINGLIST_MAY_BE_NULL {
698  apr_array_header_t *revprops
699};
700#endif
701
702/* -----------------------------------------------------------------------
703   auth provider convertors
704*/
705#ifdef SWIGPERL
706%typemap(in) apr_array_header_t *providers {
707    $1 = svn_swig_pl_objs_to_array($input,
708      $descriptor(svn_auth_provider_object_t *), _global_pool);
709}
710#endif
711
712#ifdef SWIGPYTHON
713%typemap(in) apr_array_header_t *providers {
714    $1 = (apr_array_header_t *) svn_swig_py_seq_to_array($input,
715      sizeof(const svn_auth_provider_object_t *),
716      svn_swig_py_unwrap_struct_ptr,
717      $descriptor(svn_auth_provider_object_t *),
718      _global_pool);
719    if (PyErr_Occurred())
720      SWIG_fail;
721}
722#endif
723
724#ifdef SWIGRUBY
725%typemap(in) apr_array_header_t *providers
726{
727  $1 = svn_swig_rb_array_to_auth_provider_object_apr_array($input, _global_pool);
728}
729#endif
730
731/* -----------------------------------------------------------------------
732   An array of svn_prop_t.
733*/
734
735#ifdef SWIGRUBY
736%typemap(in) apr_array_header_t *ROW_PROP_LIST
737{
738  $1 = svn_swig_rb_to_apr_array_row_prop($input, _global_pool);
739}
740
741%apply apr_array_header_t *ROW_PROP_LIST {
742  apr_array_header_t *proplist
743};
744#endif
745
746/* -----------------------------------------------------------------------
747   An array of svn_prop_t *.
748*/
749
750#ifdef SWIGRUBY
751%typemap(in) apr_array_header_t *PROP_LIST
752{
753  VALUE rb_pool;
754  apr_pool_t *pool;
755
756  svn_swig_rb_get_pool(argc, argv, self, &rb_pool, &pool);
757
758  $1 = svn_swig_rb_to_apr_array_prop($input, pool);
759}
760
761%typemap(out) apr_array_header_t *PROP_LIST
762{
763  %append_output(svn_swig_rb_prop_apr_array_to_hash_prop($1));
764}
765
766%typemap(in) apr_array_header_t *PROP_LIST_MAY_BE_NULL
767{
768  if (NIL_P($input)) {
769    $1 = NULL;
770  } else {
771    VALUE rb_pool;
772    apr_pool_t *pool;
773
774    svn_swig_rb_get_pool(argc, argv, self, &rb_pool, &pool);
775    $1 = svn_swig_rb_to_apr_array_prop($input, pool);
776  }
777}
778
779%typemap(out) apr_array_header_t *PROP_LIST_MAY_BE_NULL
780{
781  %append_output($1 ? svn_swig_rb_prop_apr_array_to_hash_prop($1) : Qnil);
782}
783
784%apply apr_array_header_t *PROP_LIST {
785  apr_array_header_t *wcprop_changes,
786  apr_array_header_t *propchanges
787};
788
789%apply apr_array_header_t *PROP_LIST_MAY_BE_NULL {
790  apr_array_header_t *incoming_prop_changes,
791  apr_array_header_t *outgoing_prop_changes,
792  apr_array_header_t *merge_options
793};
794
795#endif
796
797/* -----------------------------------------------------------------------
798   Input of apr_array_header_t * <svn_merge_range_t *>
799   (that is: svn_rangelist_t *)
800*/
801#ifdef SWIGPYTHON
802%typemap(in) svn_rangelist_t *RANGELIST {
803    $1 = (svn_rangelist_t *) svn_swig_py_seq_to_array($input,
804      sizeof(const svn_merge_range_t *),
805      svn_swig_py_unwrap_struct_ptr,
806      $descriptor(svn_merge_range_t *),
807      _global_pool);
808    if (PyErr_Occurred()) {
809      SWIG_fail;
810    }
811}
812#endif
813
814#ifdef SWIGRUBY
815%typemap(in) svn_rangelist_t *RANGELIST {
816  $1 = svn_swig_rb_array_to_apr_array_merge_range($input, _global_pool);
817}
818#endif
819
820/* -----------------------------------------------------------------------
821   Input of apr_array_header_t * <svn_client_copy_source_t *>
822*/
823#ifdef SWIGRUBY
824%typemap(in) apr_array_header_t *SOURCES {
825  $1 = svn_swig_rb_array_to_apr_array_copy_source($input, _global_pool);
826}
827#endif
828
829/* -----------------------------------------------------------------------
830   Input of apr_array_header_t * <svn_opt_revision_range_t *>
831*/
832#ifdef SWIGPYTHON
833%typemap(in) apr_array_header_t *REVISION_RANGE_LIST {
834    $1 = (apr_array_header_t *) svn_swig_py_seq_to_array($input,
835      sizeof(const svn_opt_revision_range_t *),
836      svn_swig_py_unwrap_struct_ptr,
837      $descriptor(svn_opt_revision_range_t *),
838      _global_pool);
839    if (PyErr_Occurred()) {
840      SWIG_fail;
841    }
842}
843#endif
844
845#ifdef SWIGPERL
846%typemap(in) apr_array_header_t *REVISION_RANGE_LIST {
847  $1 = svn_swig_pl_array_to_apr_array_revision_range($input, _global_pool);
848}
849#endif
850
851#ifdef SWIGRUBY
852%typemap(in) apr_array_header_t *REVISION_RANGE_LIST {
853  $1 = svn_swig_rb_array_to_apr_array_revision_range($input, _global_pool);
854}
855#endif
856
857/* -----------------------------------------------------------------------
858   Input of
859   apr_hash_t * <const char *, apr_array_header_t * <svn_merge_range_t *>>
860*/
861#ifdef SWIGPYTHON
862%typemap(in) apr_hash_t *MERGEINFO
863  (apr_pool_t *_global_pool = NULL, PyObject *_global_py_pool = NULL)
864{
865  if (_global_pool == NULL)
866  {
867    if (svn_swig_py_get_parent_pool(args, $descriptor(apr_pool_t *),
868                                    &_global_py_pool, &_global_pool))
869      SWIG_fail;
870  }
871
872  $1 = svn_swig_py_mergeinfo_from_dict($input, _global_pool);
873  if (PyErr_Occurred()) {
874    SWIG_fail;
875  }
876}
877#endif
878
879#ifdef SWIGRUBY
880%typemap(in) apr_hash_t *MERGEINFO {
881  $1 = svn_swig_rb_hash_to_apr_hash_merge_range($input, _global_pool);
882}
883#endif
884
885/* -----------------------------------------------------------------------
886   Output of
887   apr_hash_t * <const char *, apr_array_header_t * <svn_merge_range_t *>>
888*/
889#ifdef SWIGPYTHON
890%typemap(argout) apr_hash_t **MERGEINFO
891{
892  %append_output
893    (svn_swig_py_mergeinfo_to_dict(*$1, $descriptor(svn_merge_range_t *),
894                                    _global_py_pool));
895
896  if (PyErr_Occurred()) {
897    SWIG_fail;
898  }
899}
900
901%typemap(in) apr_hash_t **MERGEINFO_INOUT ($*1_ltype temp)
902{
903  $1 = &temp;
904  *$1 = svn_swig_py_mergeinfo_from_dict($input, _global_pool);
905  if (PyErr_Occurred()) {
906    SWIG_fail;
907  }
908}
909#endif
910
911#ifdef SWIGRUBY
912%typemap(argout) apr_hash_t **MERGEINFO
913{
914  %append_output(svn_swig_rb_apr_hash_to_hash_merge_range(*$1));
915}
916
917%typemap(in) apr_hash_t **MERGEINFO_INOUT ($*1_ltype temp)
918{
919  $1 = &temp;
920  *$1 = svn_swig_rb_hash_to_apr_hash_merge_range($input, _global_pool);
921}
922#endif
923
924#if defined(SWIGPYTHON) || defined(SWIGRUBY)
925%typemap(argout) apr_hash_t **MERGEINFO_INOUT = apr_hash_t **MERGEINFO;
926#endif
927
928/* -----------------------------------------------------------------------
929   Output of
930   apr_hash_t * <const char *,
931                 apr_hash_t * <const char *,
932                               apr_array_header_t * <svn_merge_range_t *>>>
933*/
934#ifdef SWIGRUBY
935%typemap(argout) apr_hash_t **MERGEINFO_CATALOG
936{
937  %append_output(svn_swig_rb_apr_hash_to_hash_merge_range_hash(*$1));
938}
939#endif
940#ifdef SWIGPYTHON
941%typemap(argout) apr_hash_t **MERGEINFO_CATALOG
942{
943  %append_output(svn_swig_py_mergeinfo_catalog_to_dict(*$1,
944                                            $descriptor(svn_merge_range_t *),
945                                            _global_py_pool));
946  if (PyErr_Occurred()) {
947    SWIG_fail;
948  }
949}
950#endif
951
952/* -----------------------------------------------------------------------
953   Output of apr_array_header_t * <svn_merge_range_t *>
954   (that is: svn_rangelist_t *)
955*/
956#ifdef SWIGPYTHON
957%typemap(argout) svn_rangelist_t **RANGELIST {
958  %append_output
959    (svn_swig_py_pointerlist_to_list(*$1, $descriptor(svn_merge_range_t *),
960                                     _global_py_pool));
961  if (PyErr_Occurred()) {
962    SWIG_fail;
963  }
964}
965
966%typemap(in) svn_rangelist_t **RANGELIST_INOUT ($*1_ltype temp)
967{
968  $1 = &temp;
969  *$1 = (svn_rangelist_t *) svn_swig_py_seq_to_array($input,
970    sizeof(const svn_merge_range_t *),
971    svn_swig_py_unwrap_struct_ptr,
972    $descriptor(svn_merge_range_t *),
973    _global_pool);
974
975  if (PyErr_Occurred()) {
976    SWIG_fail;
977  }
978}
979#endif
980
981#ifdef SWIGRUBY
982%typemap(argout) svn_rangelist_t **RANGELIST {
983  %append_output(svn_swig_rb_apr_array_to_array_merge_range(*$1));
984}
985
986%typemap(in) svn_rangelist_t **RANGELIST_INOUT ($*1_ltype temp)
987{
988  $1 = &temp;
989  *$1 = svn_swig_rb_array_to_apr_array_merge_range($input, _global_pool);
990}
991#endif
992
993#if defined(SWIGPYTHON) || defined(SWIGRUBY)
994%typemap(argout) svn_rangelist_t **RANGELIST_INOUT =
995   svn_rangelist_t **RANGELIST;
996#endif
997
998/* -----------------------------------------------------------------------
999   Output of apr_array_header_t * <svn_auth_provider_object_t *>
1000*/
1001#ifdef SWIGPERL
1002%typemap(argout) apr_array_header_t **providers {
1003  %append_output(svn_swig_pl_convert_array(*$1,
1004                    $descriptor(svn_auth_provider_object_t *)));
1005}
1006#endif
1007
1008#ifdef SWIGPYTHON
1009%typemap(argout) apr_array_header_t **providers {
1010  %append_output
1011    (svn_swig_py_pointerlist_to_list(*$1, $descriptor(svn_auth_provider_object_t *),
1012                                     _global_py_pool));
1013  if (PyErr_Occurred()) {
1014    SWIG_fail;
1015  }
1016}
1017#endif
1018
1019#ifdef SWIGRUBY
1020%typemap(argout) apr_array_header_t **providers {
1021  %append_output(svn_swig_rb_apr_array_to_array_auth_provider_object(*$1));
1022}
1023#endif
1024
1025/* -----------------------------------------------------------------------
1026   Output of apr_array_header_t * <svn_diff_hunk_t *>
1027*/
1028#ifdef SWIGPYTHON
1029%typemap(out) apr_array_header_t *hunks {
1030  %append_output(svn_swig_py_pointerlist_to_list($1, $descriptor(svn_diff_hunk_t *),
1031                                                 _global_py_pool));
1032  if (PyErr_Occurred()) {
1033    SWIG_fail;
1034  }
1035}
1036#endif
1037