1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #include "hashtbl.hxx" 25 26 #define MAXFILT 200 27 28 struct LibExport 29 { 30 char *cExportName; // zu exportierende Fkt. 31 unsigned long nOrdinal; // Nummer der zu export. Fkt. 32 bool bByName; // NONAME anhaengen 33 bool bExport; // exportieren oder nicht ? 34 }; 35 36 class ExportSet; 37 class LibDump 38 { 39 ExportSet *pBaseTab; // Zugriff auf gemangelte Namen 40 ExportSet *pIndexTab; // Zugriff auf die Ordinals 41 char *cBName; // Name der Datenbasis 42 char *cAPrefix; // Prefix fuer C-Fkts. 43 char *cLibName; // Name der zu untersuchenden Lib 44 char *cFilterName; // Name der Filterdatei 45 char *cModName; // Modulname 46 unsigned short nBegin; // Nummer des ersten Exports 47 unsigned long nBaseLines; // Line in Datenbasis 48 unsigned long nFilterLines; // Line in FilterTabelle 49 char **pFilterLines; // Filtertabelle 50 unsigned long nDefStart; 51 bool bBase; // Existenz der DatenBasis; 52 bool bAll; // Alle Fkts exportieren 53 bool bDef; // DefFile schreiben ( bei -E ) 54 int bExportName; // 0 - export by ordinal; 1 - export by name 55 56 bool CheckDataBase(); 57 bool CheckLibrary(char * cName); 58 bool ReadDataBase(); 59 bool ReadFilter(char *); 60 bool PrintSym(char *, bool bName = true ); 61 public: 62 LibDump( char *cFileName, int bExportByName ); 63 ~LibDump(); 64 bool Dump(); 65 bool SetFilter(char *cFilterName); SetBeginExport(unsigned short nVal)66 void SetBeginExport(unsigned short nVal){nBegin = nVal;} 67 void SetCExport( char* pName ); 68 bool Filter(char *pName); 69 bool IsFromAnonymousNamespace(char *pName); 70 bool PrintDefFile(); 71 bool PrintDataBase(); 72 static void DumpError(unsigned long nError); 73 }; 74 75