util.c (190657) | util.c (228992) |
---|---|
1/* 2 * Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin. 3 * Copyright (c) 1989, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * James A. Woods. 8 * --- 20 unchanged lines hidden (view full) --- 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * | 1/* 2 * Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin. 3 * Copyright (c) 1989, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * James A. Woods. 8 * --- 20 unchanged lines hidden (view full) --- 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * |
37 * $FreeBSD: head/usr.bin/locate/locate/util.c 190657 2009-04-02 21:44:55Z delphij $ | 37 * $FreeBSD: head/usr.bin/locate/locate/util.c 228992 2011-12-30 11:02:40Z uqs $ |
38 */ 39 40 41#include <stdlib.h> 42#include <string.h> 43#include <err.h> 44#include <sys/param.h> 45#include <arpa/inet.h> --- 167 unchanged lines hidden (view full) --- 213 for(p = word; *p != '\0'; p++) 214 *p = TOLOWER(*p); 215 216 return(word); 217} 218 219 220/* | 38 */ 39 40 41#include <stdlib.h> 42#include <string.h> 43#include <err.h> 44#include <sys/param.h> 45#include <arpa/inet.h> --- 167 unchanged lines hidden (view full) --- 213 for(p = word; *p != '\0'; p++) 214 *p = TOLOWER(*p); 215 216 return(word); 217} 218 219 220/* |
221 * Read integer from mmap pointer. 222 * Essential a simple ``return *(int *)p'' but avoid sigbus | 221 * Read integer from mmap pointer. 222 * Essential a simple ``return *(int *)p'' but avoid sigbus |
223 * for integer alignment (SunOS 4.x, 5.x). 224 * | 223 * for integer alignment (SunOS 4.x, 5.x). 224 * |
225 * Convert network byte order to host byte order if neccessary. | 225 * Convert network byte order to host byte order if necessary. |
226 * So we can read on FreeBSD/i386 (little endian) a locate database 227 * which was built on SunOS/sparc (big endian). 228 */ 229 230int 231getwm(p) 232 caddr_t p; 233{ --- 15 unchanged lines hidden (view full) --- 249 MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i)); 250 } 251 return(i); 252} 253 254/* 255 * Read integer from stream. 256 * | 226 * So we can read on FreeBSD/i386 (little endian) a locate database 227 * which was built on SunOS/sparc (big endian). 228 */ 229 230int 231getwm(p) 232 caddr_t p; 233{ --- 15 unchanged lines hidden (view full) --- 249 MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i)); 250 } 251 return(i); 252} 253 254/* 255 * Read integer from stream. 256 * |
257 * Convert network byte order to host byte order if neccessary. | 257 * Convert network byte order to host byte order if necessary. |
258 * So we can read on FreeBSD/i386 (little endian) a locate database 259 * which was built on SunOS/sparc (big endian). 260 */ 261 262int 263getwf(fp) 264 FILE *fp; 265{ --- 13 unchanged lines hidden --- | 258 * So we can read on FreeBSD/i386 (little endian) a locate database 259 * which was built on SunOS/sparc (big endian). 260 */ 261 262int 263getwf(fp) 264 FILE *fp; 265{ --- 13 unchanged lines hidden --- |