hashmap.h

00001 /***************************************************************************
00002                           hashmap.h  -  description
00003                              -------------------
00004     begin                : Fri Feb 20 2004
00005     copyright            : (C) 2004 by Dynacube Team
00006     email                : 
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 
00019  #ifndef __HASHMAP_H
00020  #define __HASHMAP_H
00021 
00022   #include "common/ktypes.h"
00023   #include "common/kconst.h"
00024 
00025   #define WIND_TYPE 1
00026   #define FRM_TYPE  2
00027   #define COMP_TYPE 3
00028 
00029   typedef struct
00030   {
00031     DB avl;
00032     DW key; //alias_id
00033     DW val; //real id
00034   } PAIR;
00035 
00036   extern PAIR win_map[MAX_PROC][WINDOW_MAX];
00037   extern PAIR frm_map[MAX_PROC][FRAME_MAX];
00038   extern PAIR comp_map[MAX_PROC][COMPONENT_MAX];
00039 
00040   extern DW win_map_max[MAX_PROC];
00041   extern DW frm_map_max[MAX_PROC];
00042   extern DW comp_map_max[MAX_PROC];
00043 
00044   void hash_init();
00045   
00046   SDW hadd(DW pid, DB type, DW key, DW val);
00047   SDW hremove(DW pid, DB type, DW key);
00048   void hremoveAll(DW pid);
00049   SDW hfind(DW pid, DB type, DW key); //Return read_id or -1
00050   SDW  afind(DW pid, DB type, DW val); //Return alias_id or -1
00051 
00052   void printHash(DW pid, DB type);
00053 
00054  #endif

Generated on Thu Jul 27 23:52:26 2006 for Dynacube by  doxygen 1.4.7