Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

epUtils.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "epDefs.h"
#include "epUtils.h"

Include dependency graph for epUtils.c:

Include dependency graph

Go to the source code of this file.

Functions

int epUtils_ptrDeallocatorFunction (void *ptr)
boolean_t epUtils_isProbablePrime (ulong oddNumber)
boolean_t epUtils_stringComparisonFunction (const void *str1, const void *str2)
uint epUtils_stringHashFunction (const void *key)


Detailed Description

Author(s):
Guillaume Bour. U.B.O 2000/2001

Version:
0.0.0
Date:
19/02/2001

Utils Generic functions.

Definition in file epUtils.c.


Function Documentation

boolean_t epUtils_isProbablePrime ( ulong oddNumber )
 

Estimate if a number is a prime number.
return <true> if so, <false> else.

visibility :: public

Parameters:
oddNumber   a number
Return values:
<true>   if it is prime,
<false>   else.

Definition at line 44 of file epUtils.c.

int epUtils_ptrDeallocatorFunction ( void * ptr )
 

Generic pointer deallocator function (in fact, it just make a free).

visibility :: public

Parameters:
ptr   the pointer to deallocate
Return values:
0   if OK,
-1   else.

Definition at line 27 of file epUtils.c.

boolean_t epUtils_stringComparisonFunction ( const void * str1,
const void * str2 )
 

A Generic string comparison function (which take care of the case).

visibility :: public

Parameters:
str1   the first string
str2   the second string
Return values:
<true>   if they are equals,
<false>   else.

Definition at line 72 of file epUtils.c.

uint epUtils_stringHashFunction ( const void * key )
 

A Generic hash function for string-typed keys.

visibility :: public

Remarks:
1. hash function used is: h(c) = ( s[0]*b^(n-1) + s[1]*b^(n-2) + ... + s[n-1] )

where: s is the key n its length b = 128 or 256
Parameters:
key   the key(a string)
Returns:
its hash value.

Definition at line 95 of file epUtils.c.


Generated at Sun Nov 25 14:05:14 2001 for ExtendedPersonnalLibrary by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000