Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

hasher.c File Reference

#include <stdio.h>

Go to the source code of this file.


Defines

#define UINT   unsigned int
#define SLOTS   8191

Functions

UINT hasher (char *str)
int main (int argc, char *argv[])

Define Documentation

#define SLOTS   8191
 

Definition at line 5 of file hasher.c.

Referenced by hasher().

#define UINT   unsigned int
 

Definition at line 2 of file hasher.c.

Referenced by hasher(), and main().


Function Documentation

UINT hasher char *    str [static]
 

Definition at line 12 of file hasher.c.

References SLOTS, and UINT.

Referenced by main().

00013 {
00014    UINT hh , jj,kk ; char *cpt ;
00015 
00016    if( str    == NULL ) return 0 ;
00017    if( str[0] == '\0' ) return 1 ;
00018 
00019    hh = 0 ;
00020    for( cpt=str ; *cpt != '\0' ; cpt++ ){
00021       jj = (65537*(UINT)(*cpt)) ; cpt++ ;
00022       kk = 17389*(UINT)(*cpt) ;
00023       hh = 13*hh + (jj << 8) + kk ;
00024       if( *cpt == '\0' ) break ;
00025    }
00026 
00027    hh =  ((hh & 0xaaaaaaaa) >> 1)   /* swap bits */
00028        | ((hh & 0x55555555) << 1) ;
00029 
00030    return (hh % SLOTS) ;
00031 }

int main int    argc,
char *    argv[]
 

\** File : SUMA.c

Author:
: Ziad Saad Date : Thu Dec 27 16:21:01 EST 2001
Purpose :

Input paramters :

Parameters:
param  Usage : SUMA ( )
Returns :
Returns:
Support :
See also:
OpenGL prog. Guide 3rd edition , varray.c from book's sample code
Side effects :

Definition at line 33 of file hasher.c.

References argc, hasher(), and UINT.

00034 {
00035    int ii ; UINT hh ;
00036    for( ii=1 ; ii < argc ; ii++ )
00037      printf("%s -> %u\n",argv[ii],hasher(argv[ii])) ;
00038    exit(0);
00039 }
 

Powered by Plone

This site conforms to the following standards: