1213136Spjd/*-
2213136Spjd * Copyright (c) 2010 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3213136Spjd * All rights reserved.
4213136Spjd *
5213136Spjd * Redistribution and use in source and binary forms, with or without
6213136Spjd * modification, are permitted provided that the following conditions
7213136Spjd * are met:
8213136Spjd * 1. Redistributions of source code must retain the above copyright
9213136Spjd *    notice, this list of conditions and the following disclaimer.
10213136Spjd * 2. Redistributions in binary form must reproduce the above copyright
11213136Spjd *    notice, this list of conditions and the following disclaimer in the
12213136Spjd *    documentation and/or other materials provided with the distribution.
13213136Spjd *
14213136Spjd * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
15213136Spjd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16213136Spjd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17213136Spjd * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
18213136Spjd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19213136Spjd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20213136Spjd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21213136Spjd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22213136Spjd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23213136Spjd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24213136Spjd * SUCH DAMAGE.
25213136Spjd *
26213136Spjd * $FreeBSD$
27213136Spjd */
28213136Spjd
29213136Spjd#ifndef _UTIL_H_
30213136Spjd#define	_UTIL_H_
31213136Spjd
32213136Spjd#include <sys/types.h>
33213136Spjd
34213136Spjd#include <stdarg.h>
35213136Spjd
36213136Spjdvoid memcpy(void *dst, const void *src, int len);
37213136Spjdvoid memset(void *b, int c, size_t len);
38213136Spjdint memcmp(const void *b1, const void *b2, size_t len);
39213136Spjd
40219083Spjd#define	bcopy(src, dst, len)	memcpy((dst), (src), (len))
41213136Spjd#define	bzero(buf, size)	memset((buf), 0, (size))
42213136Spjd#define	bcmp(b1, b2, len)	(memcmp((b1), (b2), (len)) != 0)
43213136Spjd
44213136Spjdint strcmp(const char *s1, const char *s2);
45213136Spjdint strncmp(const char *s1, const char *s2, size_t len);
46213136Spjdvoid strcpy(char *dst, const char *src);
47213136Spjdvoid strcat(char *dst, const char *src);
48213136Spjdchar *strchr(const char *s, char ch);
49213136Spjdsize_t strlen(const char *s);
50213136Spjd
51213136Spjdvoid printf(const char *fmt, ...);
52213136Spjd
53213136Spjd#endif	/* !_UTIL_H_ */
54