//-----------------------------------------------------------------------------
//
//  $Logfile:: /Source/alias.h                                                $
// $Revision:: 2                                                              $
//   $Author:: Burgermac                                                      $
//     $Date:: 12/27/00 7:18 PM                                               $
//
// Copyright (C) 1997 by Ritual Entertainment, Inc.
// All rights reserved.
//
// This source is may not be distributed and/or modified without
// expressly written permission by Ritual Entertainment, Inc.
//
// DESCRIPTION:
// Generic alias system for files.
// 

#ifndef __ALIAS_H__
#define __ALIAS_H__

#ifndef __QCOMMON_H__
#include "qcommon.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif

#define MAX_ALIAS_NAME_LENGTH 32
#define MAX_REAL_NAME_LENGTH 128
#define MAX_ALIASLIST_NAME_LENGTH 32

typedef struct AliasListNode_s {
   char alias_name[MAX_ALIAS_NAME_LENGTH];
   char real_name[MAX_REAL_NAME_LENGTH];
   float weight;
   struct AliasListNode_s * next;
} AliasListNode_t;

typedef struct AliasList_s {
   char name[ MAX_ALIASLIST_NAME_LENGTH ];
   qboolean    dirty;
   int         num_in_list;
   AliasListNode_t ** sorted_list;
   AliasListNode_t * data_list;
} AliasList_t;

extern AliasList_t * AliasList_New( const char * name );
extern void Alias_ListClear( AliasList_t * list  );
extern void Alias_ListDelete( AliasList_t * list );
extern qboolean Alias_ListAdd( AliasList_t * list, const char * alias, const char * name, float weight);
extern const char *Alias_ListFind( AliasList_t * list, const char * alias );
extern const char *Alias_ListFindRandom( AliasList_t * list, const char * alias );
extern void Alias_ListDump( AliasList_t * list );
extern const char *Alias_Find( const char * alias );
extern qboolean Alias_Add( const char * alias, const char * name, float weight );
extern qboolean Alias_Delete( const char * alias );
extern const char *Alias_FindRandom( const char * alias );
extern void Alias_Dump( void );
extern void Alias_Clear( void );
extern void AliasRelease(void);

#ifdef __cplusplus
}
#endif

#endif /* alias.h */
