Sha256: 82a94669d6594c013ce84fe2c7be9b9d7026dbf5d69c3e3816b5c2dda247d691
Contents?: true
Size: 1.41 KB
Versions: 1
Compression:
Stored size: 1.41 KB
Contents
/* WebROaR - Ruby Application Server - http://webroar.in/ * Copyright (C) 2009 WebROaR * * This file is part of WebROaR. * * WebROaR is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * WebROaR is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with WebROaR. If not, see <http://www.gnu.org/licenses/>. */ /****************************************************************************** * Utility Functions *****************************************************************************/ /** * Small utility functions are declared here */ #ifndef WR_UTIL_H_ #define WR_UTIL_H_ void close_fd(int fd); void setsocketoption(int fd); int setnonblock(int fd); unsigned long uri_hash(char *str); unsigned long uri_hash_len(char *str, int length); #define URI_HASH_LEN(str, length, hash) \ hash = 5381;\ int i;\ for( i = 0; i < length && str[i] != 0 && str[i] != '/' ; i++){\ hash = ((hash << 5) + hash) + str[i]; /* hash * 33 + c */\ } #endif //WR_UTIL_H_
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
webroar-0.2.2 | src/helper/wr_util.h |