windows-nt/Source/XPSP1/NT/net/rras/ras/autodial/rasauto/table.h
2020-09-26 16:20:57 +08:00

83 lines
1.2 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*++
Copyright(c) 1995 Microsoft Corporation
MODULE NAME
table.h
ABSTRACT
Header file for generic hash table routines.
AUTHOR
Anthony Discolo (adiscolo) 28-Jul-1995
REVISION HISTORY
--*/
//
// Number of hash table buckets.
//
#define NBUCKETS 13
//
// Generic hash table structure.
//
typedef struct _HASH_TABLE {
LIST_ENTRY ListEntry[NBUCKETS]; // the hash buckets
ULONG ulSize; // number of total entries
} HASH_TABLE, *PHASH_TABLE;
//
// Hash table enumerator procedure.
// Returns TRUE to continue enumeration,
// FALSE to terminate enumeration.
//
typedef BOOLEAN (*PHASH_TABLE_ENUM_PROC)(PVOID, LPTSTR, PVOID);
PHASH_TABLE
NewTable();
VOID
ClearTable(
IN PHASH_TABLE pTable
);
VOID
FreeTable(
IN PHASH_TABLE pTable
);
ULONG
TableSize(
IN PHASH_TABLE pTable
);
VOID
EnumTable(
IN PHASH_TABLE pTable,
IN PHASH_TABLE_ENUM_PROC pProc,
IN PVOID pArg
);
BOOLEAN
GetTableEntry(
IN PHASH_TABLE pTable,
IN LPTSTR pszKey,
OUT PVOID *pData
);
BOOLEAN
PutTableEntry(
IN PHASH_TABLE pTable,
IN LPTSTR pszKey,
IN PVOID pData
);
BOOLEAN
DeleteTableEntry(
IN PHASH_TABLE pTable,
IN LPTSTR pszKey
);