/*-
 *  Copyright (c) 2002, 2003  Peter Pentchev
 *  All rights reserved.
 * 
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *  1. Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *  2. Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 * 
 *  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 *  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 *  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 *  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 *  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 *  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 *  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 *  SUCH DAMAGE.
 */

#ifndef __INCLUDED_urelay_h
#define __INCLUDED_urelay_h

/* $Ringlet: c/net/urelay/urelay.h,v 1.3 2003/07/16 10:21:04 roam Exp $ */

/* * *		Build control macros		* * */
/* {{{ */

#ifndef __unused
#ifdef __GNUC__
#define __unused	__attribute__((unused))
#else
#define __unused
#endif /* __GNUC__ */
#endif /* __unused */

#ifndef RDBG
#ifdef EBUG
#define RDBG(x)         if (quiet < 2) { printf x; }
#else /* !EBUG */
#define RDBG(x)
#endif /* EBUG */
#endif /* RDBG */

#ifndef RINF
#define RINF(x)         printf x;
#endif /* RINF */

/* __IDSTRING() and __RCSID() are borrowed from FreeBSD's <sys/cdefs.h> */
#ifndef __IDSTRING
#if defined(__GNUC__) && defined(__ELF__)
#define	__IDSTRING(name,string)	__asm__(".ident\t\"" string "\"")
#else  /* __GNUC__ && __ELF__ */
#define	__IDSTRING(name,string)	static const char name[] __unused = string
#endif /* __GNUC__ && __ELF__ */
#endif /* IDSTRING */

#ifndef __RCSID
#define	__RCSID(s)	__IDSTRING(rcsid,s)
#endif /* __RCSID */

/* __RINGID() is modelled after FreeBSD's __FBSDID() */
#ifndef	__RINGID
#ifdef __FBSDID
#define __RINGID(s)	__FBSDID(s)
#else  /* __FBSDID */
#if !defined(lint) && !defined(STRIP_RINGID)
#define	__RINGID(s)	__IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
#else
#define	__RINGID(s)	struct __hack
#endif
#endif /* __FBSDID */
#endif

/* }}} */
/* * *		Definitions		* * */
/* {{{ */

typedef enum {
	UR_ERR_NONE,
	UR_ERR_NOMEM, UR_ERR_CMDLINE,
	UR_ERR_READ, UR_ERR_WRITE, UR_ERR_SELECT,
	UR_ERR_NOREAD,
	UR_ERR_FCNTL_GET, UR_ERR_FCNTL_SET,
	UR_ERR_DIFF,
	UR_ERR_INT,
	UR_ERR_LAST
} ur_err_t;

#define UR_OPTSTR	"hM:m:qS:s:vV"

/* }}} */
/* * *		Variables		* * */
/* {{{ */

extern int	verbose, quiet;
extern char	ur_verstr[];

/* }}} */
/* * *		Functions		* * */
/* {{{ */


/* }}} */
#endif /* __INCLUDED_urelay_h */


syntax highlighted by Code2HTML, v. 0.9.1