Panda3D
interrogate_interface.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file interrogate_interface.cxx
10  * @author drose
11  * @date 2000-07-31
12  */
13 
14 #include "interrogate_interface.h"
15 #include "interrogateDatabase.h"
16 #include "interrogateType.h"
17 #include "interrogateFunction.h"
18 #include "config_interrogatedb.h"
19 
20 using std::string;
21 
22 // This function adds one more directory to the list of directories search for
23 // interrogate (*.in) files. In the past, this list has been defined the
24 // environment variable ETC_PATH, but now it is passed in by the code
25 // generator.
26 void
27 interrogate_add_search_directory(const char *dirname) {
28  // cerr << "interrogate_add_search_directory(" << dirname << ")\n";
29  interrogatedb_path.append_directory(Filename::from_os_specific(dirname));
30 }
31 
32 // This function works similar to the above, but adds a complete path string--
33 // a list of multiple directories, separated by the standard delimiter--to the
34 // search path.
35 void
36 interrogate_add_search_path(const char *pathstring) {
37  // cerr << "interrogate_add_search_path(" << pathstring << ")\n";
38  interrogatedb_path.append_path(pathstring);
39 }
40 
41 bool interrogate_error_flag() {
42  // cerr << "interrogate_error_flag\n";
44 }
45 
46 int
47 interrogate_number_of_manifests() {
48  // cerr << "interrogate_number_of_manifests\n";
50 }
51 
52 ManifestIndex
53 interrogate_get_manifest(int n) {
54  // cerr << "interrogate_get_manifest(" << n << ")\n";
56 }
57 
58 ManifestIndex
59 interrogate_get_manifest_by_name(const char *manifest_name) {
60  // cerr << "interrogate_get_manifest_by_name(" << manifest_name << ")\n";
62 }
63 
64 const char *
65 interrogate_manifest_name(ManifestIndex manifest) {
66  // cerr << "interrogate_manifest_name(" << manifest << ")\n";
67  return InterrogateDatabase::get_ptr()->get_manifest(manifest).get_name().c_str();
68 }
69 
70 const char *
71 interrogate_manifest_definition(ManifestIndex manifest) {
72  // cerr << "interrogate_manifest_definition(" << manifest << ")\n";
73  return InterrogateDatabase::get_ptr()->get_manifest(manifest).get_definition().c_str();
74 }
75 
76 bool
77 interrogate_manifest_has_type(ManifestIndex manifest) {
78  // cerr << "interrogate_manifest_has_type(" << manifest << ")\n";
79  return InterrogateDatabase::get_ptr()->get_manifest(manifest).has_type();
80 }
81 
82 TypeIndex
83 interrogate_manifest_get_type(ManifestIndex manifest) {
84  // cerr << "interrogate_manifest_get_type(" << manifest << ")\n";
85  return InterrogateDatabase::get_ptr()->get_manifest(manifest).get_type();
86 }
87 
88 bool
89 interrogate_manifest_has_getter(ManifestIndex manifest) {
90  // cerr << "interrogate_manifest_has_getter(" << manifest << ")\n";
91  return InterrogateDatabase::get_ptr()->get_manifest(manifest).has_getter();
92 }
93 
94 FunctionIndex
95 interrogate_manifest_getter(ManifestIndex manifest) {
96  // cerr << "interrogate_manifest_getter(" << manifest << ")\n";
97  return InterrogateDatabase::get_ptr()->get_manifest(manifest).get_getter();
98 }
99 
100 bool
101 interrogate_manifest_has_int_value(ManifestIndex manifest) {
102  // cerr << "interrogate_manifest_has_int_value(" << manifest << ")\n";
103  return InterrogateDatabase::get_ptr()->get_manifest(manifest).has_int_value();
104 }
105 
106 int
107 interrogate_manifest_get_int_value(ManifestIndex manifest) {
108  // cerr << "interrogate_manifest_get_int_value(" << manifest << ")\n";
109  return InterrogateDatabase::get_ptr()->get_manifest(manifest).get_int_value();
110 }
111 
112 const char *
113 interrogate_element_name(ElementIndex element) {
114  // cerr << "interrogate_element_name(" << element << ")\n";
115  return InterrogateDatabase::get_ptr()->get_element(element).get_name().c_str();
116 }
117 
118 const char *
119 interrogate_element_scoped_name(ElementIndex element) {
120  // cerr << "interrogate_element_scoped_name(" << element << ")\n";
121  return InterrogateDatabase::get_ptr()->get_element(element).get_scoped_name().c_str();
122 }
123 
124 bool
125 interrogate_element_has_comment(ElementIndex element) {
126  // cerr << "interrogate_element_has_comment(" << element << ")\n";
127  return InterrogateDatabase::get_ptr()->get_element(element).has_comment();
128 }
129 
130 const char *
131 interrogate_element_comment(ElementIndex element) {
132  // cerr << "interrogate_element_comment(" << element << ")\n";
133  return InterrogateDatabase::get_ptr()->get_element(element).get_comment().c_str();
134 }
135 
136 ElementIndex
137 interrogate_get_element_by_name(const char *element_name) {
138  // cerr << "interrogate_get_element_by_name(" << element_name << ")\n";
140 }
141 
142 ElementIndex
143 interrogate_get_element_by_scoped_name(const char *element_name) {
144  // cerr << "interrogate_get_element_by_scoped_name(" << element_name <<
145  // ")\n";
147 }
148 
149 TypeIndex
150 interrogate_element_type(ElementIndex element) {
151  // cerr << "interrogate_element_type(" << element << ")\n";
152  return InterrogateDatabase::get_ptr()->get_element(element).get_type();
153 }
154 
155 bool
156 interrogate_element_has_getter(ElementIndex element) {
157  // cerr << "interrogate_element_has_getter(" << element << ")\n";
158  return InterrogateDatabase::get_ptr()->get_element(element).has_getter();
159 }
160 
161 FunctionIndex
162 interrogate_element_getter(ElementIndex element) {
163  // cerr << "interrogate_element_getter(" << element << ")\n";
164  return InterrogateDatabase::get_ptr()->get_element(element).get_getter();
165 }
166 
167 bool
168 interrogate_element_has_setter(ElementIndex element) {
169  // cerr << "interrogate_element_has_setter(" << element << ")\n";
170  return InterrogateDatabase::get_ptr()->get_element(element).has_setter();
171 }
172 
173 FunctionIndex
174 interrogate_element_setter(ElementIndex element) {
175  // cerr << "interrogate_element_setter(" << element << ")\n";
176  return InterrogateDatabase::get_ptr()->get_element(element).get_setter();
177 }
178 
179 bool
180 interrogate_element_is_sequence(ElementIndex element) {
181  // cerr << "interrogate_element_is_sequence(" << element << ")\n";
182  return InterrogateDatabase::get_ptr()->get_element(element).is_sequence();
183 }
184 
185 bool
186 interrogate_element_is_mapping(ElementIndex element) {
187  // cerr << "interrogate_element_is_mapping(" << element << ")\n";
188  return InterrogateDatabase::get_ptr()->get_element(element).is_mapping();
189 }
190 
191 int
192 interrogate_number_of_globals() {
193  // cerr << "interrogate_number_of_globals()\n";
195 }
196 
197 ElementIndex
198 interrogate_get_global(int n) {
199  // cerr << "interrogate_get_global(" << n << ")\n";
201 }
202 
203 int
204 interrogate_number_of_global_functions() {
205  // cerr << "interrogate_number_of_global_functions()\n";
207 }
208 
209 FunctionIndex
210 interrogate_get_global_function(int n) {
211  // cerr << "interrogate_get_global_function(" << n << ")\n";
213 }
214 
215 int
216 interrogate_number_of_functions() {
217  // cerr << "interrogate_number_of_functions()\n";
219 }
220 
221 FunctionIndex
222 interrogate_get_function(int n) {
223  // cerr << "interrogate_get_function(" << n << ")\n";
225 }
226 
227 const char *
228 interrogate_function_name(FunctionIndex function) {
229  // cerr << "interrogate_function_name(" << function << ")\n";
230  return InterrogateDatabase::get_ptr()->get_function(function).get_name().c_str();
231 }
232 
233 const char *
234 interrogate_function_scoped_name(FunctionIndex function) {
235  // cerr << "interrogate_function_scoped_name(" << function << ")\n";
236  return InterrogateDatabase::get_ptr()->get_function(function).get_scoped_name().c_str();
237 }
238 
239 bool
240 interrogate_function_has_comment(FunctionIndex function) {
241  // cerr << "interrogate_function_has_comment(" << function << ")\n";
242  return InterrogateDatabase::get_ptr()->get_function(function).has_comment();
243 }
244 
245 const char *
246 interrogate_function_comment(FunctionIndex function) {
247  // cerr << "interrogate_function_comment(" << function << ")\n";
248  return InterrogateDatabase::get_ptr()->get_function(function).get_comment().c_str();
249 }
250 
251 const char *
252 interrogate_function_prototype(FunctionIndex function) {
253  // cerr << "interrogate_function_prototype(" << function << ")\n";
254  return InterrogateDatabase::get_ptr()->get_function(function).get_prototype().c_str();
255 }
256 
257 bool
258 interrogate_function_is_method(FunctionIndex function) {
259  // cerr << "interrogate_function_is_method(" << function << ")\n";
261 }
262 
263 TypeIndex
264 interrogate_function_class(FunctionIndex function) {
265  // cerr << "interrogate_function_class(" << function << ")\n";
267 }
268 
269 bool
270 interrogate_function_has_module_name(FunctionIndex function) {
271  // cerr << "interrogate_function_has_module_name(" << function << ")\n";
273 }
274 
275 const char *
276 interrogate_function_module_name(FunctionIndex function) {
277  // cerr << "interrogate_function_module_name(" << function << ")\n";
279 }
280 
281 bool
282 interrogate_function_has_library_name(FunctionIndex function) {
283  // cerr << "interrogate_function_has_library_name(" << function << ")\n";
285 }
286 
287 const char *
288 interrogate_function_library_name(FunctionIndex function) {
289  // cerr << "interrogate_function_library_name(" << function << ")\n";
291 }
292 
293 
294 
295 bool
296 interrogate_function_is_virtual(FunctionIndex function) {
297  // cerr << "interrogate_function_is_virtual(" << function << ")\n";
299 }
300 
301 int
302 interrogate_function_number_of_c_wrappers(FunctionIndex function) {
303  // cerr << "interrogate_function_number_of_c_wrappers(" << function <<
304  // ")\n";
305  return InterrogateDatabase::get_ptr()->get_function(function).number_of_c_wrappers();
306 }
307 
308 FunctionWrapperIndex
309 interrogate_function_c_wrapper(FunctionIndex function, int n) {
310  // cerr << "interrogate_function_c_wrapper(" << function << ", " << n <<
311  // ")\n";
312  return InterrogateDatabase::get_ptr()->get_function(function).get_c_wrapper(n);
313 }
314 
315 int
316 interrogate_function_number_of_python_wrappers(FunctionIndex function) {
317  // cerr << "interrogate_function_number_of_python_wrappers(" << function <<
318  // ")\n";
319  return InterrogateDatabase::get_ptr()->get_function(function).number_of_python_wrappers();
320 }
321 
322 FunctionWrapperIndex
323 interrogate_function_python_wrapper(FunctionIndex function, int n) {
324  // cerr << "interrogate_function_python_wrapper(" << function << ", " << n
325  // << ")\n";
326  return InterrogateDatabase::get_ptr()->get_function(function).get_python_wrapper(n);
327 }
328 
329 const char *
330 interrogate_wrapper_name(FunctionWrapperIndex wrapper) {
331  // cerr << "interrogate_wrapper_name(" << wrapper << ")\n";
332  static string result;
333  result = InterrogateDatabase::get_ptr()->get_wrapper(wrapper).get_name();
334  return result.c_str();
335 }
336 
337 bool
338 interrogate_wrapper_is_callable_by_name(FunctionWrapperIndex wrapper) {
339  // cerr << "interrogate_wrapper_is_callable_by_name(" << wrapper << ")\n";
340  return InterrogateDatabase::get_ptr()->get_wrapper(wrapper).is_callable_by_name();
341 }
342 
343 bool
344 interrogate_wrapper_has_comment(FunctionWrapperIndex wrapper) {
345  // cerr << "interrogate_wrapper_has_comment(" << wrapper << ")\n";
346  return InterrogateDatabase::get_ptr()->get_wrapper(wrapper).has_comment();
347 }
348 
349 const char *
350 interrogate_wrapper_comment(FunctionWrapperIndex wrapper) {
351  // cerr << "interrogate_wrapper_comment(" << wrapper << ")\n";
352  return InterrogateDatabase::get_ptr()->get_wrapper(wrapper).get_comment().c_str();
353 }
354 
355 bool
356 interrogate_wrapper_has_return_value(FunctionWrapperIndex wrapper) {
357  // cerr << "interrogate_wrapper_has_return_value(" << wrapper << ")\n";
358  return InterrogateDatabase::get_ptr()->get_wrapper(wrapper).has_return_value();
359 }
360 
361 TypeIndex
362 interrogate_wrapper_return_type(FunctionWrapperIndex wrapper) {
363  // cerr << "interrogate_wrapper_return_type(" << wrapper << ")\n";
364  return InterrogateDatabase::get_ptr()->get_wrapper(wrapper).get_return_type();
365 }
366 
367 bool
368 interrogate_wrapper_caller_manages_return_value(FunctionWrapperIndex wrapper) {
369  // cerr << "interrogate_wrapper_caller_manages_return_value(" << wrapper <<
370  // ")\n";
371  return InterrogateDatabase::get_ptr()->get_wrapper(wrapper).caller_manages_return_value();
372 }
373 
374 FunctionIndex
375 interrogate_wrapper_return_value_destructor(FunctionWrapperIndex wrapper) {
376  // cerr << "interrogate_wrapper_return_value_destructor(" << wrapper <<
377  // ")\n";
378  return InterrogateDatabase::get_ptr()->get_wrapper(wrapper).get_return_value_destructor();
379 }
380 
381 int
382 interrogate_wrapper_number_of_parameters(FunctionWrapperIndex wrapper) {
383  // cerr << "interrogate_wrapper_number_of_parameters(" << wrapper << ")\n";
384  return InterrogateDatabase::get_ptr()->get_wrapper(wrapper).number_of_parameters();
385 }
386 
387 TypeIndex
388 interrogate_wrapper_parameter_type(FunctionWrapperIndex wrapper, int n) {
389  // cerr << "interrogate_wrapper_parameter_type(" << wrapper << ", " << n <<
390  // ")\n";
391  return InterrogateDatabase::get_ptr()->get_wrapper(wrapper).parameter_get_type(n);
392 }
393 
394 bool
395 interrogate_wrapper_parameter_has_name(FunctionWrapperIndex wrapper, int n) {
396  // cerr << "interrogate_wrapper_parameter_has_name(" << wrapper << ", " << n
397  // << ")\n";
398  return InterrogateDatabase::get_ptr()->get_wrapper(wrapper).parameter_has_name(n);
399 }
400 
401 const char *
402 interrogate_wrapper_parameter_name(FunctionWrapperIndex wrapper, int n) {
403  // cerr << "interrogate_wrapper_parameter_name(" << wrapper << ", " << n <<
404  // ")\n";
405  return InterrogateDatabase::get_ptr()->get_wrapper(wrapper).parameter_get_name(n).c_str();
406 }
407 
408 bool
409 interrogate_wrapper_parameter_is_this(FunctionWrapperIndex wrapper, int n) {
410  // cerr << "interrogate_wrapper_is_this(" << wrapper << ", " << n << ")\n";
411  return InterrogateDatabase::get_ptr()->get_wrapper(wrapper).parameter_is_this(n);
412 }
413 
414 bool
415 interrogate_wrapper_has_pointer(FunctionWrapperIndex wrapper) {
416  // cerr << "interrogate_wrapper_has_pointer(" << wrapper << ")\n";
417  return (InterrogateDatabase::get_ptr()->get_fptr(wrapper) != nullptr);
418 }
419 
420 void *
421 interrogate_wrapper_pointer(FunctionWrapperIndex wrapper) {
422  // cerr << "interrogate_wrapper_pointer(" << wrapper << ")\n";
423  return InterrogateDatabase::get_ptr()->get_fptr(wrapper);
424 }
425 
426 const char *
427 interrogate_wrapper_unique_name(FunctionWrapperIndex wrapper) {
428  // cerr << "interrogate_wrapper_unique_name(" << wrapper << ")\n";
429  static string result;
430  result = InterrogateDatabase::get_ptr()->get_wrapper(wrapper).get_unique_name();
431  return result.c_str();
432 }
433 
434 FunctionWrapperIndex
435 interrogate_get_wrapper_by_unique_name(const char *unique_name) {
436  // cerr << "interrogate_get_wrapper_by_unique_name(" << unique_name <<
437  // ")\n";
439 }
440 
441 const char *
442 interrogate_make_seq_seq_name(MakeSeqIndex make_seq) {
443  // cerr << "interrogate_make_seq_seq_name(" << make_seq << ")\n";
444  static string result;
445  result = InterrogateDatabase::get_ptr()->get_make_seq(make_seq).get_name();
446  return result.c_str();
447 }
448 
449 const char *
450 interrogate_make_seq_scoped_name(MakeSeqIndex make_seq) {
451  // cerr << "interrogate_make_seq_seq_name(" << make_seq << ")\n";
452  static string result;
453  result = InterrogateDatabase::get_ptr()->get_make_seq(make_seq).get_scoped_name();
454  return result.c_str();
455 }
456 
457 bool
458 interrogate_make_seq_has_comment(MakeSeqIndex make_seq) {
459  // cerr << "interrogate_make_seq_has_comment(" << make_seq << ")\n";
460  return InterrogateDatabase::get_ptr()->get_make_seq(make_seq).has_comment();
461 }
462 
463 const char *
464 interrogate_make_seq_comment(MakeSeqIndex make_seq) {
465  // cerr << "interrogate_make_seq_comment(" << make_seq << ")\n";
466  return InterrogateDatabase::get_ptr()->get_make_seq(make_seq).get_comment().c_str();
467 }
468 
469 const char *
470 interrogate_make_seq_num_name(MakeSeqIndex make_seq) {
471  // cerr << "interrogate_make_seq_num_name(" << make_seq << ")\n";
472  FunctionIndex function = InterrogateDatabase::get_ptr()->get_make_seq(make_seq).get_length_getter();
473  return interrogate_function_name(function);
474 }
475 
476 const char *
477 interrogate_make_seq_element_name(MakeSeqIndex make_seq) {
478  // cerr << "interrogate_make_seq_element_name(" << make_seq << ")\n";
479  static string result;
480  FunctionIndex function = InterrogateDatabase::get_ptr()->get_make_seq(make_seq).get_element_getter();
481  return interrogate_function_name(function);
482 }
483 
484 int
485 interrogate_number_of_global_types() {
486  // cerr << "interrogate_number_of_global_types()\n";
488 }
489 
490 TypeIndex
491 interrogate_get_global_type(int n) {
492  // cerr << "interrogate_get_global_type(" << n << ")\n";
494 }
495 
496 int
497 interrogate_number_of_types() {
498  // cerr << "interrogate_number_of_types()\n";
500 }
501 
502 TypeIndex
503 interrogate_get_type(int n) {
504  // cerr << "interrogate_get_type(" << n << ")\n";
506 }
507 
508 TypeIndex
509 interrogate_get_type_by_name(const char *type_name) {
510  // cerr << "interrogate_get_type_by_name(" << type_name << ")\n";
512 }
513 
514 TypeIndex
515 interrogate_get_type_by_scoped_name(const char *type_name) {
516  // cerr << "interrogate_get_type_by_scoped_name(" << type_name << ")\n";
518 }
519 
520 TypeIndex
521 interrogate_get_type_by_true_name(const char *type_name) {
522  // cerr << "interrogate_get_type_by_true_name(" << type_name << ")\n";
524 }
525 
526 bool
527 interrogate_type_is_global(TypeIndex type) {
528  // cerr << "interrogate_type_is_global(" << type << ")\n";
530 }
531 
532 const char *
533 interrogate_type_name(TypeIndex type) {
534  // cerr << "interrogate_type_name(" << type << ")\n";
535  return InterrogateDatabase::get_ptr()->get_type(type).get_name().c_str();
536 }
537 
538 const char *
539 interrogate_type_scoped_name(TypeIndex type) {
540  // cerr << "interrogate_type_scoped_name(" << type << ")\n";
541  return InterrogateDatabase::get_ptr()->get_type(type).get_scoped_name().c_str();
542 }
543 
544 const char *
545 interrogate_type_true_name(TypeIndex type) {
546  // cerr << "interrogate_type_true_name(" << type << ")\n";
547  return InterrogateDatabase::get_ptr()->get_type(type).get_true_name().c_str();
548 }
549 
550 bool
551 interrogate_type_is_nested(TypeIndex type) {
552  // cerr << "interrogate_type_is_nested(" << type << ")\n";
554 }
555 
556 TypeIndex
557 interrogate_type_outer_class(TypeIndex type) {
558  // cerr << "interrogate_type_outer_class(" << type << ")\n";
560 }
561 
562 bool
563 interrogate_type_has_comment(TypeIndex type) {
564  // cerr << "interrogate_type_has_comment(" << type << ")\n";
565  return InterrogateDatabase::get_ptr()->get_type(type).has_comment();
566 }
567 
568 const char *
569 interrogate_type_comment(TypeIndex type) {
570  // cerr << "interrogate_type_comment(" << type << ")\n";
571  return InterrogateDatabase::get_ptr()->get_type(type).get_comment().c_str();
572 }
573 
574 bool
575 interrogate_type_has_module_name(TypeIndex type) {
576  // cerr << "interrogate_type_has_module_name(" << type << ")\n";
578 }
579 
580 const char *
581 interrogate_type_module_name(TypeIndex type) {
582  // cerr << "interrogate_type_module_name(" << type << ")\n";
584 }
585 
586 bool
587 interrogate_type_has_library_name(TypeIndex type) {
588  // cerr << "interrogate_type_has_library_name(" << type << ")\n";
590 }
591 
592 const char *
593 interrogate_type_library_name(TypeIndex type) {
594  // cerr << "interrogate_type_library_name(" << type << ")\n";
596 }
597 
598 
599 bool
600 interrogate_type_is_atomic(TypeIndex type) {
601  // cerr << "interrogate_type_is_atomic(" << type << ")\n";
602  return InterrogateDatabase::get_ptr()->get_type(type).is_atomic();
603 }
604 
605 AtomicToken
606 interrogate_type_atomic_token(TypeIndex type) {
607  // cerr << "interrogate_type_atomic_token(" << type << ")\n";
608  return InterrogateDatabase::get_ptr()->get_type(type).get_atomic_token();
609 }
610 
611 bool
612 interrogate_type_is_unsigned(TypeIndex type) {
613  // cerr << "interrogate_type_is_unsigned(" << type << ")\n";
614  return InterrogateDatabase::get_ptr()->get_type(type).is_unsigned();
615 }
616 
617 bool
618 interrogate_type_is_signed(TypeIndex type) {
619  // cerr << "interrogate_type_is_signed(" << type << ")\n";
620  return InterrogateDatabase::get_ptr()->get_type(type).is_signed();
621 }
622 
623 bool
624 interrogate_type_is_long(TypeIndex type) {
625  // cerr << "interrogate_type_is_long(" << type << ")\n";
626  return InterrogateDatabase::get_ptr()->get_type(type).is_long();
627 }
628 
629 bool
630 interrogate_type_is_longlong(TypeIndex type) {
631  // cerr << "interrogate_type_is_longlong(" << type << ")\n";
632  return InterrogateDatabase::get_ptr()->get_type(type).is_longlong();
633 }
634 
635 bool
636 interrogate_type_is_short(TypeIndex type) {
637  // cerr << "interrogate_type_is_short(" << type << ")\n";
638  return InterrogateDatabase::get_ptr()->get_type(type).is_short();
639 }
640 
641 bool
642 interrogate_type_is_wrapped(TypeIndex type) {
643  // cerr << "interrogate_type_is_wrapped(" << type << ")\n";
644  return InterrogateDatabase::get_ptr()->get_type(type).is_wrapped();
645 }
646 
647 bool
648 interrogate_type_is_pointer(TypeIndex type) {
649  // cerr << "interrogate_type_is_pointer(" << type << ")\n";
650  return InterrogateDatabase::get_ptr()->get_type(type).is_pointer();
651 }
652 
653 bool
654 interrogate_type_is_const(TypeIndex type) {
655  // cerr << "interrogate_type_is_const(" << type << ")\n";
656  return InterrogateDatabase::get_ptr()->get_type(type).is_const();
657 }
658 
659 bool
660 interrogate_type_is_typedef(TypeIndex type) {
661  // cerr << "interrogate_type_is_typedef(" << type << ")\n";
662  return InterrogateDatabase::get_ptr()->get_type(type).is_typedef();
663 }
664 
665 TypeIndex
666 interrogate_type_wrapped_type(TypeIndex type) {
667  // cerr << "interrogate_type_wrapped_type(" << type << ")\n";
668  return InterrogateDatabase::get_ptr()->get_type(type).get_wrapped_type();
669 }
670 
671 bool
672 interrogate_type_is_enum(TypeIndex type) {
673  // cerr << "interrogate_type_is_enum(" << type << ")\n";
674  return InterrogateDatabase::get_ptr()->get_type(type).is_enum();
675 }
676 
677 int
678 interrogate_type_number_of_enum_values(TypeIndex type) {
679  // cerr << "interrogate_type_number_of_enum_values(" << type << ")\n";
680  return InterrogateDatabase::get_ptr()->get_type(type).number_of_enum_values();
681 }
682 
683 const char *
684 interrogate_type_enum_value_name(TypeIndex type, int n) {
685  // cerr << "interrogate_type_enum_value_name(" << type << ", " << n <<
686  // ")\n";
687  return InterrogateDatabase::get_ptr()->get_type(type).get_enum_value_name(n).c_str();
688 }
689 
690 const char *
691 interrogate_type_enum_value_scoped_name(TypeIndex type, int n) {
692  // cerr << "interrogate_type_enum_value_scoped_name(" << type << ", " << n
693  // << ")\n";
694  return InterrogateDatabase::get_ptr()->get_type(type).get_enum_value_scoped_name(n).c_str();
695 }
696 
697 const char *
698 interrogate_type_enum_value_comment(TypeIndex type, int n) {
699  // cerr << "interrogate_type_enum_value_comment(" << type << ", " << n <<
700  // ")\n";
701  return InterrogateDatabase::get_ptr()->get_type(type).get_enum_value_comment(n).c_str();
702 }
703 
704 int
705 interrogate_type_enum_value(TypeIndex type, int n) {
706  // cerr << "interrogate_type_enum_value(" << type << ", " << n << ")\n";
707  return InterrogateDatabase::get_ptr()->get_type(type).get_enum_value(n);
708 }
709 
710 bool
711 interrogate_type_is_struct(TypeIndex type) {
712  // cerr << "interrogate_type_is_struct(" << type << ")\n";
713  return InterrogateDatabase::get_ptr()->get_type(type).is_struct();
714 }
715 
716 bool
717 interrogate_type_is_class(TypeIndex type) {
718  // cerr << "interrogate_type_is_class(" << type << ")\n";
719  return InterrogateDatabase::get_ptr()->get_type(type).is_class();
720 }
721 
722 bool
723 interrogate_type_is_union(TypeIndex type) {
724  // cerr << "interrogate_type_is_union(" << type << ")\n";
725  return InterrogateDatabase::get_ptr()->get_type(type).is_union();
726 }
727 
728 bool
729 interrogate_type_is_fully_defined(TypeIndex type) {
730  // cerr << "interrogate_type_is_fully_defined(" << type << ")\n";
731  return InterrogateDatabase::get_ptr()->get_type(type).is_fully_defined();
732 }
733 
734 bool
735 interrogate_type_is_unpublished(TypeIndex type) {
736  // cerr << "interrogate_type_is_unpublished(" << type << ")\n";
738 }
739 
740 int
741 interrogate_type_number_of_constructors(TypeIndex type) {
742  // cerr << "interrogate_type_number_of_constructors(" << type << ")\n";
743  return InterrogateDatabase::get_ptr()->get_type(type).number_of_constructors();
744 }
745 
746 FunctionIndex
747 interrogate_type_get_constructor(TypeIndex type, int n) {
748  // cerr << "interrogate_type_get_constructor(" << type << ", " << n <<
749  // ")\n";
750  return InterrogateDatabase::get_ptr()->get_type(type).get_constructor(n);
751 }
752 
753 bool
754 interrogate_type_has_destructor(TypeIndex type) {
755  // cerr << "interrogate_type_has_destructor(" << type << ")\n";
756  return InterrogateDatabase::get_ptr()->get_type(type).has_destructor();
757 }
758 
759 bool
760 interrogate_type_destructor_is_inherited(TypeIndex type) {
761  // cerr << "interrogate_type_destructor_is_inherited(" << type << ")\n";
762  return InterrogateDatabase::get_ptr()->get_type(type).destructor_is_inherited();
763 }
764 
765 FunctionIndex
766 interrogate_type_get_destructor(TypeIndex type) {
767  // cerr << "interrogate_type_get_destructor(" << type << ")\n";
768  return InterrogateDatabase::get_ptr()->get_type(type).get_destructor();
769 }
770 
771 int
772 interrogate_type_number_of_elements(TypeIndex type) {
773  // cerr << "interrogate_type_number_of_elements(" << type << ")\n";
774  return InterrogateDatabase::get_ptr()->get_type(type).number_of_elements();
775 }
776 
777 ElementIndex
778 interrogate_type_get_element(TypeIndex type, int n) {
779  // cerr << "interrogate_type_get_element(" << type << ", " << n << ")\n";
780  return InterrogateDatabase::get_ptr()->get_type(type).get_element(n);
781 }
782 
783 int
784 interrogate_type_number_of_methods(TypeIndex type) {
785  // cerr << "interrogate_type_number_of_methods(" << type << ")\n";
786  return InterrogateDatabase::get_ptr()->get_type(type).number_of_methods();
787 }
788 
789 FunctionIndex
790 interrogate_type_get_method(TypeIndex type, int n) {
791  // cerr << "interrogate_type_get_method(" << type << ", " << n << ")\n";
792  return InterrogateDatabase::get_ptr()->get_type(type).get_method(n);
793 }
794 
795 int
796 interrogate_type_number_of_make_seqs(TypeIndex type) {
797  // cerr << "interrogate_type_number_of_make_seqs(" << type << ")\n";
798  return InterrogateDatabase::get_ptr()->get_type(type).number_of_make_seqs();
799 }
800 
801 MakeSeqIndex
802 interrogate_type_get_make_seq(TypeIndex type, int n) {
803  // cerr << "interrogate_type_get_make_seq(" << type << ", " << n << ")\n";
804  return InterrogateDatabase::get_ptr()->get_type(type).get_make_seq(n);
805 }
806 
807 int
808 interrogate_type_number_of_casts(TypeIndex type) {
809  // cerr << "interrogate_type_number_of_casts(" << type << ")\n";
810  return InterrogateDatabase::get_ptr()->get_type(type).number_of_casts();
811 }
812 
813 FunctionIndex
814 interrogate_type_get_cast(TypeIndex type, int n) {
815  // cerr << "interrogate_type_get_cast(" << type << ", " << n << ")\n";
816  return InterrogateDatabase::get_ptr()->get_type(type).get_cast(n);
817 }
818 
819 int
820 interrogate_type_number_of_derivations(TypeIndex type) {
821  // cerr << "interrogate_type_number_of_derivations(" << type << ")\n";
822  return InterrogateDatabase::get_ptr()->get_type(type).number_of_derivations();
823 }
824 
825 TypeIndex
826 interrogate_type_get_derivation(TypeIndex type, int n) {
827  // cerr << "interrogate_type_get_derivation(" << type << ", " << n << ")\n";
828  return InterrogateDatabase::get_ptr()->get_type(type).get_derivation(n);
829 }
830 
831 bool
832 interrogate_type_derivation_has_upcast(TypeIndex type, int n) {
833  // cerr << "interrogate_type_derivation_has_upcast(" << type << ", " << n <<
834  // ")\n";
835  return InterrogateDatabase::get_ptr()->get_type(type).derivation_has_upcast(n);
836 }
837 
838 FunctionIndex
839 interrogate_type_get_upcast(TypeIndex type, int n) {
840  // cerr << "interrogate_type_get_upcast(" << type << ", " << n << ")\n";
841  return InterrogateDatabase::get_ptr()->get_type(type).derivation_get_upcast(n);
842 }
843 
844 bool
845 interrogate_type_derivation_downcast_is_impossible(TypeIndex type, int n) {
846  // cerr << "interrogate_type_derivation_downcast_is_impossible(" << type <<
847  // ", " << n << ")\n";
848  return InterrogateDatabase::get_ptr()->get_type(type).derivation_downcast_is_impossible(n);
849 }
850 
851 bool
852 interrogate_type_derivation_has_downcast(TypeIndex type, int n) {
853  // cerr << "interrogate_type_derivation_has_downcast(" << type << ", " << n
854  // << ")\n";
855  return InterrogateDatabase::get_ptr()->get_type(type).derivation_has_downcast(n);
856 }
857 
858 FunctionIndex
859 interrogate_type_get_downcast(TypeIndex type, int n) {
860  // cerr << "interrogate_type_get_downcast(" << type << ", " << n << ")\n";
861  return InterrogateDatabase::get_ptr()->get_type(type).derivation_get_downcast(n);
862 }
863 
864 int
865 interrogate_type_number_of_nested_types(TypeIndex type) {
866  // cerr << "interrogate_type_number_of_nested_types(" << type << ")\n";
867  return InterrogateDatabase::get_ptr()->get_type(type).number_of_nested_types();
868 }
869 
870 TypeIndex
871 interrogate_type_get_nested_type(TypeIndex type, int n) {
872  // cerr << "interrogate_type_get_nested_type(" << type << ", " << n <<
873  // ")\n";
874  return InterrogateDatabase::get_ptr()->get_type(type).get_nested_type(n);
875 }
bool has_library_name() const
Returns true if we have a known library name, false if we do not.
bool is_virtual() const
Returns true if the function is virtual, for whatever that's worth.
const InterrogateManifest & get_manifest(ManifestIndex manifest)
Returns the manifest constant associated with the given ManifestIndex, if there is one.
int get_num_global_manifests()
Returns the total number of global manifest constants known to the interrogate database.
ElementIndex lookup_element_by_scoped_name(const std::string &name)
Returns the ElementIndex associated with the first element found with the given scoped name,...
bool has_module_name() const
Returns true if we have a known module name, false if we do not.
TypeIndex get_all_type(int n)
Returns the index of the nth type known to the interrogate database.
bool get_error_flag()
Returns the global error flag.
ManifestIndex lookup_manifest_by_name(const std::string &name)
Returns the ManifestIndex associated with the first manifest found with the given name,...
void append_path(const std::string &path, const std::string &separator=std::string())
Adds all of the directories listed in the search path to the end of the search list.
bool is_method() const
Returns true if the function is a class method.
const InterrogateMakeSeq & get_make_seq(MakeSeqIndex element)
Returns the make_seq associated with the given MakeSeqIndex, if there is one.
FunctionIndex get_global_function(int n)
Returns the index of the nth global function known to the interrogate database.
const InterrogateType & get_type(TypeIndex type)
Returns the type associated with the given TypeIndex, if there is one.
static InterrogateDatabase * get_ptr()
Returns the global pointer to the one InterrogateDatabase.
TypeIndex lookup_type_by_scoped_name(const std::string &name)
Returns the TypeIndex associated with the first type found with the given scoped name,...
ElementIndex get_global_element(int n)
Returns the index of the nth global data element known to the interrogate database.
void * get_fptr(FunctionWrapperIndex wrapper)
Returns the function pointer associated with the given function wrapper, if it has a pointer availabl...
TypeIndex get_global_type(int n)
Returns the index of the nth global type known to the interrogate database.
int get_num_global_functions()
Returns the total number of global functions known to the interrogate database.
ElementIndex lookup_element_by_name(const std::string &name)
Returns the ElementIndex associated with the first element found with the given name,...
TypeIndex lookup_type_by_name(const std::string &name)
Returns the TypeIndex associated with the first type found with the given name, or 0 if no type has t...
FunctionIndex get_all_function(int n)
Returns the index of the nth function known to the interrogate database.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool is_unpublished() const
Returns true if the type is an unpublished type.
bool is_nested() const
Returns true if this type is nested within some class definition.
ManifestIndex get_global_manifest(int n)
Returns the index of the nth global manifest constant known to the interrogate database.
bool is_global() const
Returns true if the type is marked as 'global'.
const InterrogateElement & get_element(ElementIndex element)
Returns the data element associated with the given ElementIndex, if there is one.
int get_num_global_types()
Returns the total number of "global" types known to the interrogate database.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
const char * get_library_name() const
Returns the library name, if it is known, or NULL if it is not.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeIndex lookup_type_by_true_name(const std::string &name)
Returns the TypeIndex associated with the first type found with the given true name,...
TypeIndex get_class() const
Return the class that owns the method, if is_method() returns true.
const InterrogateFunctionWrapper & get_wrapper(FunctionWrapperIndex wrapper)
Returns the function wrapper associated with the given FunctionWrapperIndex, if there is one.
FunctionWrapperIndex get_wrapper_by_unique_name(const std::string &unique_name)
Looks up the function wrapper corresponding to the given unique name, if available.
int get_num_all_functions()
Returns the total number of functions known to the interrogate database.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
const char * get_module_name() const
Returns the module name, if it is known, or NULL if it is not.
TypeIndex get_outer_class() const
If is_nested() returns true, this is the class within which this type is defined.
void append_directory(const Filename &directory)
Adds a new directory to the end of the search list.
int get_num_all_types()
Returns the total number of types known to the interrogate database.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int get_num_global_elements()
Returns the total number of global data elements known to the interrogate database.
const InterrogateFunction & get_function(FunctionIndex function)
Returns the function associated with the given FunctionIndex, if there is one.
static Filename from_os_specific(const std::string &os_specific, Type type=T_general)
This named constructor returns a Panda-style filename (that is, using forward slashes,...
Definition: filename.cxx:328