summaryrefslogtreecommitdiff
path: root/insert_string.c
blob: 4ddf9ae5dbd3edd36c070f60bceb70949eb248d7 (plain)
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
/* insert_string_c -- insert_string variant for c
 *
 * Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
 * For conditions of distribution and use, see copyright notice in zlib.h
 *
 */

#include "zbuild.h"
#include "deflate.h"

/* ===========================================================================
 * Update a hash value with the given input byte
 * IN  assertion: all calls to to UPDATE_HASH are made with consecutive
 *    input characters, so that a running hash key can be computed from the
 *    previous key instead of complete recalculation each time.
 */
#define HASH_SLIDE 16  // Number of bits to slide hash

#define UPDATE_HASH(s, h, val) \
    h = ((val * 2654435761U) >> HASH_SLIDE);

#define INSERT_STRING       insert_string_c
#define QUICK_INSERT_STRING quick_insert_string_c

#include "insert_string_tpl.h"