#include "idep_aliastable.h"#include <string.h>#include <memory.h>#include <iostream>#include <cassert>Go to the source code of this file.
Classes | |
| struct | idep_AliasTableLink |
Enumerations | |
| enum | { DEFAULT_TABLE_SIZE = 521 } |
Functions | |
| unsigned | hash (register const char *name) |
| char * | newStrCpy (const char *oldStr) |
| std::ostream & | operator<< (std::ostream &o, const idep_AliasTable &table) |
|
|
Definition at line 11 of file idep_altab.cxx. 00011 { DEFAULT_TABLE_SIZE = 521 };
|
|
|
Definition at line 13 of file idep_altab.cxx. 00013 : returns unsigned! 00014 { 00015 register unsigned sum = 1000003; // 1,000,003 is the 78,498th prime number 00016 while (*name) { 00017 sum *= *name++; // integer multiplication is a subroutine on a SPARC 00018 } 00019 return sum; // unsigned ensures positive value for use with (%) operator. 00020 }
|
|
|
Definition at line 22 of file idep_altab.cxx. Referenced by idep_AliasTableLink::idep_AliasTableLink(). 00023 {
00024 int size = strlen(oldStr) + 1;
00025 char *newStr = new char[size];
00026 assert(newStr);
00027 memcpy(newStr, oldStr, size);
00028 return newStr;
00029 }
|
|
||||||||||||
|
Definition at line 112 of file idep_altab.cxx. References idep_AliasTableIter::alias(), len, idep_AliasTableIter::originalName(), and idep_AliasTableIter::reset(). 00113 {
00114 int fieldWidth = 0;
00115 idep_AliasTableIter it(table);
00116 for (; it; ++it) {
00117 int len = strlen(it.alias());
00118 if (fieldWidth < len) {
00119 fieldWidth = len;
00120 }
00121 }
00122 for (it.reset(); it; ++it) {
00123 o.width(fieldWidth);
00124 o << it.alias() << " -> " << it.originalName() << std::endl;
00125 }
00126 return o;
00127 }
|
1.3.9.1