/*
 * Copyright (c) 2012-2013 Red Hat.
 * Copyright (c) 2006-2010, Aconex.  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.
 *
 * @configure_input@
 */
#ifndef VERSION_H
#define VERSION_H

#include <pcp/pmapi.h>

#define VERSION "@pkg_version@"
#define HTMLDIR "@pkg_books_dir@/html"

#define PM_USE_CONTEXT_LOCAL 1

#define HAVE_PM_SET_PROGNAME @have_pm_set_progname@
#if HAVE_PM_SET_PROGNAME == 0
#include <libgen.h>
extern char *pmProgname;
static inline void __pmSetProgname(char *p) { pmProgname = basename(p); }
#endif

#define HAVE_PM_PATH_SEPARATOR @have_pm_path_separator@
#if HAVE_PM_PATH_SEPARATOR == 0
static inline int __pmPathSeparator(void) { return '/'; }
#endif

#define HAVE_PM_TIMEVAL_NOW @have_pm_timeval_now@
#if HAVE_PM_TIMEVAL_NOW == 0
#include <sys/time.h>
static inline void __pmtimevalNow(struct timeval *t) { gettimeofday(t, NULL); }
#endif

#if HAVE_DECL_PM_TYPE_EVENT == 0
#define PM_TYPE_EVENT	9
static inline void pmUnpackEventRecords(pmResult **) { }
static inline int pmFreeEventResult(pmValueSet *, int, pmResult ***) { return -ENOSYS; }
#endif

#if HAVE_DECL_PM_CTXFLAG_SECURE == 0
#define PM_CTXFLAG_SECURE	(1U<<10)
#define PM_CTXFLAG_COMPRESS	(1U<<11)
#define PM_CTXFLAG_RELAXED	(1U<<12)
#endif
#if HAVE_DECL_PM_CTXFLAG_AUTH == 0
#define PM_CTXFLAG_AUTH		(1U<<13)
#endif

#endif // VERSION_H
