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
15#include "interrogateDatabase.h"
16#include "interrogateType.h"
17#include "interrogateFunction.h"
19
20using 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.
26void
27interrogate_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.
35void
36interrogate_add_search_path(const char *pathstring) {
37 // cerr << "interrogate_add_search_path(" << pathstring << ")\n";
38 interrogatedb_path.append_path(pathstring);
39}
40
41bool interrogate_error_flag() {
42 // cerr << "interrogate_error_flag\n";
44}
45
46int
47interrogate_number_of_manifests() {
48 // cerr << "interrogate_number_of_manifests\n";
50}
51
52ManifestIndex
53interrogate_get_manifest(int n) {
54 // cerr << "interrogate_get_manifest(" << n << ")\n";
56}
57
58ManifestIndex
59interrogate_get_manifest_by_name(const char *manifest_name) {
60 // cerr << "interrogate_get_manifest_by_name(" << manifest_name << ")\n";
62}
63
64const char *
65interrogate_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
70const char *
71interrogate_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
76bool
77interrogate_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
82TypeIndex
83interrogate_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
88bool
89interrogate_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
94FunctionIndex
95interrogate_manifest_getter(ManifestIndex manifest) {
96 // cerr << "interrogate_manifest_getter(" << manifest << ")\n";
97 return InterrogateDatabase::get_ptr()->get_manifest(manifest).get_getter();
98}
99
100bool
101interrogate_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
106int
107interrogate_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
112const char *
113interrogate_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
118const char *
119interrogate_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
124bool
125interrogate_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
130const char *
131interrogate_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
136ElementIndex
137interrogate_get_element_by_name(const char *element_name) {
138 // cerr << "interrogate_get_element_by_name(" << element_name << ")\n";
140}
141
142ElementIndex
143interrogate_get_element_by_scoped_name(const char *element_name) {
144 // cerr << "interrogate_get_element_by_scoped_name(" << element_name <<
145 // ")\n";
147}
148
149TypeIndex
150interrogate_element_type(ElementIndex element) {
151 // cerr << "interrogate_element_type(" << element << ")\n";
152 return InterrogateDatabase::get_ptr()->get_element(element).get_type();
153}
154
155bool
156interrogate_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
161FunctionIndex
162interrogate_element_getter(ElementIndex element) {
163 // cerr << "interrogate_element_getter(" << element << ")\n";
164 return InterrogateDatabase::get_ptr()->get_element(element).get_getter();
165}
166
167bool
168interrogate_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
173FunctionIndex
174interrogate_element_setter(ElementIndex element) {
175 // cerr << "interrogate_element_setter(" << element << ")\n";
176 return InterrogateDatabase::get_ptr()->get_element(element).get_setter();
177}
178
179bool
180interrogate_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
185bool
186interrogate_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
191int
192interrogate_number_of_globals() {
193 // cerr << "interrogate_number_of_globals()\n";
195}
196
197ElementIndex
198interrogate_get_global(int n) {
199 // cerr << "interrogate_get_global(" << n << ")\n";
201}
202
203int
204interrogate_number_of_global_functions() {
205 // cerr << "interrogate_number_of_global_functions()\n";
207}
208
209FunctionIndex
210interrogate_get_global_function(int n) {
211 // cerr << "interrogate_get_global_function(" << n << ")\n";
213}
214
215int
216interrogate_number_of_functions() {
217 // cerr << "interrogate_number_of_functions()\n";
219}
220
221FunctionIndex
222interrogate_get_function(int n) {
223 // cerr << "interrogate_get_function(" << n << ")\n";
225}
226
227const char *
228interrogate_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
233const char *
234interrogate_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
239bool
240interrogate_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
245const char *
246interrogate_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
251const char *
252interrogate_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
257bool
258interrogate_function_is_method(FunctionIndex function) {
259 // cerr << "interrogate_function_is_method(" << function << ")\n";
261}
262
263TypeIndex
264interrogate_function_class(FunctionIndex function) {
265 // cerr << "interrogate_function_class(" << function << ")\n";
267}
268
269bool
270interrogate_function_has_module_name(FunctionIndex function) {
271 // cerr << "interrogate_function_has_module_name(" << function << ")\n";
273}
274
275const char *
276interrogate_function_module_name(FunctionIndex function) {
277 // cerr << "interrogate_function_module_name(" << function << ")\n";
279}
280
281bool
282interrogate_function_has_library_name(FunctionIndex function) {
283 // cerr << "interrogate_function_has_library_name(" << function << ")\n";
285}
286
287const char *
288interrogate_function_library_name(FunctionIndex function) {
289 // cerr << "interrogate_function_library_name(" << function << ")\n";
291}
292
293
294
295bool
296interrogate_function_is_virtual(FunctionIndex function) {
297 // cerr << "interrogate_function_is_virtual(" << function << ")\n";
299}
300
301int
302interrogate_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
308FunctionWrapperIndex
309interrogate_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
315int
316interrogate_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
322FunctionWrapperIndex
323interrogate_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
329const char *
330interrogate_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
337bool
338interrogate_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
343bool
344interrogate_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
349const char *
350interrogate_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
355bool
356interrogate_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
361TypeIndex
362interrogate_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
367bool
368interrogate_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
374FunctionIndex
375interrogate_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
381int
382interrogate_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
387TypeIndex
388interrogate_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
394bool
395interrogate_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
401const char *
402interrogate_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
408bool
409interrogate_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
414bool
415interrogate_wrapper_has_pointer(FunctionWrapperIndex wrapper) {
416 // cerr << "interrogate_wrapper_has_pointer(" << wrapper << ")\n";
417 return (InterrogateDatabase::get_ptr()->get_fptr(wrapper) != nullptr);
418}
419
420void *
421interrogate_wrapper_pointer(FunctionWrapperIndex wrapper) {
422 // cerr << "interrogate_wrapper_pointer(" << wrapper << ")\n";
423 return InterrogateDatabase::get_ptr()->get_fptr(wrapper);
424}
425
426const char *
427interrogate_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
434FunctionWrapperIndex
435interrogate_get_wrapper_by_unique_name(const char *unique_name) {
436 // cerr << "interrogate_get_wrapper_by_unique_name(" << unique_name <<
437 // ")\n";
439}
440
441const char *
442interrogate_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
449const char *
450interrogate_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
457bool
458interrogate_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
463const char *
464interrogate_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
469const char *
470interrogate_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
476const char *
477interrogate_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
484int
485interrogate_number_of_global_types() {
486 // cerr << "interrogate_number_of_global_types()\n";
488}
489
490TypeIndex
491interrogate_get_global_type(int n) {
492 // cerr << "interrogate_get_global_type(" << n << ")\n";
494}
495
496int
497interrogate_number_of_types() {
498 // cerr << "interrogate_number_of_types()\n";
500}
501
502TypeIndex
503interrogate_get_type(int n) {
504 // cerr << "interrogate_get_type(" << n << ")\n";
506}
507
508TypeIndex
509interrogate_get_type_by_name(const char *type_name) {
510 // cerr << "interrogate_get_type_by_name(" << type_name << ")\n";
512}
513
514TypeIndex
515interrogate_get_type_by_scoped_name(const char *type_name) {
516 // cerr << "interrogate_get_type_by_scoped_name(" << type_name << ")\n";
518}
519
520TypeIndex
521interrogate_get_type_by_true_name(const char *type_name) {
522 // cerr << "interrogate_get_type_by_true_name(" << type_name << ")\n";
524}
525
526bool
527interrogate_type_is_global(TypeIndex type) {
528 // cerr << "interrogate_type_is_global(" << type << ")\n";
530}
531
532const char *
533interrogate_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
538const char *
539interrogate_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
544const char *
545interrogate_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
550bool
551interrogate_type_is_nested(TypeIndex type) {
552 // cerr << "interrogate_type_is_nested(" << type << ")\n";
554}
555
556TypeIndex
557interrogate_type_outer_class(TypeIndex type) {
558 // cerr << "interrogate_type_outer_class(" << type << ")\n";
560}
561
562bool
563interrogate_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
568const char *
569interrogate_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
574bool
575interrogate_type_has_module_name(TypeIndex type) {
576 // cerr << "interrogate_type_has_module_name(" << type << ")\n";
578}
579
580const char *
581interrogate_type_module_name(TypeIndex type) {
582 // cerr << "interrogate_type_module_name(" << type << ")\n";
584}
585
586bool
587interrogate_type_has_library_name(TypeIndex type) {
588 // cerr << "interrogate_type_has_library_name(" << type << ")\n";
590}
591
592const char *
593interrogate_type_library_name(TypeIndex type) {
594 // cerr << "interrogate_type_library_name(" << type << ")\n";
596}
597
598
599bool
600interrogate_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
605AtomicToken
606interrogate_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
611bool
612interrogate_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
617bool
618interrogate_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
623bool
624interrogate_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
629bool
630interrogate_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
635bool
636interrogate_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
641bool
642interrogate_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
647bool
648interrogate_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
653bool
654interrogate_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
659bool
660interrogate_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
665TypeIndex
666interrogate_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
671bool
672interrogate_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
677int
678interrogate_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
683const char *
684interrogate_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
690const char *
691interrogate_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
697const char *
698interrogate_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
704int
705interrogate_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
710bool
711interrogate_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
716bool
717interrogate_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
722bool
723interrogate_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
728bool
729interrogate_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
734bool
735interrogate_type_is_unpublished(TypeIndex type) {
736 // cerr << "interrogate_type_is_unpublished(" << type << ")\n";
738}
739
740int
741interrogate_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
746FunctionIndex
747interrogate_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
753bool
754interrogate_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
759bool
760interrogate_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
765FunctionIndex
766interrogate_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
771int
772interrogate_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
777ElementIndex
778interrogate_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
783int
784interrogate_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
789FunctionIndex
790interrogate_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
795int
796interrogate_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
801MakeSeqIndex
802interrogate_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
807int
808interrogate_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
813FunctionIndex
814interrogate_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
819int
820interrogate_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
825TypeIndex
826interrogate_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
831bool
832interrogate_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
838FunctionIndex
839interrogate_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
844bool
845interrogate_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
851bool
852interrogate_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
858FunctionIndex
859interrogate_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
864int
865interrogate_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
870TypeIndex
871interrogate_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}
void append_directory(const Filename &directory)
Adds a new directory to the end of the search list.
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.
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
const char * get_module_name() const
Returns the module name, if it is known, or NULL if it is not.
bool has_module_name() const
Returns true if we have a known module name, false if we do not.
const char * get_library_name() const
Returns the library name, if it is known, or NULL if it is not.
bool has_library_name() const
Returns true if we have a known library name, false if we do not.
int get_num_global_types()
Returns the total number of "global" types known to the interrogate database.
TypeIndex lookup_type_by_scoped_name(const std::string &name)
Returns the TypeIndex associated with the first type found with the given scoped name,...
ManifestIndex get_global_manifest(int n)
Returns the index of the nth global manifest constant known to the interrogate database.
const InterrogateFunction & get_function(FunctionIndex function)
Returns the function associated with the given FunctionIndex, if there is one.
ManifestIndex lookup_manifest_by_name(const std::string &name)
Returns the ManifestIndex associated with the first manifest found with the given name,...
int get_num_all_functions()
Returns the total number of functions known to the interrogate database.
int get_num_all_types()
Returns the total number of types known to the interrogate database.
TypeIndex lookup_type_by_true_name(const std::string &name)
Returns the TypeIndex associated with the first type found with the given true name,...
const InterrogateMakeSeq & get_make_seq(MakeSeqIndex element)
Returns the make_seq associated with the given MakeSeqIndex, if there is one.
bool get_error_flag()
Returns the global error flag.
int get_num_global_elements()
Returns the total number of global data elements known to the interrogate database.
const InterrogateManifest & get_manifest(ManifestIndex manifest)
Returns the manifest constant associated with the given ManifestIndex, if there is one.
const InterrogateType & get_type(TypeIndex type)
Returns the type associated with the given TypeIndex, if there is one.
const InterrogateElement & get_element(ElementIndex element)
Returns the data element associated with the given ElementIndex, if there is one.
int get_num_global_manifests()
Returns the total number of global manifest constants known to the interrogate database.
int get_num_global_functions()
Returns the total number of global functions known to the interrogate database.
const InterrogateFunctionWrapper & get_wrapper(FunctionWrapperIndex wrapper)
Returns the function wrapper associated with the given FunctionWrapperIndex, if there is one.
static InterrogateDatabase * get_ptr()
Returns the global pointer to the one InterrogateDatabase.
void * get_fptr(FunctionWrapperIndex wrapper)
Returns the function pointer associated with the given function wrapper, if it has a pointer availabl...
ElementIndex lookup_element_by_name(const std::string &name)
Returns the ElementIndex associated with the first element found with the given name,...
FunctionIndex get_all_function(int n)
Returns the index of the nth function known to the interrogate database.
TypeIndex get_all_type(int n)
Returns the index of the nth type 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,...
FunctionWrapperIndex get_wrapper_by_unique_name(const std::string &unique_name)
Looks up the function wrapper corresponding to the given unique name, if available.
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...
ElementIndex get_global_element(int n)
Returns the index of the nth global data element known to the interrogate database.
TypeIndex get_global_type(int n)
Returns the index of the nth global type known to the interrogate database.
FunctionIndex get_global_function(int n)
Returns the index of the nth global function known to the interrogate database.
bool is_method() const
Returns true if the function is a class method.
TypeIndex get_class() const
Return the class that owns the method, if is_method() returns true.
bool is_virtual() const
Returns true if the function is virtual, for whatever that's worth.
bool is_global() const
Returns true if the type is marked as 'global'.
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.
TypeIndex get_outer_class() const
If is_nested() returns true, this is the class within which this type is defined.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.