Panda3D
 All Classes Functions Variables Enumerations
interrogate_request.h
1 /* Filename: interrogate_request.h
2  * Created by: drose (01Aug00)
3  *
4  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
5  *
6  * PANDA 3D SOFTWARE
7  * Copyright (c) Carnegie Mellon University. All rights reserved.
8  *
9  * All use of this software is subject to the terms of the revised BSD
10  * license. You should have received a copy of this license along
11  * with this source code in a file named "LICENSE."
12  *
13  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14 
15 #ifndef INTERROGATE_REQUEST
16 #define INTERROGATE_REQUEST
17 
18 #include "dtoolbase.h"
19 
20 /*
21  * The functions here are simple functions that are intended to be
22  * called during static init time for the various libraries that
23  * contain interrogate data. They provide interfaces to add the
24  * module's interrogate data to the main interrogate database.
25  *
26  * The interface is entirely C here--no C++--so that it may be called
27  * from C modules if required.
28  */
29 
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 
36 /*
37  * This is the simplest interface. It just requests that the given
38  * database filename (*.in) be read in. This makes the interrogate
39  * data available, but doesn't allow matching the database information
40  * up with any compiled-in function wrappers or anything.
41  */
42 EXPCL_DTOOLCONFIG void interrogate_request_database(const char *database_filename);
43 
44 
45 
46 /* The more sophisticated interface uses these structures. */
47 
48 typedef struct {
49  const char *name;
50  int index_offset;
52 
53 typedef struct {
54  int file_identifier;
55 
56  const char *library_name;
57  const char *library_hash_name;
58  const char *module_name;
59  const char *database_filename;
60 
61  InterrogateUniqueNameDef *unique_names;
62  int num_unique_names;
63 
64  void **fptrs;
65  int num_fptrs;
66 
67  int first_index;
68  int next_index;
70 
71 
72 /*
73  * This requests that the given module be loaded and made available.
74  * This includes all of the function pointers and/or unique names that
75  * might be compiled in.
76  */
77 EXPCL_DTOOLCONFIG void interrogate_request_module(InterrogateModuleDef *def);
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 #endif
84