about summary refs log tree commit diff stats
path: root/tile.h
blob: cd4e394f7c23d202c004fd46062cd79337aa4ecc (plain) (blame)
1
2
3
4
5
6
/* See LICENSE file for copyright and license details. */

/* tile.c */
void addtomwfact(const char *arg);	/* adds arg value [0.1 .. 0.9] to master width factor */
void tile(void);			/* arranges all windows tiled */
void zoom(const char *arg);		/* zooms the focused client to master area, arg is ignored */
iv>
59
60
61
62
  
                                                         

























                                                                              
                                                              










                                                  
                                                                 















                                                                   
                                                                  



                            
/*
 * $LynxId: LYHash.c,v 1.19 2013/06/12 09:21:21 tom Exp $
 *
 * A hash table for the (fake) CSS support in Lynx-rp
 * (c) 1996 Rob Partington
 * rewritten 1997 by Klaus Weide.
 */
#include <LYHash.h>
#include <LYUtils.h>

#ifdef USE_COLOR_STYLE

/*
 * This is the same function as the private HASH_FUNCTION() in HTAnchor.c, but
 * with a different value for HASH_SIZE.
 */

#define HASH_SIZE CSHASHSIZE
#define HASH_OF(h, v) ((int)((h) * 3 + UCH(v)) % HASH_SIZE)

int hash_code(const char *string)
{
    int hash;
    const char *p;

    for (p = string, hash = 0; *p; p++)
	hash = HASH_OF(hash, *p);

    CTRACE_STYLE((tfp, "hash_code(%s) = %d\n", string, hash));
    return hash;
}

int hash_code_lowercase_on_fly(const char *string)
{
    int hash;
    const char *p;

    for (p = string, hash = 0; *p; p++)
	hash = HASH_OF(hash, TOLOWER(*p));

    CTRACE_STYLE((tfp, "hash_code_lc(%s) = %d\n", string, hash));
    return hash;
}

int hash_code_aggregate_char(int c, int hash)
{
    return HASH_OF(hash, c);
}

int hash_code_aggregate_lower_str(const char *string, int hash_was)
{
    int hash;
    const char *p;

    for (p = string, hash = hash_was; *p; p++)
	hash = HASH_OF(hash, TOLOWER(*p));

    CTRACE_STYLE((tfp, "hash_code_lc2(%s) = %d\n", string, hash));
    return hash;
}

#endif /* USE_COLOR_STYLE */