From: Matt S. <ma...@ki...> - 2002-05-22 19:21:54
|
Right. I have a few simple questions, and I'm going to repeat some info I posted a couple of months ago so that people can get a background on it. I need to create a shared library, but not an ordinary one: it's an Amiga-style library which doesn't have the same kind of dynamic linking possibility as a Linux or Windows library, nor the symbol-based function type stuff. It effectively works by providing a list of function offsets, which I need to define in the library. It's basically an array of (void *) with the functions in it. These function addresses are exposed to the world on library initialisation, and applications call it by using compiled-in offsets from the library base to the function offset in this array. The way I'm *making* the library is simply to produce a libMesa.a the normal way via the makefiles, and then linking it to my library objects so that the functions point to real things. The trick is: if I make libMesa.a, are the functions going to have the names I want so that gcc will link correctly? I've been peering around the source and there seems to be a great many ways of specifying the functions (what is that scary glapioffsets.h file??) which I have no clue which files have what relevance. As an example, the function table looks a little like: void * FuncTab [] = { /* standard entry points from library.c */ LibOpen, LibClose, LibExpunge, LibReserved, /* native Mesa API from native.c */ CreateContext, FreeContext, /* Mesa functions from libMesa.a */ glNewList, // und so weiter.. /* end the list */ (void *)((long)-1) }; If I put glNewList in that table, is it going to point to the glNewList function? Or is that function called NewList or mesaNewList or mglNewList or what? It doesn't matter what the names are HERE since the names that the applications use What relevance does _gloffset_NewList from the glapioffsets.h file have to me, if any? I can generate the Mesa functions, their prototypes, inlines, macros, and whatever using/modifying the Python scripts for external use (by applications) and I know exactly that they'll be as the OpenGL book defines them.. glNewList has to have that name. .. but I'm not entirely sure what I should be outputting for a more "internal" use of the library. Are there "internal" names for the functions, or are they the same as the ones exposed to the world? Thanks for any advice you can give ;) -- Matt -- Matt |