Panda3D
|
00001 /* Filename: interrogate_request.h 00002 * Created by: drose (01Aug00) 00003 * 00004 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00005 * 00006 * PANDA 3D SOFTWARE 00007 * Copyright (c) Carnegie Mellon University. All rights reserved. 00008 * 00009 * All use of this software is subject to the terms of the revised BSD 00010 * license. You should have received a copy of this license along 00011 * with this source code in a file named "LICENSE." 00012 * 00013 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 00014 00015 #ifndef INTERROGATE_REQUEST 00016 #define INTERROGATE_REQUEST 00017 00018 #include "dtoolbase.h" 00019 00020 /* 00021 * The functions here are simple functions that are intended to be 00022 * called during static init time for the various libraries that 00023 * contain interrogate data. They provide interfaces to add the 00024 * module's interrogate data to the main interrogate database. 00025 * 00026 * The interface is entirely C here--no C++--so that it may be called 00027 * from C modules if required. 00028 */ 00029 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00035 00036 /* 00037 * This is the simplest interface. It just requests that the given 00038 * database filename (*.in) be read in. This makes the interrogate 00039 * data available, but doesn't allow matching the database information 00040 * up with any compiled-in function wrappers or anything. 00041 */ 00042 EXPCL_DTOOLCONFIG void interrogate_request_database(const char *database_filename); 00043 00044 00045 00046 /* The more sophisticated interface uses these structures. */ 00047 00048 typedef struct { 00049 const char *name; 00050 int index_offset; 00051 } InterrogateUniqueNameDef; 00052 00053 typedef struct { 00054 int file_identifier; 00055 00056 const char *library_name; 00057 const char *library_hash_name; 00058 const char *module_name; 00059 const char *database_filename; 00060 00061 InterrogateUniqueNameDef *unique_names; 00062 int num_unique_names; 00063 00064 void **fptrs; 00065 int num_fptrs; 00066 00067 int first_index; 00068 int next_index; 00069 } InterrogateModuleDef; 00070 00071 00072 /* 00073 * This requests that the given module be loaded and made available. 00074 * This includes all of the function pointers and/or unique names that 00075 * might be compiled in. 00076 */ 00077 EXPCL_DTOOLCONFIG void interrogate_request_module(InterrogateModuleDef *def); 00078 00079 #ifdef __cplusplus 00080 } 00081 #endif 00082 00083 #endif 00084