-
Notifications
You must be signed in to change notification settings - Fork 0
/
hashtab_count.c
executable file
·43 lines (40 loc) · 1.55 KB
/
hashtab_count.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* hashtab_count.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: akharrou <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/09 11:46:36 by akharrou #+# #+# */
/* Updated: 2019/03/09 12:11:59 by akharrou ### ########.fr */
/* */
/* ************************************************************************** */
/*
** NAME
** hashtab_count -- get the current number of entries in a hash table.
**
** SYNOPSIS
** #include "../Includes/hashtable.h"
**
** int
** hashtab_count(t_hashtable *table);
**
** PARAMETERS
**
** t_hashtable *table Pointer to a hash table.
**
** DESCRIPTION
** Returns the number of entries in the hash table pointed
** to by 'table'.
**
** RETURN VALUES
** Returns the number of entries in the hash table; if the
** hash table doesn't exist, returns 0.
*/
#include "../Includes/hashtable.h"
int hashtab_count(t_hashtable *table)
{
if (table)
return (table->entries);
return (0);
}