MusicKit  0.0.0
_MKNameTable.h
00001 /* Copyright 1988-1992, NeXT Inc.  All rights reserved. */
00002 /*
00003   $Id$
00004   Defined In: The MusicKit
00005 */
00006 /*
00007 Modification history:
00008 
00009   $Log$
00010   Revision 1.3  2002/04/15 14:28:15  sbrandon
00011   - changed symbols and types NSDictionaries to NSMapTables, because NSMapTables
00012     do not have to retain their objects (and I have set them up not to do so).
00013     This had been causing dealloc loops for objects held in the main dict
00014     and trying to remove themselves in their -dealloc methods.
00015 
00016   Revision 1.2  1999/07/29 01:25:59  leigh
00017   Added Win32 compatibility, CVS logs, SBs changes
00018 
00019   09/22/89/daj - Moved _MKNameTable functions to _MKNameTable.h. Added global
00020                  defines of bits.
00021   10/06/89/daj - Changed to use hashtable.h version of table.
00022   01/31/90/daj - Added import of hashtable.h
00023   ??/??/98/sb  - OpenStep conversion
00024   04/21/99/lms - overhaul for NSDictionary operation for portability and clarity
00025 */
00026 #ifndef __MK__MKNameTable_H___
00027 #define __MK__MKNameTable_H___
00028 
00029 #define _MK_NOFREESTRINGBIT 0x8000 /* Set if string is never to be freed */
00030 #define _MK_AUTOIMPORTBIT 0x4000 /* Set if all LOCAL tables should import */
00031 #define _MK_BACKHASHBIT 0x2000  /* Set if object-to-name lookup is required */
00032 
00033 @interface _MKNameTable: NSObject
00034 {
00035     NSMapTable *symbols;
00036     NSMapTable *types;
00037 }
00038 
00039 - (id) initWithCapacity: (NSUInteger) capacity;
00040 - (void) dealloc;
00041 
00042 @end
00043 
00044 /* Private name table functions */
00045 extern void _MKNameGlobal(NSString * name,id dataObj,unsigned short type, BOOL autoImport,BOOL copyIt);
00046 extern id _MKGetNamedGlobal(NSString * name,unsigned short *type);
00047 extern NSString *_MKGetGlobalName(id object);
00048 
00049 /* Very private name table functions */
00050 extern NSString         *_MKUniqueName(NSString *name,_MKNameTable *table,id anObject,id *hashObj);
00051 extern _MKNameTable     *_MKNewScorefileParseTable(void);
00052 extern id               _MKGetListElementWithName(id aList,char *aName);
00053 extern _MKNameTable     *_MKNameTableAddName(_MKNameTable *table,NSString *theName,
00054                                       id owner, id object,
00055                                       unsigned short type,BOOL copyIt);
00056 extern id               _MKNameTableGetFirstObjectForName(_MKNameTable *table,NSString *theName);
00057 extern id               _MKNameTableGetObjectForName(_MKNameTable *table,NSString *theName,id theOwner,
00058                                         unsigned short *typeP);
00059 extern NSString         *_MKNameTableGetObjectName(_MKNameTable *table,id theObject,id *theOwner);
00060 extern _MKNameTable     *_MKNameTableRemoveName(_MKNameTable *table,NSString *theName,id theOwner);
00061 extern _MKNameTable     *_MKNameTableRemoveObject(_MKNameTable *table,id theObject);
00062 extern void             _MKFreeScorefileTable(_MKNameTable *aTable);
00063 extern NSString         *_MKSymbolize(NSString *sym,BOOL *wasChanged);
00064 
00065 #endif