Plan 9 from Bell Labs’s /usr/web/sources/contrib/gabidiaz/root/sys/src/cmd/perl/NetWare/nwhashcls.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.



/*
 * Copyright �2001 Novell, Inc. All Rights Reserved.
 *
 * You may distribute under the terms of either the GNU General Public
 * License or the Artistic License, as specified in the README file.
 *
 */

/*
 * FILENAME     :  nwhashcls.h
 * DESCRIPTION  :  Equivalent of Hash class
 *                 
 * Author       :  Srivathsa M
 * Date	Created :  July 26 2001
 */
#include <stdio.h>
#include <conio.h>
#include <process.h>

#define BUCKET_SIZE 37

struct HASHNODE
{
	void *data;
	struct HASHNODE	*next;
};

typedef void (*HASHFORALLFUN)(void *, void *);

class NWPerlHashList
{
private:
	HASHNODE*	MemListHash[BUCKET_SIZE];
    void removeAll() const;

public:
	~NWPerlHashList();
	NWPerlHashList();
	int insert(void *lData);
	int remove(void *lData);
    void forAll( void (*)(void *, void*), void * ) const;
};

struct KEYHASHNODE
{
	void *key;
	void *data;
	KEYHASHNODE	*next;
};

/**
typedef void (*KEYHASHFORALLFUN)(void *, void *);

class NWPerlKeyHashList
{
private:
	KEYHASHNODE*	MemListHash[BUCKET_SIZE];
    void removeAll() const;

public:
	~NWPerlKeyHashList();
	NWPerlKeyHashList();
	int insert(void *key, void *lData);
	int remove(void *key);
    void forAll( void (*)(void *, void*), void * ) const;
	int find(void *key, void **pData);
};
**/

//#define DEBUG_HASH 1

#ifdef DEBUG_HASH
#define DEBUGPRINT	ConsolePrintf
#else
#define DEBUGPRINT
#endif



Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].