2 SuperCollider real time audio synthesis system
3 Copyright (c) 2002 James McCartney. All rights reserved.
4 http://www.audiosynth.com
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #include "PyrSymbol.h"
25 #include "AdvancingAllocPool.h"
26 #include "SC_Export.h"
28 #define STRINGCHUNK 32000
29 #define SYMBOLCHUNK 32000
31 SC_DLLEXPORT_C PyrSymbol
* getsym(const char *name
);
32 SC_DLLEXPORT_C PyrSymbol
* findsym(const char *name
);
37 SymbolSpace(AllocPool
*inPool
);
38 PyrSymbol
* NewSymbol(const char *inName
, int inHash
, int inLength
);
42 AdvancingAllocPool mStringPool
;
43 AdvancingAllocPool mSymbolPool
;
50 SymbolTable(AllocPool
*inPool
, int inSize
);
52 void CopyFrom(SymbolTable
& inTable
);
54 int NumItems() { return mNumItems
; }
55 int TableSize() { return mMaxItems
; }
56 PyrSymbol
* Get(int inIndex
) { return mTable
[inIndex
]; }
61 friend PyrSymbol
* getsym(const char *name
);
62 friend PyrSymbol
* findsym(const char *name
);
64 PyrSymbol
* Find(const char *inName
);
65 PyrSymbol
* Make(const char *inName
);
66 PyrSymbol
* MakeNew(const char *inName
, int inHash
, int inLength
);
68 int StrHash(const char *inName
, int *outLength
);
71 PyrSymbol
* Find(const char *inName
, int inHash
);
72 void Add(PyrSymbol
* inSymbol
);
73 void Rehash(PyrSymbol
** inTable
, int inSize
);
79 int mNumItems
, mMaxItems
, mMask
;