Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v9 / share / swig / 1.3.26 / guile / std_map.i
CommitLineData
920dae64
AT
1//
2// SWIG typemaps for std::map
3// Luigi Ballabio
4// Jan. 2003
5//
6// Guile implementation
7
8%include <std_common.i>
9
10// ------------------------------------------------------------------------
11// std::map
12//
13// The aim of all that follows would be to integrate std::map with
14// Guile as much as possible, namely, to allow the user to pass and
15// be returned Scheme association lists.
16// const declarations are used to guess the intent of the function being
17// exported; therefore, the following rationale is applied:
18//
19// -- f(std::map<T>), f(const std::map<T>&), f(const std::map<T>*):
20// the parameter being read-only, either a Scheme alist or a
21// previously wrapped std::map<T> can be passed.
22// -- f(std::map<T>&), f(std::map<T>*):
23// the parameter must be modified; therefore, only a wrapped std::map
24// can be passed.
25// -- std::map<T> f():
26// the map is returned by copy; therefore, a Scheme alist
27// is returned which is most easily used in other Scheme functions
28// -- std::map<T>& f(), std::map<T>* f(), const std::map<T>& f(),
29// const std::map<T>* f():
30// the map is returned by reference; therefore, a wrapped std::map
31// is returned
32// ------------------------------------------------------------------------
33
34%{
35#include <map>
36#include <algorithm>
37#include <stdexcept>
38%}
39
40// exported class
41
42namespace std {
43
44 template<class K, class T> class map {
45 %typemap(in) map<K,T> (std::map<K,T>* m) {
46 if (gh_null_p($input)) {
47 $1 = std::map<K,T >();
48 } else if (gh_pair_p($input)) {
49 $1 = std::map<K,T >();
50 SCM alist = $input;
51 while (!gh_null_p(alist)) {
52 K* k;
53 T* x;
54 SCM entry, key, val;
55 entry = gh_car(alist);
56 if (!gh_pair_p(entry))
57 SWIG_exception(SWIG_TypeError,"alist expected");
58 key = gh_car(entry);
59 val = gh_cdr(entry);
60 k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0);
61 if (SWIG_ConvertPtr(val,(void**) &x,
62 $descriptor(T *), 0) != 0) {
63 if (!gh_pair_p(val))
64 SWIG_exception(SWIG_TypeError,"alist expected");
65 val = gh_car(val);
66 x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0);
67 }
68 (($1_type &)$1)[*k] = *x;
69 alist = gh_cdr(alist);
70 }
71 } else {
72 $1 = *(($&1_type)
73 SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
74 }
75 }
76 %typemap(in) const map<K,T>& (std::map<K,T> temp,
77 std::map<K,T>* m),
78 const map<K,T>* (std::map<K,T> temp,
79 std::map<K,T>* m) {
80 if (gh_null_p($input)) {
81 temp = std::map<K,T >();
82 $1 = &temp;
83 } else if (gh_pair_p($input)) {
84 temp = std::map<K,T >();
85 $1 = &temp;
86 SCM alist = $input;
87 while (!gh_null_p(alist)) {
88 K* k;
89 T* x;
90 SCM entry, key, val;
91 entry = gh_car(alist);
92 if (!gh_pair_p(entry))
93 SWIG_exception(SWIG_TypeError,"alist expected");
94 key = gh_car(entry);
95 val = gh_cdr(entry);
96 k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0);
97 if (SWIG_ConvertPtr(val,(void**) &x,
98 $descriptor(T *), 0) != 0) {
99 if (!gh_pair_p(val))
100 SWIG_exception(SWIG_TypeError,"alist expected");
101 val = gh_car(val);
102 x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0);
103 }
104 temp[*k] = *x;
105 alist = gh_cdr(alist);
106 }
107 } else {
108 $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
109 }
110 }
111 %typemap(out) map<K,T> {
112 SCM alist = SCM_EOL;
113 for (std::map<K,T >::reverse_iterator i=$1.rbegin();
114 i!=$1.rend(); ++i) {
115 K* key = new K(i->first);
116 T* val = new T(i->second);
117 SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1);
118 SCM x = SWIG_NewPointerObj(val,$descriptor(T *), 1);
119 SCM entry = gh_cons(k,x);
120 alist = gh_cons(entry,alist);
121 }
122 $result = alist;
123 }
124 %typecheck(SWIG_TYPECHECK_MAP) map<K,T> {
125 /* native sequence? */
126 if (gh_null_p($input)) {
127 /* an empty sequence can be of any type */
128 $1 = 1;
129 } else if (gh_pair_p($input)) {
130 /* check the first element only */
131 K* k;
132 T* x;
133 SCM head = gh_car($input);
134 if (gh_pair_p(head)) {
135 SCM key = gh_car(head);
136 SCM val = gh_cdr(head);
137 if (SWIG_ConvertPtr(key,(void**) &k,
138 $descriptor(K *), 0) != 0) {
139 $1 = 0;
140 } else {
141 if (SWIG_ConvertPtr(val,(void**) &x,
142 $descriptor(T *), 0) == 0) {
143 $1 = 1;
144 } else if (gh_pair_p(val)) {
145 val = gh_car(val);
146 if (SWIG_ConvertPtr(val,(void**) &x,
147 $descriptor(T *), 0) == 0)
148 $1 = 1;
149 else
150 $1 = 0;
151 } else {
152 $1 = 0;
153 }
154 }
155 } else {
156 $1 = 0;
157 }
158 } else {
159 /* wrapped map? */
160 std::map<K,T >* m;
161 if (SWIG_ConvertPtr($input,(void **) &m,
162 $&1_descriptor, 0) == 0)
163 $1 = 1;
164 else
165 $1 = 0;
166 }
167 }
168 %typecheck(SWIG_TYPECHECK_MAP) const map<K,T>&,
169 const map<K,T>* {
170 /* native sequence? */
171 if (gh_null_p($input)) {
172 /* an empty sequence can be of any type */
173 $1 = 1;
174 } else if (gh_pair_p($input)) {
175 /* check the first element only */
176 K* k;
177 T* x;
178 SCM head = gh_car($input);
179 if (gh_pair_p(head)) {
180 SCM key = gh_car(head);
181 SCM val = gh_cdr(head);
182 if (SWIG_ConvertPtr(key,(void**) &k,
183 $descriptor(K *), 0) != 0) {
184 $1 = 0;
185 } else {
186 if (SWIG_ConvertPtr(val,(void**) &x,
187 $descriptor(T *), 0) == 0) {
188 $1 = 1;
189 } else if (gh_pair_p(val)) {
190 val = gh_car(val);
191 if (SWIG_ConvertPtr(val,(void**) &x,
192 $descriptor(T *), 0) == 0)
193 $1 = 1;
194 else
195 $1 = 0;
196 } else {
197 $1 = 0;
198 }
199 }
200 } else {
201 $1 = 0;
202 }
203 } else {
204 /* wrapped map? */
205 std::map<K,T >* m;
206 if (SWIG_ConvertPtr($input,(void **) &m,
207 $1_descriptor, 0) == 0)
208 $1 = 1;
209 else
210 $1 = 0;
211 }
212 }
213 %rename("length") size;
214 %rename("null?") empty;
215 %rename("clear!") clear;
216 %rename("ref") __getitem__;
217 %rename("set!") __setitem__;
218 %rename("delete!") __delitem__;
219 %rename("has-key?") has_key;
220 public:
221 map();
222 map(const map<K,T> &);
223
224 unsigned int size() const;
225 bool empty() const;
226 void clear();
227 %extend {
228 T& __getitem__(const K& key) throw (std::out_of_range) {
229 std::map<K,T >::iterator i = self->find(key);
230 if (i != self->end())
231 return i->second;
232 else
233 throw std::out_of_range("key not found");
234 }
235 void __setitem__(const K& key, const T& x) {
236 (*self)[key] = x;
237 }
238 void __delitem__(const K& key) throw (std::out_of_range) {
239 std::map<K,T >::iterator i = self->find(key);
240 if (i != self->end())
241 self->erase(i);
242 else
243 throw std::out_of_range("key not found");
244 }
245 bool has_key(const K& key) {
246 std::map<K,T >::iterator i = self->find(key);
247 return i != self->end();
248 }
249 SCM keys() {
250 SCM result = SCM_EOL;
251 for (std::map<K,T >::reverse_iterator i=$1.rbegin();
252 i!=$1.rend(); ++i) {
253 K* key = new K(i->first);
254 SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1);
255 result = gh_cons(k,result);
256 }
257 return result;
258 }
259 }
260 };
261
262
263 // specializations for built-ins
264
265 %define specialize_std_map_on_key(K,CHECK,CONVERT_FROM,CONVERT_TO)
266
267 template<class T> class map<K,T> {
268 %typemap(in) map<K,T> (std::map<K,T>* m) {
269 if (gh_null_p($input)) {
270 $1 = std::map<K,T >();
271 } else if (gh_pair_p($input)) {
272 $1 = std::map<K,T >();
273 SCM alist = $input;
274 while (!gh_null_p(alist)) {
275 T* x;
276 SCM entry, key, val;
277 entry = gh_car(alist);
278 if (!gh_pair_p(entry))
279 SWIG_exception(SWIG_TypeError,"alist expected");
280 key = gh_car(entry);
281 val = gh_cdr(entry);
282 if (!CHECK(key))
283 SWIG_exception(SWIG_TypeError,
284 "map<" #K "," #T "> expected");
285 if (SWIG_ConvertPtr(val,(void**) &x,
286 $descriptor(T *), 0) != 0) {
287 if (!gh_pair_p(val))
288 SWIG_exception(SWIG_TypeError,"alist expected");
289 val = gh_car(val);
290 x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0);
291 }
292 (($1_type &)$1)[CONVERT_FROM(key)] = *x;
293 alist = gh_cdr(alist);
294 }
295 } else {
296 $1 = *(($&1_type)
297 SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
298 }
299 }
300 %typemap(in) const map<K,T>& (std::map<K,T> temp,
301 std::map<K,T>* m),
302 const map<K,T>* (std::map<K,T> temp,
303 std::map<K,T>* m) {
304 if (gh_null_p($input)) {
305 temp = std::map<K,T >();
306 $1 = &temp;
307 } else if (gh_pair_p($input)) {
308 temp = std::map<K,T >();
309 $1 = &temp;
310 SCM alist = $input;
311 while (!gh_null_p(alist)) {
312 T* x;
313 SCM entry, key, val;
314 entry = gh_car(alist);
315 if (!gh_pair_p(entry))
316 SWIG_exception(SWIG_TypeError,"alist expected");
317 key = gh_car(entry);
318 val = gh_cdr(entry);
319 if (!CHECK(key))
320 SWIG_exception(SWIG_TypeError,
321 "map<" #K "," #T "> expected");
322 if (SWIG_ConvertPtr(val,(void**) &x,
323 $descriptor(T *), 0) != 0) {
324 if (!gh_pair_p(val))
325 SWIG_exception(SWIG_TypeError,"alist expected");
326 val = gh_car(val);
327 x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0);
328 }
329 temp[CONVERT_FROM(key)] = *x;
330 alist = gh_cdr(alist);
331 }
332 } else {
333 $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
334 }
335 }
336 %typemap(out) map<K,T> {
337 SCM alist = SCM_EOL;
338 for (std::map<K,T >::reverse_iterator i=$1.rbegin();
339 i!=$1.rend(); ++i) {
340 T* val = new T(i->second);
341 SCM k = CONVERT_TO(i->first);
342 SCM x = SWIG_NewPointerObj(val,$descriptor(T *), 1);
343 SCM entry = gh_cons(k,x);
344 alist = gh_cons(entry,alist);
345 }
346 $result = alist;
347 }
348 %typecheck(SWIG_TYPECHECK_MAP) map<K,T> {
349 // native sequence?
350 if (gh_null_p($input)) {
351 /* an empty sequence can be of any type */
352 $1 = 1;
353 } else if (gh_pair_p($input)) {
354 // check the first element only
355 T* x;
356 SCM head = gh_car($input);
357 if (gh_pair_p(head)) {
358 SCM key = gh_car(head);
359 SCM val = gh_cdr(head);
360 if (!CHECK(key)) {
361 $1 = 0;
362 } else {
363 if (SWIG_ConvertPtr(val,(void**) &x,
364 $descriptor(T *), 0) == 0) {
365 $1 = 1;
366 } else if (gh_pair_p(val)) {
367 val = gh_car(val);
368 if (SWIG_ConvertPtr(val,(void**) &x,
369 $descriptor(T *), 0) == 0)
370 $1 = 1;
371 else
372 $1 = 0;
373 } else {
374 $1 = 0;
375 }
376 }
377 } else {
378 $1 = 0;
379 }
380 } else {
381 // wrapped map?
382 std::map<K,T >* m;
383 if (SWIG_ConvertPtr($input,(void **) &m,
384 $&1_descriptor, 0) == 0)
385 $1 = 1;
386 else
387 $1 = 0;
388 }
389 }
390 %typecheck(SWIG_TYPECHECK_MAP) const map<K,T>&,
391 const map<K,T>* {
392 // native sequence?
393 if (gh_null_p($input)) {
394 /* an empty sequence can be of any type */
395 $1 = 1;
396 } else if (gh_pair_p($input)) {
397 // check the first element only
398 T* x;
399 SCM head = gh_car($input);
400 if (gh_pair_p(head)) {
401 SCM key = gh_car(head);
402 SCM val = gh_cdr(head);
403 if (!CHECK(key)) {
404 $1 = 0;
405 } else {
406 if (SWIG_ConvertPtr(val,(void**) &x,
407 $descriptor(T *), 0) == 0) {
408 $1 = 1;
409 } else if (gh_pair_p(val)) {
410 val = gh_car(val);
411 if (SWIG_ConvertPtr(val,(void**) &x,
412 $descriptor(T *), 0) == 0)
413 $1 = 1;
414 else
415 $1 = 0;
416 } else {
417 $1 = 0;
418 }
419 }
420 } else {
421 $1 = 0;
422 }
423 } else {
424 // wrapped map?
425 std::map<K,T >* m;
426 if (SWIG_ConvertPtr($input,(void **) &m,
427 $1_descriptor, 0) == 0)
428 $1 = 1;
429 else
430 $1 = 0;
431 }
432 }
433 %rename("length") size;
434 %rename("null?") empty;
435 %rename("clear!") clear;
436 %rename("ref") __getitem__;
437 %rename("set!") __setitem__;
438 %rename("delete!") __delitem__;
439 %rename("has-key?") has_key;
440 public:
441 map();
442 map(const map<K,T> &);
443
444 unsigned int size() const;
445 bool empty() const;
446 void clear();
447 %extend {
448 T& __getitem__(K key) throw (std::out_of_range) {
449 std::map<K,T >::iterator i = self->find(key);
450 if (i != self->end())
451 return i->second;
452 else
453 throw std::out_of_range("key not found");
454 }
455 void __setitem__(K key, const T& x) {
456 (*self)[key] = x;
457 }
458 void __delitem__(K key) throw (std::out_of_range) {
459 std::map<K,T >::iterator i = self->find(key);
460 if (i != self->end())
461 self->erase(i);
462 else
463 throw std::out_of_range("key not found");
464 }
465 bool has_key(K key) {
466 std::map<K,T >::iterator i = self->find(key);
467 return i != self->end();
468 }
469 SCM keys() {
470 SCM result = SCM_EOL;
471 for (std::map<K,T >::reverse_iterator i=$1.rbegin();
472 i!=$1.rend(); ++i) {
473 SCM k = CONVERT_TO(i->first);
474 result = gh_cons(k,result);
475 }
476 return result;
477 }
478 }
479 };
480 %enddef
481
482 %define specialize_std_map_on_value(T,CHECK,CONVERT_FROM,CONVERT_TO)
483 template<class K> class map<K,T> {
484 %typemap(in) map<K,T> (std::map<K,T>* m) {
485 if (gh_null_p($input)) {
486 $1 = std::map<K,T >();
487 } else if (gh_pair_p($input)) {
488 $1 = std::map<K,T >();
489 SCM alist = $input;
490 while (!gh_null_p(alist)) {
491 K* k;
492 SCM entry, key, val;
493 entry = gh_car(alist);
494 if (!gh_pair_p(entry))
495 SWIG_exception(SWIG_TypeError,"alist expected");
496 key = gh_car(entry);
497 val = gh_cdr(entry);
498 k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0);
499 if (!CHECK(val)) {
500 if (!gh_pair_p(val))
501 SWIG_exception(SWIG_TypeError,"alist expected");
502 val = gh_car(val);
503 if (!CHECK(val))
504 SWIG_exception(SWIG_TypeError,
505 "map<" #K "," #T "> expected");
506 }
507 (($1_type &)$1)[*k] = CONVERT_FROM(val);
508 alist = gh_cdr(alist);
509 }
510 } else {
511 $1 = *(($&1_type)
512 SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
513 }
514 }
515 %typemap(in) const map<K,T>& (std::map<K,T> temp,
516 std::map<K,T>* m),
517 const map<K,T>* (std::map<K,T> temp,
518 std::map<K,T>* m) {
519 if (gh_null_p($input)) {
520 temp = std::map<K,T >();
521 $1 = &temp;
522 } else if (gh_pair_p($input)) {
523 temp = std::map<K,T >();
524 $1 = &temp;
525 SCM alist = $input;
526 while (!gh_null_p(alist)) {
527 K* k;
528 SCM entry, key, val;
529 entry = gh_car(alist);
530 if (!gh_pair_p(entry))
531 SWIG_exception(SWIG_TypeError,"alist expected");
532 key = gh_car(entry);
533 val = gh_cdr(entry);
534 k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0);
535 if (!CHECK(val)) {
536 if (!gh_pair_p(val))
537 SWIG_exception(SWIG_TypeError,"alist expected");
538 val = gh_car(val);
539 if (!CHECK(val))
540 SWIG_exception(SWIG_TypeError,
541 "map<" #K "," #T "> expected");
542 }
543 temp[*k] = CONVERT_FROM(val);
544 alist = gh_cdr(alist);
545 }
546 } else {
547 $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
548 }
549 }
550 %typemap(out) map<K,T> {
551 SCM alist = SCM_EOL;
552 for (std::map<K,T >::reverse_iterator i=$1.rbegin();
553 i!=$1.rend(); ++i) {
554 K* key = new K(i->first);
555 SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1);
556 SCM x = CONVERT_TO(i->second);
557 SCM entry = gh_cons(k,x);
558 alist = gh_cons(entry,alist);
559 }
560 $result = alist;
561 }
562 %typecheck(SWIG_TYPECHECK_MAP) map<K,T> {
563 // native sequence?
564 if (gh_null_p($input)) {
565 /* an empty sequence can be of any type */
566 $1 = 1;
567 } else if (gh_pair_p($input)) {
568 // check the first element only
569 K* k;
570 SCM head = gh_car($input);
571 if (gh_pair_p(head)) {
572 SCM key = gh_car(head);
573 SCM val = gh_cdr(head);
574 if (SWIG_ConvertPtr(val,(void **) &k,
575 $descriptor(K *), 0) != 0) {
576 $1 = 0;
577 } else {
578 if (CHECK(val)) {
579 $1 = 1;
580 } else if (gh_pair_p(val)) {
581 val = gh_car(val);
582 if (CHECK(val))
583 $1 = 1;
584 else
585 $1 = 0;
586 } else {
587 $1 = 0;
588 }
589 }
590 } else {
591 $1 = 0;
592 }
593 } else {
594 // wrapped map?
595 std::map<K,T >* m;
596 if (SWIG_ConvertPtr($input,(void **) &m,
597 $&1_descriptor, 0) == 0)
598 $1 = 1;
599 else
600 $1 = 0;
601 }
602 }
603 %typecheck(SWIG_TYPECHECK_MAP) const map<K,T>&,
604 const map<K,T>* {
605 // native sequence?
606 if (gh_null_p($input)) {
607 /* an empty sequence can be of any type */
608 $1 = 1;
609 } else if (gh_pair_p($input)) {
610 // check the first element only
611 K* k;
612 SCM head = gh_car($input);
613 if (gh_pair_p(head)) {
614 SCM key = gh_car(head);
615 SCM val = gh_cdr(head);
616 if (SWIG_ConvertPtr(val,(void **) &k,
617 $descriptor(K *), 0) != 0) {
618 $1 = 0;
619 } else {
620 if (CHECK(val)) {
621 $1 = 1;
622 } else if (gh_pair_p(val)) {
623 val = gh_car(val);
624 if (CHECK(val))
625 $1 = 1;
626 else
627 $1 = 0;
628 } else {
629 $1 = 0;
630 }
631 }
632 } else {
633 $1 = 0;
634 }
635 } else {
636 // wrapped map?
637 std::map<K,T >* m;
638 if (SWIG_ConvertPtr($input,(void **) &m,
639 $1_descriptor, 0) == 0)
640 $1 = 1;
641 else
642 $1 = 0;
643 }
644 }
645 %rename("length") size;
646 %rename("null?") empty;
647 %rename("clear!") clear;
648 %rename("ref") __getitem__;
649 %rename("set!") __setitem__;
650 %rename("delete!") __delitem__;
651 %rename("has-key?") has_key;
652 public:
653 map();
654 map(const map<K,T> &);
655
656 unsigned int size() const;
657 bool empty() const;
658 void clear();
659 %extend {
660 T __getitem__(const K& key) throw (std::out_of_range) {
661 std::map<K,T >::iterator i = self->find(key);
662 if (i != self->end())
663 return i->second;
664 else
665 throw std::out_of_range("key not found");
666 }
667 void __setitem__(const K& key, T x) {
668 (*self)[key] = x;
669 }
670 void __delitem__(const K& key) throw (std::out_of_range) {
671 std::map<K,T >::iterator i = self->find(key);
672 if (i != self->end())
673 self->erase(i);
674 else
675 throw std::out_of_range("key not found");
676 }
677 bool has_key(const K& key) {
678 std::map<K,T >::iterator i = self->find(key);
679 return i != self->end();
680 }
681 SCM keys() {
682 SCM result = SCM_EOL;
683 for (std::map<K,T >::reverse_iterator i=$1.rbegin();
684 i!=$1.rend(); ++i) {
685 K* key = new K(i->first);
686 SCM k = SWIG_NewPointerObj(key,$descriptor(K *), 1);
687 result = gh_cons(k,result);
688 }
689 return result;
690 }
691 }
692 };
693 %enddef
694
695 %define specialize_std_map_on_both(K,CHECK_K,CONVERT_K_FROM,CONVERT_K_TO,
696 T,CHECK_T,CONVERT_T_FROM,CONVERT_T_TO)
697 template<> class map<K,T> {
698 %typemap(in) map<K,T> (std::map<K,T>* m) {
699 if (gh_null_p($input)) {
700 $1 = std::map<K,T >();
701 } else if (gh_pair_p($input)) {
702 $1 = std::map<K,T >();
703 SCM alist = $input;
704 while (!gh_null_p(alist)) {
705 SCM entry, key, val;
706 entry = gh_car(alist);
707 if (!gh_pair_p(entry))
708 SWIG_exception(SWIG_TypeError,"alist expected");
709 key = gh_car(entry);
710 val = gh_cdr(entry);
711 if (!CHECK_K(key))
712 SWIG_exception(SWIG_TypeError,
713 "map<" #K "," #T "> expected");
714 if (!CHECK_T(val)) {
715 if (!gh_pair_p(val))
716 SWIG_exception(SWIG_TypeError,"alist expected");
717 val = gh_car(val);
718 if (!CHECK_T(val))
719 SWIG_exception(SWIG_TypeError,
720 "map<" #K "," #T "> expected");
721 }
722 (($1_type &)$1)[CONVERT_K_FROM(key)] =
723 CONVERT_T_FROM(val);
724 alist = gh_cdr(alist);
725 }
726 } else {
727 $1 = *(($&1_type)
728 SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
729 }
730 }
731 %typemap(in) const map<K,T>& (std::map<K,T> temp,
732 std::map<K,T>* m),
733 const map<K,T>* (std::map<K,T> temp,
734 std::map<K,T>* m) {
735 if (gh_null_p($input)) {
736 temp = std::map<K,T >();
737 $1 = &temp;
738 } else if (gh_pair_p($input)) {
739 temp = std::map<K,T >();
740 $1 = &temp;
741 SCM alist = $input;
742 while (!gh_null_p(alist)) {
743 SCM entry, key, val;
744 entry = gh_car(alist);
745 if (!gh_pair_p(entry))
746 SWIG_exception(SWIG_TypeError,"alist expected");
747 key = gh_car(entry);
748 val = gh_cdr(entry);
749 if (!CHECK_K(key))
750 SWIG_exception(SWIG_TypeError,
751 "map<" #K "," #T "> expected");
752 if (!CHECK_T(val)) {
753 if (!gh_pair_p(val))
754 SWIG_exception(SWIG_TypeError,"alist expected");
755 val = gh_car(val);
756 if (!CHECK_T(val))
757 SWIG_exception(SWIG_TypeError,
758 "map<" #K "," #T "> expected");
759 }
760 temp[CONVERT_K_FROM(key)] = CONVERT_T_FROM(val);
761 alist = gh_cdr(alist);
762 }
763 } else {
764 $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
765 }
766 }
767 %typemap(out) map<K,T> {
768 SCM alist = SCM_EOL;
769 for (std::map<K,T >::reverse_iterator i=$1.rbegin();
770 i!=$1.rend(); ++i) {
771 SCM k = CONVERT_K_TO(i->first);
772 SCM x = CONVERT_T_TO(i->second);
773 SCM entry = gh_cons(k,x);
774 alist = gh_cons(entry,alist);
775 }
776 $result = alist;
777 }
778 %typecheck(SWIG_TYPECHECK_MAP) map<K,T> {
779 // native sequence?
780 if (gh_null_p($input)) {
781 /* an empty sequence can be of any type */
782 $1 = 1;
783 } else if (gh_pair_p($input)) {
784 // check the first element only
785 SCM head = gh_car($input);
786 if (gh_pair_p(head)) {
787 SCM key = gh_car(head);
788 SCM val = gh_cdr(head);
789 if (!CHECK_K(key)) {
790 $1 = 0;
791 } else {
792 if (CHECK_T(val)) {
793 $1 = 1;
794 } else if (gh_pair_p(val)) {
795 val = gh_car(val);
796 if (CHECK_T(val))
797 $1 = 1;
798 else
799 $1 = 0;
800 } else {
801 $1 = 0;
802 }
803 }
804 } else {
805 $1 = 0;
806 }
807 } else {
808 // wrapped map?
809 std::map<K,T >* m;
810 if (SWIG_ConvertPtr($input,(void **) &m,
811 $&1_descriptor, 0) == 0)
812 $1 = 1;
813 else
814 $1 = 0;
815 }
816 }
817 %typecheck(SWIG_TYPECHECK_MAP) const map<K,T>&,
818 const map<K,T>* {
819 // native sequence?
820 if (gh_null_p($input)) {
821 /* an empty sequence can be of any type */
822 $1 = 1;
823 } else if (gh_pair_p($input)) {
824 // check the first element only
825 SCM head = gh_car($input);
826 if (gh_pair_p(head)) {
827 SCM key = gh_car(head);
828 SCM val = gh_cdr(head);
829 if (!CHECK_K(key)) {
830 $1 = 0;
831 } else {
832 if (CHECK_T(val)) {
833 $1 = 1;
834 } else if (gh_pair_p(val)) {
835 val = gh_car(val);
836 if (CHECK_T(val))
837 $1 = 1;
838 else
839 $1 = 0;
840 } else {
841 $1 = 0;
842 }
843 }
844 } else {
845 $1 = 0;
846 }
847 } else {
848 // wrapped map?
849 std::map<K,T >* m;
850 if (SWIG_ConvertPtr($input,(void **) &m,
851 $1_descriptor, 0) == 0)
852 $1 = 1;
853 else
854 $1 = 0;
855 }
856 }
857 %rename("length") size;
858 %rename("null?") empty;
859 %rename("clear!") clear;
860 %rename("ref") __getitem__;
861 %rename("set!") __setitem__;
862 %rename("delete!") __delitem__;
863 %rename("has-key?") has_key;
864 public:
865 map();
866 map(const map<K,T> &);
867
868 unsigned int size() const;
869 bool empty() const;
870 void clear();
871 %extend {
872 T __getitem__(K key) throw (std::out_of_range) {
873 std::map<K,T >::iterator i = self->find(key);
874 if (i != self->end())
875 return i->second;
876 else
877 throw std::out_of_range("key not found");
878 }
879 void __setitem__(K key, T x) {
880 (*self)[key] = x;
881 }
882 void __delitem__(K key) throw (std::out_of_range) {
883 std::map<K,T >::iterator i = self->find(key);
884 if (i != self->end())
885 self->erase(i);
886 else
887 throw std::out_of_range("key not found");
888 }
889 bool has_key(K key) {
890 std::map<K,T >::iterator i = self->find(key);
891 return i != self->end();
892 }
893 SCM keys() {
894 SCM result = SCM_EOL;
895 for (std::map<K,T >::reverse_iterator i=$1.rbegin();
896 i!=$1.rend(); ++i) {
897 SCM k = CONVERT_K_TO(i->first);
898 result = gh_cons(k,result);
899 }
900 return result;
901 }
902 }
903 };
904 %enddef
905
906
907 specialize_std_map_on_key(bool,gh_boolean_p,
908 gh_scm2bool,SWIG_bool2scm);
909 specialize_std_map_on_key(int,gh_number_p,
910 gh_scm2long,gh_long2scm);
911 specialize_std_map_on_key(short,gh_number_p,
912 gh_scm2long,gh_long2scm);
913 specialize_std_map_on_key(long,gh_number_p,
914 gh_scm2long,gh_long2scm);
915 specialize_std_map_on_key(unsigned int,gh_number_p,
916 gh_scm2ulong,gh_ulong2scm);
917 specialize_std_map_on_key(unsigned short,gh_number_p,
918 gh_scm2ulong,gh_ulong2scm);
919 specialize_std_map_on_key(unsigned long,gh_number_p,
920 gh_scm2ulong,gh_ulong2scm);
921 specialize_std_map_on_key(double,gh_number_p,
922 gh_scm2double,gh_double2scm);
923 specialize_std_map_on_key(float,gh_number_p,
924 gh_scm2double,gh_double2scm);
925 specialize_std_map_on_key(std::string,gh_string_p,
926 SWIG_scm2string,SWIG_string2scm);
927
928 specialize_std_map_on_value(bool,gh_boolean_p,
929 gh_scm2bool,SWIG_bool2scm);
930 specialize_std_map_on_value(int,gh_number_p,
931 gh_scm2long,gh_long2scm);
932 specialize_std_map_on_value(short,gh_number_p,
933 gh_scm2long,gh_long2scm);
934 specialize_std_map_on_value(long,gh_number_p,
935 gh_scm2long,gh_long2scm);
936 specialize_std_map_on_value(unsigned int,gh_number_p,
937 gh_scm2ulong,gh_ulong2scm);
938 specialize_std_map_on_value(unsigned short,gh_number_p,
939 gh_scm2ulong,gh_ulong2scm);
940 specialize_std_map_on_value(unsigned long,gh_number_p,
941 gh_scm2ulong,gh_ulong2scm);
942 specialize_std_map_on_value(double,gh_number_p,
943 gh_scm2double,gh_double2scm);
944 specialize_std_map_on_value(float,gh_number_p,
945 gh_scm2double,gh_double2scm);
946 specialize_std_map_on_value(std::string,gh_string_p,
947 SWIG_scm2string,SWIG_string2scm);
948
949 specialize_std_map_on_both(bool,gh_boolean_p,
950 gh_scm2bool,SWIG_bool2scm,
951 bool,gh_boolean_p,
952 gh_scm2bool,SWIG_bool2scm);
953 specialize_std_map_on_both(bool,gh_boolean_p,
954 gh_scm2bool,SWIG_bool2scm,
955 int,gh_number_p,
956 gh_scm2long,gh_long2scm);
957 specialize_std_map_on_both(bool,gh_boolean_p,
958 gh_scm2bool,SWIG_bool2scm,
959 short,gh_number_p,
960 gh_scm2long,gh_long2scm);
961 specialize_std_map_on_both(bool,gh_boolean_p,
962 gh_scm2bool,SWIG_bool2scm,
963 long,gh_number_p,
964 gh_scm2long,gh_long2scm);
965 specialize_std_map_on_both(bool,gh_boolean_p,
966 gh_scm2bool,SWIG_bool2scm,
967 unsigned int,gh_number_p,
968 gh_scm2ulong,gh_ulong2scm);
969 specialize_std_map_on_both(bool,gh_boolean_p,
970 gh_scm2bool,SWIG_bool2scm,
971 unsigned short,gh_number_p,
972 gh_scm2ulong,gh_ulong2scm);
973 specialize_std_map_on_both(bool,gh_boolean_p,
974 gh_scm2bool,SWIG_bool2scm,
975 unsigned long,gh_number_p,
976 gh_scm2ulong,gh_ulong2scm);
977 specialize_std_map_on_both(bool,gh_boolean_p,
978 gh_scm2bool,SWIG_bool2scm,
979 double,gh_number_p,
980 gh_scm2double,gh_double2scm);
981 specialize_std_map_on_both(bool,gh_boolean_p,
982 gh_scm2bool,SWIG_bool2scm,
983 float,gh_number_p,
984 gh_scm2double,gh_double2scm);
985 specialize_std_map_on_both(bool,gh_boolean_p,
986 gh_scm2bool,SWIG_bool2scm,
987 std::string,gh_string_p,
988 SWIG_scm2string,SWIG_string2scm);
989 specialize_std_map_on_both(int,gh_number_p,
990 gh_scm2long,gh_long2scm,
991 bool,gh_boolean_p,
992 gh_scm2bool,SWIG_bool2scm);
993 specialize_std_map_on_both(int,gh_number_p,
994 gh_scm2long,gh_long2scm,
995 int,gh_number_p,
996 gh_scm2long,gh_long2scm);
997 specialize_std_map_on_both(int,gh_number_p,
998 gh_scm2long,gh_long2scm,
999 short,gh_number_p,
1000 gh_scm2long,gh_long2scm);
1001 specialize_std_map_on_both(int,gh_number_p,
1002 gh_scm2long,gh_long2scm,
1003 long,gh_number_p,
1004 gh_scm2long,gh_long2scm);
1005 specialize_std_map_on_both(int,gh_number_p,
1006 gh_scm2long,gh_long2scm,
1007 unsigned int,gh_number_p,
1008 gh_scm2ulong,gh_ulong2scm);
1009 specialize_std_map_on_both(int,gh_number_p,
1010 gh_scm2long,gh_long2scm,
1011 unsigned short,gh_number_p,
1012 gh_scm2ulong,gh_ulong2scm);
1013 specialize_std_map_on_both(int,gh_number_p,
1014 gh_scm2long,gh_long2scm,
1015 unsigned long,gh_number_p,
1016 gh_scm2ulong,gh_ulong2scm);
1017 specialize_std_map_on_both(int,gh_number_p,
1018 gh_scm2long,gh_long2scm,
1019 double,gh_number_p,
1020 gh_scm2double,gh_double2scm);
1021 specialize_std_map_on_both(int,gh_number_p,
1022 gh_scm2long,gh_long2scm,
1023 float,gh_number_p,
1024 gh_scm2double,gh_double2scm);
1025 specialize_std_map_on_both(int,gh_number_p,
1026 gh_scm2long,gh_long2scm,
1027 std::string,gh_string_p,
1028 SWIG_scm2string,SWIG_string2scm);
1029 specialize_std_map_on_both(short,gh_number_p,
1030 gh_scm2long,gh_long2scm,
1031 bool,gh_boolean_p,
1032 gh_scm2bool,SWIG_bool2scm);
1033 specialize_std_map_on_both(short,gh_number_p,
1034 gh_scm2long,gh_long2scm,
1035 int,gh_number_p,
1036 gh_scm2long,gh_long2scm);
1037 specialize_std_map_on_both(short,gh_number_p,
1038 gh_scm2long,gh_long2scm,
1039 short,gh_number_p,
1040 gh_scm2long,gh_long2scm);
1041 specialize_std_map_on_both(short,gh_number_p,
1042 gh_scm2long,gh_long2scm,
1043 long,gh_number_p,
1044 gh_scm2long,gh_long2scm);
1045 specialize_std_map_on_both(short,gh_number_p,
1046 gh_scm2long,gh_long2scm,
1047 unsigned int,gh_number_p,
1048 gh_scm2ulong,gh_ulong2scm);
1049 specialize_std_map_on_both(short,gh_number_p,
1050 gh_scm2long,gh_long2scm,
1051 unsigned short,gh_number_p,
1052 gh_scm2ulong,gh_ulong2scm);
1053 specialize_std_map_on_both(short,gh_number_p,
1054 gh_scm2long,gh_long2scm,
1055 unsigned long,gh_number_p,
1056 gh_scm2ulong,gh_ulong2scm);
1057 specialize_std_map_on_both(short,gh_number_p,
1058 gh_scm2long,gh_long2scm,
1059 double,gh_number_p,
1060 gh_scm2double,gh_double2scm);
1061 specialize_std_map_on_both(short,gh_number_p,
1062 gh_scm2long,gh_long2scm,
1063 float,gh_number_p,
1064 gh_scm2double,gh_double2scm);
1065 specialize_std_map_on_both(short,gh_number_p,
1066 gh_scm2long,gh_long2scm,
1067 std::string,gh_string_p,
1068 SWIG_scm2string,SWIG_string2scm);
1069 specialize_std_map_on_both(long,gh_number_p,
1070 gh_scm2long,gh_long2scm,
1071 bool,gh_boolean_p,
1072 gh_scm2bool,SWIG_bool2scm);
1073 specialize_std_map_on_both(long,gh_number_p,
1074 gh_scm2long,gh_long2scm,
1075 int,gh_number_p,
1076 gh_scm2long,gh_long2scm);
1077 specialize_std_map_on_both(long,gh_number_p,
1078 gh_scm2long,gh_long2scm,
1079 short,gh_number_p,
1080 gh_scm2long,gh_long2scm);
1081 specialize_std_map_on_both(long,gh_number_p,
1082 gh_scm2long,gh_long2scm,
1083 long,gh_number_p,
1084 gh_scm2long,gh_long2scm);
1085 specialize_std_map_on_both(long,gh_number_p,
1086 gh_scm2long,gh_long2scm,
1087 unsigned int,gh_number_p,
1088 gh_scm2ulong,gh_ulong2scm);
1089 specialize_std_map_on_both(long,gh_number_p,
1090 gh_scm2long,gh_long2scm,
1091 unsigned short,gh_number_p,
1092 gh_scm2ulong,gh_ulong2scm);
1093 specialize_std_map_on_both(long,gh_number_p,
1094 gh_scm2long,gh_long2scm,
1095 unsigned long,gh_number_p,
1096 gh_scm2ulong,gh_ulong2scm);
1097 specialize_std_map_on_both(long,gh_number_p,
1098 gh_scm2long,gh_long2scm,
1099 double,gh_number_p,
1100 gh_scm2double,gh_double2scm);
1101 specialize_std_map_on_both(long,gh_number_p,
1102 gh_scm2long,gh_long2scm,
1103 float,gh_number_p,
1104 gh_scm2double,gh_double2scm);
1105 specialize_std_map_on_both(long,gh_number_p,
1106 gh_scm2long,gh_long2scm,
1107 std::string,gh_string_p,
1108 SWIG_scm2string,SWIG_string2scm);
1109 specialize_std_map_on_both(unsigned int,gh_number_p,
1110 gh_scm2ulong,gh_ulong2scm,
1111 bool,gh_boolean_p,
1112 gh_scm2bool,SWIG_bool2scm);
1113 specialize_std_map_on_both(unsigned int,gh_number_p,
1114 gh_scm2ulong,gh_ulong2scm,
1115 int,gh_number_p,
1116 gh_scm2long,gh_long2scm);
1117 specialize_std_map_on_both(unsigned int,gh_number_p,
1118 gh_scm2ulong,gh_ulong2scm,
1119 short,gh_number_p,
1120 gh_scm2long,gh_long2scm);
1121 specialize_std_map_on_both(unsigned int,gh_number_p,
1122 gh_scm2ulong,gh_ulong2scm,
1123 long,gh_number_p,
1124 gh_scm2long,gh_long2scm);
1125 specialize_std_map_on_both(unsigned int,gh_number_p,
1126 gh_scm2ulong,gh_ulong2scm,
1127 unsigned int,gh_number_p,
1128 gh_scm2ulong,gh_ulong2scm);
1129 specialize_std_map_on_both(unsigned int,gh_number_p,
1130 gh_scm2ulong,gh_ulong2scm,
1131 unsigned short,gh_number_p,
1132 gh_scm2ulong,gh_ulong2scm);
1133 specialize_std_map_on_both(unsigned int,gh_number_p,
1134 gh_scm2ulong,gh_ulong2scm,
1135 unsigned long,gh_number_p,
1136 gh_scm2ulong,gh_ulong2scm);
1137 specialize_std_map_on_both(unsigned int,gh_number_p,
1138 gh_scm2ulong,gh_ulong2scm,
1139 double,gh_number_p,
1140 gh_scm2double,gh_double2scm);
1141 specialize_std_map_on_both(unsigned int,gh_number_p,
1142 gh_scm2ulong,gh_ulong2scm,
1143 float,gh_number_p,
1144 gh_scm2double,gh_double2scm);
1145 specialize_std_map_on_both(unsigned int,gh_number_p,
1146 gh_scm2ulong,gh_ulong2scm,
1147 std::string,gh_string_p,
1148 SWIG_scm2string,SWIG_string2scm);
1149 specialize_std_map_on_both(unsigned short,gh_number_p,
1150 gh_scm2ulong,gh_ulong2scm,
1151 bool,gh_boolean_p,
1152 gh_scm2bool,SWIG_bool2scm);
1153 specialize_std_map_on_both(unsigned short,gh_number_p,
1154 gh_scm2ulong,gh_ulong2scm,
1155 int,gh_number_p,
1156 gh_scm2long,gh_long2scm);
1157 specialize_std_map_on_both(unsigned short,gh_number_p,
1158 gh_scm2ulong,gh_ulong2scm,
1159 short,gh_number_p,
1160 gh_scm2long,gh_long2scm);
1161 specialize_std_map_on_both(unsigned short,gh_number_p,
1162 gh_scm2ulong,gh_ulong2scm,
1163 long,gh_number_p,
1164 gh_scm2long,gh_long2scm);
1165 specialize_std_map_on_both(unsigned short,gh_number_p,
1166 gh_scm2ulong,gh_ulong2scm,
1167 unsigned int,gh_number_p,
1168 gh_scm2ulong,gh_ulong2scm);
1169 specialize_std_map_on_both(unsigned short,gh_number_p,
1170 gh_scm2ulong,gh_ulong2scm,
1171 unsigned short,gh_number_p,
1172 gh_scm2ulong,gh_ulong2scm);
1173 specialize_std_map_on_both(unsigned short,gh_number_p,
1174 gh_scm2ulong,gh_ulong2scm,
1175 unsigned long,gh_number_p,
1176 gh_scm2ulong,gh_ulong2scm);
1177 specialize_std_map_on_both(unsigned short,gh_number_p,
1178 gh_scm2ulong,gh_ulong2scm,
1179 double,gh_number_p,
1180 gh_scm2double,gh_double2scm);
1181 specialize_std_map_on_both(unsigned short,gh_number_p,
1182 gh_scm2ulong,gh_ulong2scm,
1183 float,gh_number_p,
1184 gh_scm2double,gh_double2scm);
1185 specialize_std_map_on_both(unsigned short,gh_number_p,
1186 gh_scm2ulong,gh_ulong2scm,
1187 std::string,gh_string_p,
1188 SWIG_scm2string,SWIG_string2scm);
1189 specialize_std_map_on_both(unsigned long,gh_number_p,
1190 gh_scm2ulong,gh_ulong2scm,
1191 bool,gh_boolean_p,
1192 gh_scm2bool,SWIG_bool2scm);
1193 specialize_std_map_on_both(unsigned long,gh_number_p,
1194 gh_scm2ulong,gh_ulong2scm,
1195 int,gh_number_p,
1196 gh_scm2long,gh_long2scm);
1197 specialize_std_map_on_both(unsigned long,gh_number_p,
1198 gh_scm2ulong,gh_ulong2scm,
1199 short,gh_number_p,
1200 gh_scm2long,gh_long2scm);
1201 specialize_std_map_on_both(unsigned long,gh_number_p,
1202 gh_scm2ulong,gh_ulong2scm,
1203 long,gh_number_p,
1204 gh_scm2long,gh_long2scm);
1205 specialize_std_map_on_both(unsigned long,gh_number_p,
1206 gh_scm2ulong,gh_ulong2scm,
1207 unsigned int,gh_number_p,
1208 gh_scm2ulong,gh_ulong2scm);
1209 specialize_std_map_on_both(unsigned long,gh_number_p,
1210 gh_scm2ulong,gh_ulong2scm,
1211 unsigned short,gh_number_p,
1212 gh_scm2ulong,gh_ulong2scm);
1213 specialize_std_map_on_both(unsigned long,gh_number_p,
1214 gh_scm2ulong,gh_ulong2scm,
1215 unsigned long,gh_number_p,
1216 gh_scm2ulong,gh_ulong2scm);
1217 specialize_std_map_on_both(unsigned long,gh_number_p,
1218 gh_scm2ulong,gh_ulong2scm,
1219 double,gh_number_p,
1220 gh_scm2double,gh_double2scm);
1221 specialize_std_map_on_both(unsigned long,gh_number_p,
1222 gh_scm2ulong,gh_ulong2scm,
1223 float,gh_number_p,
1224 gh_scm2double,gh_double2scm);
1225 specialize_std_map_on_both(unsigned long,gh_number_p,
1226 gh_scm2ulong,gh_ulong2scm,
1227 std::string,gh_string_p,
1228 SWIG_scm2string,SWIG_string2scm);
1229 specialize_std_map_on_both(double,gh_number_p,
1230 gh_scm2double,gh_double2scm,
1231 bool,gh_boolean_p,
1232 gh_scm2bool,SWIG_bool2scm);
1233 specialize_std_map_on_both(double,gh_number_p,
1234 gh_scm2double,gh_double2scm,
1235 int,gh_number_p,
1236 gh_scm2long,gh_long2scm);
1237 specialize_std_map_on_both(double,gh_number_p,
1238 gh_scm2double,gh_double2scm,
1239 short,gh_number_p,
1240 gh_scm2long,gh_long2scm);
1241 specialize_std_map_on_both(double,gh_number_p,
1242 gh_scm2double,gh_double2scm,
1243 long,gh_number_p,
1244 gh_scm2long,gh_long2scm);
1245 specialize_std_map_on_both(double,gh_number_p,
1246 gh_scm2double,gh_double2scm,
1247 unsigned int,gh_number_p,
1248 gh_scm2ulong,gh_ulong2scm);
1249 specialize_std_map_on_both(double,gh_number_p,
1250 gh_scm2double,gh_double2scm,
1251 unsigned short,gh_number_p,
1252 gh_scm2ulong,gh_ulong2scm);
1253 specialize_std_map_on_both(double,gh_number_p,
1254 gh_scm2double,gh_double2scm,
1255 unsigned long,gh_number_p,
1256 gh_scm2ulong,gh_ulong2scm);
1257 specialize_std_map_on_both(double,gh_number_p,
1258 gh_scm2double,gh_double2scm,
1259 double,gh_number_p,
1260 gh_scm2double,gh_double2scm);
1261 specialize_std_map_on_both(double,gh_number_p,
1262 gh_scm2double,gh_double2scm,
1263 float,gh_number_p,
1264 gh_scm2double,gh_double2scm);
1265 specialize_std_map_on_both(double,gh_number_p,
1266 gh_scm2double,gh_double2scm,
1267 std::string,gh_string_p,
1268 SWIG_scm2string,SWIG_string2scm);
1269 specialize_std_map_on_both(float,gh_number_p,
1270 gh_scm2double,gh_double2scm,
1271 bool,gh_boolean_p,
1272 gh_scm2bool,SWIG_bool2scm);
1273 specialize_std_map_on_both(float,gh_number_p,
1274 gh_scm2double,gh_double2scm,
1275 int,gh_number_p,
1276 gh_scm2long,gh_long2scm);
1277 specialize_std_map_on_both(float,gh_number_p,
1278 gh_scm2double,gh_double2scm,
1279 short,gh_number_p,
1280 gh_scm2long,gh_long2scm);
1281 specialize_std_map_on_both(float,gh_number_p,
1282 gh_scm2double,gh_double2scm,
1283 long,gh_number_p,
1284 gh_scm2long,gh_long2scm);
1285 specialize_std_map_on_both(float,gh_number_p,
1286 gh_scm2double,gh_double2scm,
1287 unsigned int,gh_number_p,
1288 gh_scm2ulong,gh_ulong2scm);
1289 specialize_std_map_on_both(float,gh_number_p,
1290 gh_scm2double,gh_double2scm,
1291 unsigned short,gh_number_p,
1292 gh_scm2ulong,gh_ulong2scm);
1293 specialize_std_map_on_both(float,gh_number_p,
1294 gh_scm2double,gh_double2scm,
1295 unsigned long,gh_number_p,
1296 gh_scm2ulong,gh_ulong2scm);
1297 specialize_std_map_on_both(float,gh_number_p,
1298 gh_scm2double,gh_double2scm,
1299 double,gh_number_p,
1300 gh_scm2double,gh_double2scm);
1301 specialize_std_map_on_both(float,gh_number_p,
1302 gh_scm2double,gh_double2scm,
1303 float,gh_number_p,
1304 gh_scm2double,gh_double2scm);
1305 specialize_std_map_on_both(float,gh_number_p,
1306 gh_scm2double,gh_double2scm,
1307 std::string,gh_string_p,
1308 SWIG_scm2string,SWIG_string2scm);
1309 specialize_std_map_on_both(std::string,gh_string_p,
1310 SWIG_scm2string,SWIG_string2scm,
1311 bool,gh_boolean_p,
1312 gh_scm2bool,SWIG_bool2scm);
1313 specialize_std_map_on_both(std::string,gh_string_p,
1314 SWIG_scm2string,SWIG_string2scm,
1315 int,gh_number_p,
1316 gh_scm2long,gh_long2scm);
1317 specialize_std_map_on_both(std::string,gh_string_p,
1318 SWIG_scm2string,SWIG_string2scm,
1319 short,gh_number_p,
1320 gh_scm2long,gh_long2scm);
1321 specialize_std_map_on_both(std::string,gh_string_p,
1322 SWIG_scm2string,SWIG_string2scm,
1323 long,gh_number_p,
1324 gh_scm2long,gh_long2scm);
1325 specialize_std_map_on_both(std::string,gh_string_p,
1326 SWIG_scm2string,SWIG_string2scm,
1327 unsigned int,gh_number_p,
1328 gh_scm2ulong,gh_ulong2scm);
1329 specialize_std_map_on_both(std::string,gh_string_p,
1330 SWIG_scm2string,SWIG_string2scm,
1331 unsigned short,gh_number_p,
1332 gh_scm2ulong,gh_ulong2scm);
1333 specialize_std_map_on_both(std::string,gh_string_p,
1334 SWIG_scm2string,SWIG_string2scm,
1335 unsigned long,gh_number_p,
1336 gh_scm2ulong,gh_ulong2scm);
1337 specialize_std_map_on_both(std::string,gh_string_p,
1338 SWIG_scm2string,SWIG_string2scm,
1339 double,gh_number_p,
1340 gh_scm2double,gh_double2scm);
1341 specialize_std_map_on_both(std::string,gh_string_p,
1342 SWIG_scm2string,SWIG_string2scm,
1343 float,gh_number_p,
1344 gh_scm2double,gh_double2scm);
1345 specialize_std_map_on_both(std::string,gh_string_p,
1346 SWIG_scm2string,SWIG_string2scm,
1347 std::string,gh_string_p,
1348 SWIG_scm2string,SWIG_string2scm);
1349}