1/* -----------------------------------------------------------------------------
2 * See the LICENSE file for information on copyright, usage and redistribution
3 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
4 *
5 * std_pair.i
6 *
7 * SWIG typemaps for std::pair
8 * ----------------------------------------------------------------------------- */
9
10%include <std_common.i>
11%include <exception.i>
12
13// ------------------------------------------------------------------------
14// std::pair
15//
16// See std_vector.i for the rationale of typemap application
17// ------------------------------------------------------------------------
18
19%{
20#include <utility>
21%}
22
23// exported class
24
25namespace std {
26
27    template<class T, class U> struct pair {
28        %typemap(in) pair<T,U> (std::pair<T,U>* m) {
29            if (gh_pair_p($input)) {
30                T* x;
31                U* y;
32                SCM first, second;
33                first = gh_car($input);
34                second = gh_cdr($input);
35                x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0);
36                y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0);
37                $1 = std::make_pair(*x,*y);
38            } else {
39                $1 = *(($&1_type)
40                       SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
41            }
42        }
43        %typemap(in) const pair<T,U>& (std::pair<T,U> temp,
44                                      std::pair<T,U>* m),
45                     const pair<T,U>* (std::pair<T,U> temp,
46                                      std::pair<T,U>* m) {
47            if (gh_pair_p($input)) {
48                T* x;
49                U* y;
50                SCM first, second;
51                first = gh_car($input);
52                second = gh_cdr($input);
53                x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0);
54                y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0);
55                temp = std::make_pair(*x,*y);
56                $1 = &temp;
57            } else {
58                $1 = ($1_ltype)
59                    SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
60            }
61        }
62        %typemap(out) pair<T,U> {
63            T* x = new T($1.first);
64            U* y = new U($1.second);
65            SCM first = SWIG_NewPointerObj(x,$descriptor(T *), 1);
66            SCM second = SWIG_NewPointerObj(y,$descriptor(U *), 1);
67            $result = gh_cons(first,second);
68        }
69        %typecheck(SWIG_TYPECHECK_PAIR) pair<T,U> {
70            /* native pair? */
71            if (gh_pair_p($input)) {
72                T* x;
73                U* y;
74                SCM first = gh_car($input);
75                SCM second = gh_cdr($input);
76                if (SWIG_ConvertPtr(first,(void**) &x,
77                                    $descriptor(T *), 0) == 0 &&
78                    SWIG_ConvertPtr(second,(void**) &y,
79                                    $descriptor(U *), 0) == 0) {
80                    $1 = 1;
81                } else {
82                    $1 = 0;
83                }
84            } else {
85                /* wrapped pair? */
86                std::pair<T,U >* m;
87                if (SWIG_ConvertPtr($input,(void **) &m,
88                                    $&1_descriptor, 0) == 0)
89                    $1 = 1;
90                else
91                    $1 = 0;
92            }
93        }
94        %typecheck(SWIG_TYPECHECK_PAIR) const pair<T,U>&,
95                                        const pair<T,U>* {
96            /* native pair? */
97            if (gh_pair_p($input)) {
98                T* x;
99                U* y;
100                SCM first = gh_car($input);
101                SCM second = gh_cdr($input);
102                if (SWIG_ConvertPtr(first,(void**) &x,
103                                    $descriptor(T *), 0) == 0 &&
104                    SWIG_ConvertPtr(second,(void**) &y,
105                                    $descriptor(U *), 0) == 0) {
106                    $1 = 1;
107                } else {
108                    $1 = 0;
109                }
110            } else {
111                /* wrapped pair? */
112                std::pair<T,U >* m;
113                if (SWIG_ConvertPtr($input,(void **) &m,
114                                    $1_descriptor, 0) == 0)
115                    $1 = 1;
116                else
117                    $1 = 0;
118            }
119        }
120        pair();
121        pair(T first, U second);
122        pair(const pair& p);
123
124        template <class U1, class U2> pair(const pair<U1, U2> &p);
125
126        T first;
127        U second;
128    };
129
130
131    // specializations for built-ins
132
133    %define specialize_std_pair_on_first(T,CHECK,CONVERT_FROM,CONVERT_TO)
134    template<class U> struct pair<T,U> {
135        %typemap(in) pair<T,U> (std::pair<T,U>* m) {
136            if (gh_pair_p($input)) {
137                U* y;
138                SCM first, second;
139                first = gh_car($input);
140                second = gh_cdr($input);
141                if (!CHECK(first))
142                    SWIG_exception(SWIG_TypeError,
143                                   "map<" #T "," #U "> expected");
144                y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0);
145                $1 = std::make_pair(CONVERT_FROM(first),*y);
146            } else {
147                $1 = *(($&1_type)
148                       SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
149            }
150        }
151        %typemap(in) const pair<T,U>& (std::pair<T,U> temp,
152                                       std::pair<T,U>* m),
153                     const pair<T,U>* (std::pair<T,U> temp,
154                                       std::pair<T,U>* m) {
155            if (gh_pair_p($input)) {
156                U* y;
157                SCM first, second;
158                first = gh_car($input);
159                second = gh_cdr($input);
160                if (!CHECK(first))
161                    SWIG_exception(SWIG_TypeError,
162                                   "map<" #T "," #U "> expected");
163                y = (U*) SWIG_MustGetPtr(second,$descriptor(U *),$argnum, 0);
164                temp = std::make_pair(CONVERT_FROM(first),*y);
165                $1 = &temp;
166            } else {
167                $1 = ($1_ltype)
168                    SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
169            }
170        }
171        %typemap(out) pair<T,U> {
172            U* y = new U($1.second);
173            SCM second = SWIG_NewPointerObj(y,$descriptor(U *), 1);
174            $result = gh_cons(CONVERT_TO($1.first),second);
175        }
176        %typecheck(SWIG_TYPECHECK_PAIR) pair<T,U> {
177            /* native pair? */
178            if (gh_pair_p($input)) {
179                U* y;
180                SCM first = gh_car($input);
181                SCM second = gh_cdr($input);
182                if (CHECK(first) &&
183                    SWIG_ConvertPtr(second,(void**) &y,
184                                    $descriptor(U *), 0) == 0) {
185                    $1 = 1;
186                } else {
187                    $1 = 0;
188                }
189            } else {
190                /* wrapped pair? */
191                std::pair<T,U >* m;
192                if (SWIG_ConvertPtr($input,(void **) &m,
193                                    $&1_descriptor, 0) == 0)
194                    $1 = 1;
195                else
196                    $1 = 0;
197            }
198        }
199        %typecheck(SWIG_TYPECHECK_PAIR) const pair<T,U>&,
200                                        const pair<T,U>* {
201            /* native pair? */
202            if (gh_pair_p($input)) {
203                U* y;
204                SCM first = gh_car($input);
205                SCM second = gh_cdr($input);
206                if (CHECK(first) &&
207                    SWIG_ConvertPtr(second,(void**) &y,
208                                    $descriptor(U *), 0) == 0) {
209                    $1 = 1;
210                } else {
211                    $1 = 0;
212                }
213            } else {
214                /* wrapped pair? */
215                std::pair<T,U >* m;
216                if (SWIG_ConvertPtr($input,(void **) &m,
217                                    $1_descriptor, 0) == 0)
218                    $1 = 1;
219                else
220                    $1 = 0;
221            }
222        }
223        pair();
224        pair(T first, U second);
225        pair(const pair& p);
226
227        template <class U1, class U2> pair(const pair<U1, U2> &p);
228
229        T first;
230        U second;
231    };
232    %enddef
233
234    %define specialize_std_pair_on_second(U,CHECK,CONVERT_FROM,CONVERT_TO)
235    template<class T> struct pair<T,U> {
236        %typemap(in) pair<T,U> (std::pair<T,U>* m) {
237            if (gh_pair_p($input)) {
238                T* x;
239                SCM first, second;
240                first = gh_car($input);
241                second = gh_cdr($input);
242                x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0);
243                if (!CHECK(second))
244                    SWIG_exception(SWIG_TypeError,
245                                   "map<" #T "," #U "> expected");
246                $1 = std::make_pair(*x,CONVERT_FROM(second));
247            } else {
248                $1 = *(($&1_type)
249                       SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
250            }
251        }
252        %typemap(in) const pair<T,U>& (std::pair<T,U> temp,
253                                      std::pair<T,U>* m),
254                     const pair<T,U>* (std::pair<T,U> temp,
255                                      std::pair<T,U>* m) {
256            if (gh_pair_p($input)) {
257                T* x;
258                SCM first, second;
259                first = gh_car($input);
260                second = gh_cdr($input);
261                x = (T*) SWIG_MustGetPtr(first,$descriptor(T *),$argnum, 0);
262                if (!CHECK(second))
263                    SWIG_exception(SWIG_TypeError,
264                                   "map<" #T "," #U "> expected");
265                temp = std::make_pair(*x,CONVERT_FROM(second));
266                $1 = &temp;
267            } else {
268                $1 = ($1_ltype)
269                    SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
270            }
271        }
272        %typemap(out) pair<T,U> {
273            T* x = new T($1.first);
274            SCM first = SWIG_NewPointerObj(x,$descriptor(T *), 1);
275            $result = gh_cons(first,CONVERT_TO($1.second));
276        }
277        %typecheck(SWIG_TYPECHECK_PAIR) pair<T,U> {
278            /* native pair? */
279            if (gh_pair_p($input)) {
280                T* x;
281                SCM first = gh_car($input);
282                SCM second = gh_cdr($input);
283                if (SWIG_ConvertPtr(first,(void**) &x,
284                                    $descriptor(T *), 0) == 0 &&
285                    CHECK(second)) {
286                    $1 = 1;
287                } else {
288                    $1 = 0;
289                }
290            } else {
291                /* wrapped pair? */
292                std::pair<T,U >* m;
293                if (SWIG_ConvertPtr($input,(void **) &m,
294                                    $&1_descriptor, 0) == 0)
295                    $1 = 1;
296                else
297                    $1 = 0;
298            }
299        }
300        %typecheck(SWIG_TYPECHECK_PAIR) const pair<T,U>&,
301                                        const pair<T,U>* {
302            /* native pair? */
303            if (gh_pair_p($input)) {
304                T* x;
305                SCM first = gh_car($input);
306                SCM second = gh_cdr($input);
307                if (SWIG_ConvertPtr(first,(void**) &x,
308                                    $descriptor(T *), 0) == 0 &&
309                    CHECK(second)) {
310                    $1 = 1;
311                } else {
312                    $1 = 0;
313                }
314            } else {
315                /* wrapped pair? */
316                std::pair<T,U >* m;
317                if (SWIG_ConvertPtr($input,(void **) &m,
318                                    $1_descriptor, 0) == 0)
319                    $1 = 1;
320                else
321                    $1 = 0;
322            }
323        }
324        pair();
325        pair(T first, U second);
326        pair(const pair& p);
327
328        template <class U1, class U2> pair(const pair<U1, U2> &p);
329
330        T first;
331        U second;
332    };
333    %enddef
334
335    %define specialize_std_pair_on_both(T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO,
336                                        U,CHECK_U,CONVERT_U_FROM,CONVERT_U_TO)
337    template<> struct pair<T,U> {
338        %typemap(in) pair<T,U> (std::pair<T,U>* m) {
339            if (gh_pair_p($input)) {
340                SCM first, second;
341                first = gh_car($input);
342                second = gh_cdr($input);
343                if (!CHECK_T(first) || !CHECK_U(second))
344                    SWIG_exception(SWIG_TypeError,
345                                   "map<" #T "," #U "> expected");
346                $1 = std::make_pair(CONVERT_T_FROM(first),
347                                    CONVERT_U_FROM(second));
348            } else {
349                $1 = *(($&1_type)
350                       SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
351            }
352        }
353        %typemap(in) const pair<T,U>& (std::pair<T,U> temp,
354                                      std::pair<T,U>* m),
355                     const pair<T,U>* (std::pair<T,U> temp,
356                                      std::pair<T,U>* m) {
357            if (gh_pair_p($input)) {
358                SCM first, second;
359                first = gh_car($input);
360                second = gh_cdr($input);
361                if (!CHECK_T(first) || !CHECK_U(second))
362                    SWIG_exception(SWIG_TypeError,
363                                   "map<" #T "," #U "> expected");
364                temp = std::make_pair(CONVERT_T_FROM(first),
365                                      CONVERT_U_FROM(second));
366                $1 = &temp;
367            } else {
368                $1 = ($1_ltype)
369                    SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
370            }
371        }
372        %typemap(out) pair<T,U> {
373            $result = gh_cons(CONVERT_T_TO($1.first),
374                              CONVERT_U_TO($1.second));
375        }
376        %typecheck(SWIG_TYPECHECK_PAIR) pair<T,U> {
377            /* native pair? */
378            if (gh_pair_p($input)) {
379                SCM first = gh_car($input);
380                SCM second = gh_cdr($input);
381                if (CHECK_T(first) && CHECK_U(second)) {
382                    $1 = 1;
383                } else {
384                    $1 = 0;
385                }
386            } else {
387                /* wrapped pair? */
388                std::pair<T,U >* m;
389                if (SWIG_ConvertPtr($input,(void **) &m,
390                                    $&1_descriptor, 0) == 0)
391                    $1 = 1;
392                else
393                    $1 = 0;
394            }
395        }
396        %typecheck(SWIG_TYPECHECK_PAIR) const pair<T,U>&,
397                                        const pair<T,U>* {
398            /* native pair? */
399            if (gh_pair_p($input)) {
400                SCM first = gh_car($input);
401                SCM second = gh_cdr($input);
402                if (CHECK_T(first) && CHECK_U(second)) {
403                    $1 = 1;
404                } else {
405                    $1 = 0;
406                }
407            } else {
408                /* wrapped pair? */
409                std::pair<T,U >* m;
410                if (SWIG_ConvertPtr($input,(void **) &m,
411                                    $1_descriptor, 0) == 0)
412                    $1 = 1;
413                else
414                    $1 = 0;
415            }
416        }
417        pair();
418        pair(T first, U second);
419        pair(const pair& p);
420
421        template <class U1, class U2> pair(const pair<U1, U2> &p);
422
423        T first;
424        U second;
425    };
426    %enddef
427
428
429    specialize_std_pair_on_first(bool,gh_boolean_p,
430                              gh_scm2bool,SWIG_bool2scm);
431    specialize_std_pair_on_first(int,gh_number_p,
432                              gh_scm2long,gh_long2scm);
433    specialize_std_pair_on_first(short,gh_number_p,
434                              gh_scm2long,gh_long2scm);
435    specialize_std_pair_on_first(long,gh_number_p,
436                              gh_scm2long,gh_long2scm);
437    specialize_std_pair_on_first(unsigned int,gh_number_p,
438                              gh_scm2ulong,gh_ulong2scm);
439    specialize_std_pair_on_first(unsigned short,gh_number_p,
440                              gh_scm2ulong,gh_ulong2scm);
441    specialize_std_pair_on_first(unsigned long,gh_number_p,
442                              gh_scm2ulong,gh_ulong2scm);
443    specialize_std_pair_on_first(double,gh_number_p,
444                              gh_scm2double,gh_double2scm);
445    specialize_std_pair_on_first(float,gh_number_p,
446                              gh_scm2double,gh_double2scm);
447    specialize_std_pair_on_first(std::string,gh_string_p,
448                              SWIG_scm2string,SWIG_string2scm);
449
450    specialize_std_pair_on_second(bool,gh_boolean_p,
451                                gh_scm2bool,SWIG_bool2scm);
452    specialize_std_pair_on_second(int,gh_number_p,
453                                gh_scm2long,gh_long2scm);
454    specialize_std_pair_on_second(short,gh_number_p,
455                                gh_scm2long,gh_long2scm);
456    specialize_std_pair_on_second(long,gh_number_p,
457                                gh_scm2long,gh_long2scm);
458    specialize_std_pair_on_second(unsigned int,gh_number_p,
459                                gh_scm2ulong,gh_ulong2scm);
460    specialize_std_pair_on_second(unsigned short,gh_number_p,
461                                gh_scm2ulong,gh_ulong2scm);
462    specialize_std_pair_on_second(unsigned long,gh_number_p,
463                                gh_scm2ulong,gh_ulong2scm);
464    specialize_std_pair_on_second(double,gh_number_p,
465                                gh_scm2double,gh_double2scm);
466    specialize_std_pair_on_second(float,gh_number_p,
467                                gh_scm2double,gh_double2scm);
468    specialize_std_pair_on_second(std::string,gh_string_p,
469                                SWIG_scm2string,SWIG_string2scm);
470
471    specialize_std_pair_on_both(bool,gh_boolean_p,
472                               gh_scm2bool,SWIG_bool2scm,
473                               bool,gh_boolean_p,
474                               gh_scm2bool,SWIG_bool2scm);
475    specialize_std_pair_on_both(bool,gh_boolean_p,
476                               gh_scm2bool,SWIG_bool2scm,
477                               int,gh_number_p,
478                               gh_scm2long,gh_long2scm);
479    specialize_std_pair_on_both(bool,gh_boolean_p,
480                               gh_scm2bool,SWIG_bool2scm,
481                               short,gh_number_p,
482                               gh_scm2long,gh_long2scm);
483    specialize_std_pair_on_both(bool,gh_boolean_p,
484                               gh_scm2bool,SWIG_bool2scm,
485                               long,gh_number_p,
486                               gh_scm2long,gh_long2scm);
487    specialize_std_pair_on_both(bool,gh_boolean_p,
488                               gh_scm2bool,SWIG_bool2scm,
489                               unsigned int,gh_number_p,
490                               gh_scm2ulong,gh_ulong2scm);
491    specialize_std_pair_on_both(bool,gh_boolean_p,
492                               gh_scm2bool,SWIG_bool2scm,
493                               unsigned short,gh_number_p,
494                               gh_scm2ulong,gh_ulong2scm);
495    specialize_std_pair_on_both(bool,gh_boolean_p,
496                               gh_scm2bool,SWIG_bool2scm,
497                               unsigned long,gh_number_p,
498                               gh_scm2ulong,gh_ulong2scm);
499    specialize_std_pair_on_both(bool,gh_boolean_p,
500                               gh_scm2bool,SWIG_bool2scm,
501                               double,gh_number_p,
502                               gh_scm2double,gh_double2scm);
503    specialize_std_pair_on_both(bool,gh_boolean_p,
504                               gh_scm2bool,SWIG_bool2scm,
505                               float,gh_number_p,
506                               gh_scm2double,gh_double2scm);
507    specialize_std_pair_on_both(bool,gh_boolean_p,
508                               gh_scm2bool,SWIG_bool2scm,
509                               std::string,gh_string_p,
510                               SWIG_scm2string,SWIG_string2scm);
511    specialize_std_pair_on_both(int,gh_number_p,
512                               gh_scm2long,gh_long2scm,
513                               bool,gh_boolean_p,
514                               gh_scm2bool,SWIG_bool2scm);
515    specialize_std_pair_on_both(int,gh_number_p,
516                               gh_scm2long,gh_long2scm,
517                               int,gh_number_p,
518                               gh_scm2long,gh_long2scm);
519    specialize_std_pair_on_both(int,gh_number_p,
520                               gh_scm2long,gh_long2scm,
521                               short,gh_number_p,
522                               gh_scm2long,gh_long2scm);
523    specialize_std_pair_on_both(int,gh_number_p,
524                               gh_scm2long,gh_long2scm,
525                               long,gh_number_p,
526                               gh_scm2long,gh_long2scm);
527    specialize_std_pair_on_both(int,gh_number_p,
528                               gh_scm2long,gh_long2scm,
529                               unsigned int,gh_number_p,
530                               gh_scm2ulong,gh_ulong2scm);
531    specialize_std_pair_on_both(int,gh_number_p,
532                               gh_scm2long,gh_long2scm,
533                               unsigned short,gh_number_p,
534                               gh_scm2ulong,gh_ulong2scm);
535    specialize_std_pair_on_both(int,gh_number_p,
536                               gh_scm2long,gh_long2scm,
537                               unsigned long,gh_number_p,
538                               gh_scm2ulong,gh_ulong2scm);
539    specialize_std_pair_on_both(int,gh_number_p,
540                               gh_scm2long,gh_long2scm,
541                               double,gh_number_p,
542                               gh_scm2double,gh_double2scm);
543    specialize_std_pair_on_both(int,gh_number_p,
544                               gh_scm2long,gh_long2scm,
545                               float,gh_number_p,
546                               gh_scm2double,gh_double2scm);
547    specialize_std_pair_on_both(int,gh_number_p,
548                               gh_scm2long,gh_long2scm,
549                               std::string,gh_string_p,
550                               SWIG_scm2string,SWIG_string2scm);
551    specialize_std_pair_on_both(short,gh_number_p,
552                               gh_scm2long,gh_long2scm,
553                               bool,gh_boolean_p,
554                               gh_scm2bool,SWIG_bool2scm);
555    specialize_std_pair_on_both(short,gh_number_p,
556                               gh_scm2long,gh_long2scm,
557                               int,gh_number_p,
558                               gh_scm2long,gh_long2scm);
559    specialize_std_pair_on_both(short,gh_number_p,
560                               gh_scm2long,gh_long2scm,
561                               short,gh_number_p,
562                               gh_scm2long,gh_long2scm);
563    specialize_std_pair_on_both(short,gh_number_p,
564                               gh_scm2long,gh_long2scm,
565                               long,gh_number_p,
566                               gh_scm2long,gh_long2scm);
567    specialize_std_pair_on_both(short,gh_number_p,
568                               gh_scm2long,gh_long2scm,
569                               unsigned int,gh_number_p,
570                               gh_scm2ulong,gh_ulong2scm);
571    specialize_std_pair_on_both(short,gh_number_p,
572                               gh_scm2long,gh_long2scm,
573                               unsigned short,gh_number_p,
574                               gh_scm2ulong,gh_ulong2scm);
575    specialize_std_pair_on_both(short,gh_number_p,
576                               gh_scm2long,gh_long2scm,
577                               unsigned long,gh_number_p,
578                               gh_scm2ulong,gh_ulong2scm);
579    specialize_std_pair_on_both(short,gh_number_p,
580                               gh_scm2long,gh_long2scm,
581                               double,gh_number_p,
582                               gh_scm2double,gh_double2scm);
583    specialize_std_pair_on_both(short,gh_number_p,
584                               gh_scm2long,gh_long2scm,
585                               float,gh_number_p,
586                               gh_scm2double,gh_double2scm);
587    specialize_std_pair_on_both(short,gh_number_p,
588                               gh_scm2long,gh_long2scm,
589                               std::string,gh_string_p,
590                               SWIG_scm2string,SWIG_string2scm);
591    specialize_std_pair_on_both(long,gh_number_p,
592                               gh_scm2long,gh_long2scm,
593                               bool,gh_boolean_p,
594                               gh_scm2bool,SWIG_bool2scm);
595    specialize_std_pair_on_both(long,gh_number_p,
596                               gh_scm2long,gh_long2scm,
597                               int,gh_number_p,
598                               gh_scm2long,gh_long2scm);
599    specialize_std_pair_on_both(long,gh_number_p,
600                               gh_scm2long,gh_long2scm,
601                               short,gh_number_p,
602                               gh_scm2long,gh_long2scm);
603    specialize_std_pair_on_both(long,gh_number_p,
604                               gh_scm2long,gh_long2scm,
605                               long,gh_number_p,
606                               gh_scm2long,gh_long2scm);
607    specialize_std_pair_on_both(long,gh_number_p,
608                               gh_scm2long,gh_long2scm,
609                               unsigned int,gh_number_p,
610                               gh_scm2ulong,gh_ulong2scm);
611    specialize_std_pair_on_both(long,gh_number_p,
612                               gh_scm2long,gh_long2scm,
613                               unsigned short,gh_number_p,
614                               gh_scm2ulong,gh_ulong2scm);
615    specialize_std_pair_on_both(long,gh_number_p,
616                               gh_scm2long,gh_long2scm,
617                               unsigned long,gh_number_p,
618                               gh_scm2ulong,gh_ulong2scm);
619    specialize_std_pair_on_both(long,gh_number_p,
620                               gh_scm2long,gh_long2scm,
621                               double,gh_number_p,
622                               gh_scm2double,gh_double2scm);
623    specialize_std_pair_on_both(long,gh_number_p,
624                               gh_scm2long,gh_long2scm,
625                               float,gh_number_p,
626                               gh_scm2double,gh_double2scm);
627    specialize_std_pair_on_both(long,gh_number_p,
628                               gh_scm2long,gh_long2scm,
629                               std::string,gh_string_p,
630                               SWIG_scm2string,SWIG_string2scm);
631    specialize_std_pair_on_both(unsigned int,gh_number_p,
632                               gh_scm2ulong,gh_ulong2scm,
633                               bool,gh_boolean_p,
634                               gh_scm2bool,SWIG_bool2scm);
635    specialize_std_pair_on_both(unsigned int,gh_number_p,
636                               gh_scm2ulong,gh_ulong2scm,
637                               int,gh_number_p,
638                               gh_scm2long,gh_long2scm);
639    specialize_std_pair_on_both(unsigned int,gh_number_p,
640                               gh_scm2ulong,gh_ulong2scm,
641                               short,gh_number_p,
642                               gh_scm2long,gh_long2scm);
643    specialize_std_pair_on_both(unsigned int,gh_number_p,
644                               gh_scm2ulong,gh_ulong2scm,
645                               long,gh_number_p,
646                               gh_scm2long,gh_long2scm);
647    specialize_std_pair_on_both(unsigned int,gh_number_p,
648                               gh_scm2ulong,gh_ulong2scm,
649                               unsigned int,gh_number_p,
650                               gh_scm2ulong,gh_ulong2scm);
651    specialize_std_pair_on_both(unsigned int,gh_number_p,
652                               gh_scm2ulong,gh_ulong2scm,
653                               unsigned short,gh_number_p,
654                               gh_scm2ulong,gh_ulong2scm);
655    specialize_std_pair_on_both(unsigned int,gh_number_p,
656                               gh_scm2ulong,gh_ulong2scm,
657                               unsigned long,gh_number_p,
658                               gh_scm2ulong,gh_ulong2scm);
659    specialize_std_pair_on_both(unsigned int,gh_number_p,
660                               gh_scm2ulong,gh_ulong2scm,
661                               double,gh_number_p,
662                               gh_scm2double,gh_double2scm);
663    specialize_std_pair_on_both(unsigned int,gh_number_p,
664                               gh_scm2ulong,gh_ulong2scm,
665                               float,gh_number_p,
666                               gh_scm2double,gh_double2scm);
667    specialize_std_pair_on_both(unsigned int,gh_number_p,
668                               gh_scm2ulong,gh_ulong2scm,
669                               std::string,gh_string_p,
670                               SWIG_scm2string,SWIG_string2scm);
671    specialize_std_pair_on_both(unsigned short,gh_number_p,
672                               gh_scm2ulong,gh_ulong2scm,
673                               bool,gh_boolean_p,
674                               gh_scm2bool,SWIG_bool2scm);
675    specialize_std_pair_on_both(unsigned short,gh_number_p,
676                               gh_scm2ulong,gh_ulong2scm,
677                               int,gh_number_p,
678                               gh_scm2long,gh_long2scm);
679    specialize_std_pair_on_both(unsigned short,gh_number_p,
680                               gh_scm2ulong,gh_ulong2scm,
681                               short,gh_number_p,
682                               gh_scm2long,gh_long2scm);
683    specialize_std_pair_on_both(unsigned short,gh_number_p,
684                               gh_scm2ulong,gh_ulong2scm,
685                               long,gh_number_p,
686                               gh_scm2long,gh_long2scm);
687    specialize_std_pair_on_both(unsigned short,gh_number_p,
688                               gh_scm2ulong,gh_ulong2scm,
689                               unsigned int,gh_number_p,
690                               gh_scm2ulong,gh_ulong2scm);
691    specialize_std_pair_on_both(unsigned short,gh_number_p,
692                               gh_scm2ulong,gh_ulong2scm,
693                               unsigned short,gh_number_p,
694                               gh_scm2ulong,gh_ulong2scm);
695    specialize_std_pair_on_both(unsigned short,gh_number_p,
696                               gh_scm2ulong,gh_ulong2scm,
697                               unsigned long,gh_number_p,
698                               gh_scm2ulong,gh_ulong2scm);
699    specialize_std_pair_on_both(unsigned short,gh_number_p,
700                               gh_scm2ulong,gh_ulong2scm,
701                               double,gh_number_p,
702                               gh_scm2double,gh_double2scm);
703    specialize_std_pair_on_both(unsigned short,gh_number_p,
704                               gh_scm2ulong,gh_ulong2scm,
705                               float,gh_number_p,
706                               gh_scm2double,gh_double2scm);
707    specialize_std_pair_on_both(unsigned short,gh_number_p,
708                               gh_scm2ulong,gh_ulong2scm,
709                               std::string,gh_string_p,
710                               SWIG_scm2string,SWIG_string2scm);
711    specialize_std_pair_on_both(unsigned long,gh_number_p,
712                               gh_scm2ulong,gh_ulong2scm,
713                               bool,gh_boolean_p,
714                               gh_scm2bool,SWIG_bool2scm);
715    specialize_std_pair_on_both(unsigned long,gh_number_p,
716                               gh_scm2ulong,gh_ulong2scm,
717                               int,gh_number_p,
718                               gh_scm2long,gh_long2scm);
719    specialize_std_pair_on_both(unsigned long,gh_number_p,
720                               gh_scm2ulong,gh_ulong2scm,
721                               short,gh_number_p,
722                               gh_scm2long,gh_long2scm);
723    specialize_std_pair_on_both(unsigned long,gh_number_p,
724                               gh_scm2ulong,gh_ulong2scm,
725                               long,gh_number_p,
726                               gh_scm2long,gh_long2scm);
727    specialize_std_pair_on_both(unsigned long,gh_number_p,
728                               gh_scm2ulong,gh_ulong2scm,
729                               unsigned int,gh_number_p,
730                               gh_scm2ulong,gh_ulong2scm);
731    specialize_std_pair_on_both(unsigned long,gh_number_p,
732                               gh_scm2ulong,gh_ulong2scm,
733                               unsigned short,gh_number_p,
734                               gh_scm2ulong,gh_ulong2scm);
735    specialize_std_pair_on_both(unsigned long,gh_number_p,
736                               gh_scm2ulong,gh_ulong2scm,
737                               unsigned long,gh_number_p,
738                               gh_scm2ulong,gh_ulong2scm);
739    specialize_std_pair_on_both(unsigned long,gh_number_p,
740                               gh_scm2ulong,gh_ulong2scm,
741                               double,gh_number_p,
742                               gh_scm2double,gh_double2scm);
743    specialize_std_pair_on_both(unsigned long,gh_number_p,
744                               gh_scm2ulong,gh_ulong2scm,
745                               float,gh_number_p,
746                               gh_scm2double,gh_double2scm);
747    specialize_std_pair_on_both(unsigned long,gh_number_p,
748                               gh_scm2ulong,gh_ulong2scm,
749                               std::string,gh_string_p,
750                               SWIG_scm2string,SWIG_string2scm);
751    specialize_std_pair_on_both(double,gh_number_p,
752                               gh_scm2double,gh_double2scm,
753                               bool,gh_boolean_p,
754                               gh_scm2bool,SWIG_bool2scm);
755    specialize_std_pair_on_both(double,gh_number_p,
756                               gh_scm2double,gh_double2scm,
757                               int,gh_number_p,
758                               gh_scm2long,gh_long2scm);
759    specialize_std_pair_on_both(double,gh_number_p,
760                               gh_scm2double,gh_double2scm,
761                               short,gh_number_p,
762                               gh_scm2long,gh_long2scm);
763    specialize_std_pair_on_both(double,gh_number_p,
764                               gh_scm2double,gh_double2scm,
765                               long,gh_number_p,
766                               gh_scm2long,gh_long2scm);
767    specialize_std_pair_on_both(double,gh_number_p,
768                               gh_scm2double,gh_double2scm,
769                               unsigned int,gh_number_p,
770                               gh_scm2ulong,gh_ulong2scm);
771    specialize_std_pair_on_both(double,gh_number_p,
772                               gh_scm2double,gh_double2scm,
773                               unsigned short,gh_number_p,
774                               gh_scm2ulong,gh_ulong2scm);
775    specialize_std_pair_on_both(double,gh_number_p,
776                               gh_scm2double,gh_double2scm,
777                               unsigned long,gh_number_p,
778                               gh_scm2ulong,gh_ulong2scm);
779    specialize_std_pair_on_both(double,gh_number_p,
780                               gh_scm2double,gh_double2scm,
781                               double,gh_number_p,
782                               gh_scm2double,gh_double2scm);
783    specialize_std_pair_on_both(double,gh_number_p,
784                               gh_scm2double,gh_double2scm,
785                               float,gh_number_p,
786                               gh_scm2double,gh_double2scm);
787    specialize_std_pair_on_both(double,gh_number_p,
788                               gh_scm2double,gh_double2scm,
789                               std::string,gh_string_p,
790                               SWIG_scm2string,SWIG_string2scm);
791    specialize_std_pair_on_both(float,gh_number_p,
792                               gh_scm2double,gh_double2scm,
793                               bool,gh_boolean_p,
794                               gh_scm2bool,SWIG_bool2scm);
795    specialize_std_pair_on_both(float,gh_number_p,
796                               gh_scm2double,gh_double2scm,
797                               int,gh_number_p,
798                               gh_scm2long,gh_long2scm);
799    specialize_std_pair_on_both(float,gh_number_p,
800                               gh_scm2double,gh_double2scm,
801                               short,gh_number_p,
802                               gh_scm2long,gh_long2scm);
803    specialize_std_pair_on_both(float,gh_number_p,
804                               gh_scm2double,gh_double2scm,
805                               long,gh_number_p,
806                               gh_scm2long,gh_long2scm);
807    specialize_std_pair_on_both(float,gh_number_p,
808                               gh_scm2double,gh_double2scm,
809                               unsigned int,gh_number_p,
810                               gh_scm2ulong,gh_ulong2scm);
811    specialize_std_pair_on_both(float,gh_number_p,
812                               gh_scm2double,gh_double2scm,
813                               unsigned short,gh_number_p,
814                               gh_scm2ulong,gh_ulong2scm);
815    specialize_std_pair_on_both(float,gh_number_p,
816                               gh_scm2double,gh_double2scm,
817                               unsigned long,gh_number_p,
818                               gh_scm2ulong,gh_ulong2scm);
819    specialize_std_pair_on_both(float,gh_number_p,
820                               gh_scm2double,gh_double2scm,
821                               double,gh_number_p,
822                               gh_scm2double,gh_double2scm);
823    specialize_std_pair_on_both(float,gh_number_p,
824                               gh_scm2double,gh_double2scm,
825                               float,gh_number_p,
826                               gh_scm2double,gh_double2scm);
827    specialize_std_pair_on_both(float,gh_number_p,
828                               gh_scm2double,gh_double2scm,
829                               std::string,gh_string_p,
830                               SWIG_scm2string,SWIG_string2scm);
831    specialize_std_pair_on_both(std::string,gh_string_p,
832                               SWIG_scm2string,SWIG_string2scm,
833                               bool,gh_boolean_p,
834                               gh_scm2bool,SWIG_bool2scm);
835    specialize_std_pair_on_both(std::string,gh_string_p,
836                               SWIG_scm2string,SWIG_string2scm,
837                               int,gh_number_p,
838                               gh_scm2long,gh_long2scm);
839    specialize_std_pair_on_both(std::string,gh_string_p,
840                               SWIG_scm2string,SWIG_string2scm,
841                               short,gh_number_p,
842                               gh_scm2long,gh_long2scm);
843    specialize_std_pair_on_both(std::string,gh_string_p,
844                               SWIG_scm2string,SWIG_string2scm,
845                               long,gh_number_p,
846                               gh_scm2long,gh_long2scm);
847    specialize_std_pair_on_both(std::string,gh_string_p,
848                               SWIG_scm2string,SWIG_string2scm,
849                               unsigned int,gh_number_p,
850                               gh_scm2ulong,gh_ulong2scm);
851    specialize_std_pair_on_both(std::string,gh_string_p,
852                               SWIG_scm2string,SWIG_string2scm,
853                               unsigned short,gh_number_p,
854                               gh_scm2ulong,gh_ulong2scm);
855    specialize_std_pair_on_both(std::string,gh_string_p,
856                               SWIG_scm2string,SWIG_string2scm,
857                               unsigned long,gh_number_p,
858                               gh_scm2ulong,gh_ulong2scm);
859    specialize_std_pair_on_both(std::string,gh_string_p,
860                               SWIG_scm2string,SWIG_string2scm,
861                               double,gh_number_p,
862                               gh_scm2double,gh_double2scm);
863    specialize_std_pair_on_both(std::string,gh_string_p,
864                               SWIG_scm2string,SWIG_string2scm,
865                               float,gh_number_p,
866                               gh_scm2double,gh_double2scm);
867    specialize_std_pair_on_both(std::string,gh_string_p,
868                               SWIG_scm2string,SWIG_string2scm,
869                               std::string,gh_string_p,
870                               SWIG_scm2string,SWIG_string2scm);
871}
872