/*
 * Copyright (c) 1995, 1996 Gunther Schadow.  All rights reserved.
 *
 * This program 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 2 of the License, or
 * (at your option) any later version.
 * 
 * This program 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 this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#ifndef PG_DEFS_H_
#define PG_DEFS_H_

#if defined(hpux) && defined(ultrix)
#include <sys/cdefs.h>
#endif

#define IDENT(ids) static const char * const ident = ids;

#ifndef __BEGIN_DECLS
# if defined(__cplusplus)
#   define	__BEGIN_DECLS	extern "C" {
#   define	__END_DECLS	};
# else
#   define	__BEGIN_DECLS
#   define	__END_DECLS
# endif
#endif

#define CHK(cmd, val, fcmd) \
  if((cmd) == val) { syslog(LOG_ERR, __FUNCTION__ ":" #cmd ": %m"); fcmd; }

#ifndef STR
# define STR(X) #X
#endif

#ifndef TRUE
# define TRUE   (0==0)
#endif
#ifndef FALSE
# define FALSE  !TRUE
#endif
#define FAIL   -1
#define SUCCESS 0

extern int protogen_debug;

#ifdef DEBUG
# define DBG(cmd) { if(protogen_debug) { cmd; } }
#else
# define DBG(cmd)
#endif

#endif
