Imported Upstream version 2.7.1
This commit is contained in:
parent
a1fa151fc7
commit
0121794af9
451 changed files with 41339 additions and 10887 deletions
|
@ -1,24 +1,22 @@
|
|||
EXTRA_DIST = attribute.h common.h extstate.h parseconf.h proto.h \
|
||||
state.h timehead.h upsconf.h nut_stdint.h
|
||||
dist_noinst_HEADERS = attribute.h common.h extstate.h parseconf.h proto.h \
|
||||
state.h timehead.h upsconf.h nut_stdint.h nut_platform.h
|
||||
|
||||
# http://www.gnu.org/software/automake/manual/automake.html#Clean
|
||||
BUILT_SOURCES = nut_version.h
|
||||
CLEANFILES = nut_version.h
|
||||
|
||||
# magic to include SVN revision number in NUT version string
|
||||
# magic to include Git version information in NUT version string
|
||||
|
||||
nut_version.h: FORCE
|
||||
@GITREV=`git describe --tags 2>/dev/null | sed 's/^v\([0-9]\)/\1/' `; \
|
||||
if [ -z "$$GITREV" ]; \
|
||||
then SVNREV=`LANG=C svnversion -n $(top_srcdir) 2>/dev/null`; \
|
||||
if [ -z "$$SVNREV" -o "$$SVNREV" = "exported" ]; \
|
||||
then NUT_VERSION="$(PACKAGE_VERSION)"; \
|
||||
else NUT_VERSION="$(PACKAGE_VERSION)-$$SVNREV"; \
|
||||
fi ; \
|
||||
else NUT_VERSION="$$GITREV"; \
|
||||
fi ; \
|
||||
@GITREV=`git describe --tags 2>/dev/null | sed -e 's/^v\([0-9]\)/\1/' -e 's,^.*/,,' ` || GITREV=""; \
|
||||
echo '/* Autogenerated file. Do not change. */' > _nut_version.h ; \
|
||||
echo '/* This file was generated by "make". */' >> _nut_version.h ; \
|
||||
if [ -z "$$GITREV" ]; \
|
||||
then NUT_VERSION="$(PACKAGE_VERSION)"; \
|
||||
echo '/* The version number is set by AC_INIT in configure.in. */' >> _nut_version.h ; \
|
||||
else NUT_VERSION="$$GITREV"; \
|
||||
echo '/* The version number is determined by the most recent Git tag. */' >> _nut_version.h ; \
|
||||
fi ; \
|
||||
echo "#define NUT_VERSION_MACRO \"$$NUT_VERSION\"" >> _nut_version.h ; \
|
||||
echo "NUT_VERSION: \"$$NUT_VERSION\""
|
||||
-test -f nut_version.h || cp _nut_version.h nut_version.h
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.11.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||
# Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
@ -14,7 +14,25 @@
|
|||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
|
@ -35,8 +53,8 @@ build_triplet = @build@
|
|||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = include
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/config.h.in
|
||||
DIST_COMMON = $(dist_noinst_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
|
||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||
|
@ -51,8 +69,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
|
|||
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnss.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libopenssl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libpowerman.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libssl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
||||
$(top_srcdir)/m4/nut_check_os.m4 \
|
||||
|
@ -68,12 +87,21 @@ CONFIG_CLEAN_FILES =
|
|||
CONFIG_CLEAN_VPATH_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
HEADERS = $(dist_noinst_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
A2X = @A2X@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
ASCIIDOC = @ASCIIDOC@
|
||||
ASPELL = @ASPELL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -100,6 +128,7 @@ DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
|||
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
||||
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
||||
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
||||
DRVPATH = @DRVPATH@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
|
@ -252,8 +281,8 @@ top_build_prefix = @top_build_prefix@
|
|||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
udevdir = @udevdir@
|
||||
EXTRA_DIST = attribute.h common.h extstate.h parseconf.h proto.h \
|
||||
state.h timehead.h upsconf.h nut_stdint.h
|
||||
dist_noinst_HEADERS = attribute.h common.h extstate.h parseconf.h proto.h \
|
||||
state.h timehead.h upsconf.h nut_stdint.h nut_platform.h
|
||||
|
||||
|
||||
# http://www.gnu.org/software/automake/manual/automake.html#Clean
|
||||
|
@ -295,10 +324,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
|||
$(am__aclocal_m4_deps):
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
|
||||
else :; fi
|
||||
@if test ! -f $@; then rm -f stamp-h1; else :; fi
|
||||
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
|
@ -316,12 +343,58 @@ mostlyclean-libtool:
|
|||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
|
@ -359,7 +432,7 @@ distdir: $(DISTFILES)
|
|||
check-am: all-am
|
||||
check: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-am
|
||||
all-am: Makefile config.h
|
||||
all-am: Makefile $(HEADERS) config.h
|
||||
installdirs:
|
||||
install: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-am
|
||||
|
@ -372,10 +445,15 @@ install-am: all-am
|
|||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
@ -395,7 +473,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
|
|||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr
|
||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
|
@ -457,33 +535,32 @@ uninstall-am:
|
|||
|
||||
.MAKE: all check install install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
dist-hook distclean distclean-generic distclean-hdr \
|
||||
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
uninstall uninstall-am
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool ctags dist-hook distclean distclean-generic \
|
||||
distclean-hdr distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am
|
||||
|
||||
|
||||
# magic to include SVN revision number in NUT version string
|
||||
# magic to include Git version information in NUT version string
|
||||
|
||||
nut_version.h: FORCE
|
||||
@GITREV=`git describe --tags 2>/dev/null | sed 's/^v\([0-9]\)/\1/' `; \
|
||||
if [ -z "$$GITREV" ]; \
|
||||
then SVNREV=`LANG=C svnversion -n $(top_srcdir) 2>/dev/null`; \
|
||||
if [ -z "$$SVNREV" -o "$$SVNREV" = "exported" ]; \
|
||||
then NUT_VERSION="$(PACKAGE_VERSION)"; \
|
||||
else NUT_VERSION="$(PACKAGE_VERSION)-$$SVNREV"; \
|
||||
fi ; \
|
||||
else NUT_VERSION="$$GITREV"; \
|
||||
fi ; \
|
||||
@GITREV=`git describe --tags 2>/dev/null | sed -e 's/^v\([0-9]\)/\1/' -e 's,^.*/,,' ` || GITREV=""; \
|
||||
echo '/* Autogenerated file. Do not change. */' > _nut_version.h ; \
|
||||
echo '/* This file was generated by "make". */' >> _nut_version.h ; \
|
||||
if [ -z "$$GITREV" ]; \
|
||||
then NUT_VERSION="$(PACKAGE_VERSION)"; \
|
||||
echo '/* The version number is set by AC_INIT in configure.in. */' >> _nut_version.h ; \
|
||||
else NUT_VERSION="$$GITREV"; \
|
||||
echo '/* The version number is determined by the most recent Git tag. */' >> _nut_version.h ; \
|
||||
fi ; \
|
||||
echo "#define NUT_VERSION_MACRO \"$$NUT_VERSION\"" >> _nut_version.h ; \
|
||||
echo "NUT_VERSION: \"$$NUT_VERSION\""
|
||||
-test -f nut_version.h || cp _nut_version.h nut_version.h
|
||||
|
|
|
@ -44,6 +44,12 @@
|
|||
#include "attribute.h"
|
||||
#include "proto.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
extern const char *UPS_VERSION;
|
||||
|
||||
/* get the syslog ready for us */
|
||||
|
@ -97,6 +103,7 @@ void upsdebug_with_errno(int level, const char *fmt, ...)
|
|||
void upsdebugx(int level, const char *fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
void upsdebug_hex(int level, const char *msg, const void *buf, int len);
|
||||
void upsdebug_ascii(int level, const char *msg, const void *buf, int len);
|
||||
|
||||
void fatal_with_errno(int status, const char *fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3))) __attribute__((noreturn));
|
||||
|
@ -144,4 +151,10 @@ extern int optind;
|
|||
# define setegid(x) setresgid(-1,x,-1) /* Works for HP-UX 10.20 */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#endif /* NUT_COMMON_H */
|
||||
|
|
|
@ -176,6 +176,12 @@
|
|||
/* Define to 1 if you have the `ne_xml_dispatch_request' function. */
|
||||
#undef HAVE_NE_XML_DISPATCH_REQUEST
|
||||
|
||||
/* Define to 1 if you have the <nss.h> header file. */
|
||||
#undef HAVE_NSS_H
|
||||
|
||||
/* Define to 1 if you have the `NSS_Init' function. */
|
||||
#undef HAVE_NSS_INIT
|
||||
|
||||
/* Define to 1 if you have the `on_exit' function. */
|
||||
#undef HAVE_ON_EXIT
|
||||
|
||||
|
@ -203,9 +209,6 @@
|
|||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#undef HAVE_SNPRINTF
|
||||
|
||||
/* Define to enable SSL development code */
|
||||
#undef HAVE_SSL
|
||||
|
||||
/* Define to 1 if you have the `SSL_library_init' function. */
|
||||
#undef HAVE_SSL_LIBRARY_INIT
|
||||
|
||||
|
@ -406,13 +409,19 @@
|
|||
/* Define to enable Neon HTTP support */
|
||||
#undef WITH_NEON
|
||||
|
||||
/* Define to enable SSL support using Mozilla NSS */
|
||||
#undef WITH_NSS
|
||||
|
||||
/* Define to enable SSL support using OpenSSL */
|
||||
#undef WITH_OPENSSL
|
||||
|
||||
/* Define to enable serial support */
|
||||
#undef WITH_SERIAL
|
||||
|
||||
/* Define to enable SNMP support */
|
||||
#undef WITH_SNMP
|
||||
|
||||
/* Define to enable SSL development code */
|
||||
/* Define to enable SSL */
|
||||
#undef WITH_SSL
|
||||
|
||||
/* Define to enable USB support */
|
||||
|
|
|
@ -3,6 +3,12 @@
|
|||
#ifndef EXTSTATE_H_SEEN
|
||||
#define EXTSTATE_H_SEEN 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/* this could be made dynamic if someone really needs more than this... */
|
||||
#define ST_MAX_VALUE_LEN 256
|
||||
|
||||
|
@ -30,4 +36,10 @@ typedef struct cmdlist_s {
|
|||
struct cmdlist_s *next;
|
||||
} cmdlist_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#endif /* EXTSTATE_H_SEEN */
|
||||
|
|
125
include/nut_platform.h
Normal file
125
include/nut_platform.h
Normal file
|
@ -0,0 +1,125 @@
|
|||
#ifndef nut_platform_h
|
||||
#define nut_platform_h
|
||||
|
||||
/**
|
||||
* \brief Platform-specific checks
|
||||
*
|
||||
* The header performs checks to resolve the actual build platform.
|
||||
* It defines macra that may be later used to produce platform-tailored
|
||||
* code.
|
||||
*
|
||||
* Be careful when writing platform-specific code; avoid that if possible.
|
||||
*
|
||||
* References:
|
||||
* http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system
|
||||
*
|
||||
* \author Vaclav Krpec <VaclavKrpec@Eaton.com>
|
||||
* \date 2012/10/12
|
||||
*/
|
||||
|
||||
/*
|
||||
* In case doxygen source doc isn't generated
|
||||
* (which is the case at time of writing this),
|
||||
* just check the doxygen-documented (i.e. "**"
|
||||
* prefixed) NUT_PLATFORM_* macra, below.
|
||||
*/
|
||||
|
||||
/* Apple Mac OS X, iOS and Darwin */
|
||||
#if (defined __APPLE__ && defined __MACH__)
|
||||
/** Apple OS based on Mach ukernel */
|
||||
#define NUT_PLATFORM_APPLE_MACH
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
|
||||
#if (defined TARGET_OS_EMBEDDED)
|
||||
/** iOS (implies \ref NUT_PLATFORM_APPLE_MACH) */
|
||||
#define NUT_PLATFORM_APPLE_IOS
|
||||
#endif
|
||||
#if (defined TARGET_IPHONE_SIMULATOR)
|
||||
/** iOS simulator (implies \ref NUT_PLATFORM_APPLE_MACH) */
|
||||
#define NUT_PLATFORM_APPLE_IOS_SIMULATOR
|
||||
#endif
|
||||
#if (defined TARGET_OS_IPHONE)
|
||||
/** iPhone (implies \ref NUT_PLATFORM_APPLE_MACH) */
|
||||
#define NUT_PLATFORM_APPLE_IPHONE
|
||||
#endif
|
||||
#if (defined TARGET_OS_MAC)
|
||||
/** Mac OS X (implies \ref NUT_PLATFORM_APPLE_MACH) */
|
||||
#define NUT_PLATFORM_APPLE_OSX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GCC AIX issue: __unix__ nor __unix are not defined in older GCC
|
||||
* Addressed in GCC 4.7.0, see
|
||||
* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39950
|
||||
* Remove if no longer necessary
|
||||
*/
|
||||
#if (defined _AIX && !defined __unix__)
|
||||
#define __unix__
|
||||
#endif
|
||||
|
||||
/* Microsoft Windows */
|
||||
#if (defined _WIN32 || defined _WIN64)
|
||||
/** Windows */
|
||||
#define NUT_PLATFORM_MS_WINDOWS
|
||||
|
||||
#if (defined NTDDI_WIN8 && NTDDI_VERSION >= NTDDI_WIN8)
|
||||
/** Windows 8 */
|
||||
#define NUT_PLATFORM_MS_WINDOWS8
|
||||
#endif
|
||||
|
||||
/* UNIX */
|
||||
/* Note that Apple OSX doesn't define __unix__ nor __unix; are they ashamed or something? */
|
||||
#elif (defined __unix__ || defined __unix || defined NUT_PLATFORM_APPLE_MACH)
|
||||
#include <sys/param.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/** UNIX */
|
||||
#define NUT_PLATFORM_UNIX
|
||||
|
||||
#if (defined _POSIX_VERSION)
|
||||
/** POSIX (implies \ref NUT_PLATFORM_UNIX), expands to POSIX version */
|
||||
#define NUT_PLATFORM_POSIX _POSIX_VERSION
|
||||
#endif
|
||||
|
||||
#if (defined __linux__)
|
||||
/** Linux (implies \ref NUT_PLATFORM_UNIX) */
|
||||
#define NUT_PLATFORM_LINUX
|
||||
#endif
|
||||
#if (defined __sun && defined __SVR4)
|
||||
/** Solaris (implies \ref NUT_PLATFORM_UNIX) */
|
||||
#define NUT_PLATFORM_SOLARIS
|
||||
#endif
|
||||
#if (defined __hpux)
|
||||
/** Hewlett-Packard HP-UX (implies \ref NUT_PLATFORM_UNIX) */
|
||||
#define NUT_PLATFORM_HPUX
|
||||
#endif
|
||||
#if (defined _AIX)
|
||||
/** AIX (implies \ref NUT_PLATFORM_UNIX) */
|
||||
#define NUT_PLATFORM_AIX
|
||||
#endif
|
||||
|
||||
/* Note that BSD is defined in sys/param.h */
|
||||
#if (defined BSD)
|
||||
/** BSD (implies \ref NUT_PLATFORM_UNIX) */
|
||||
#define NUT_PLATFORM_BSD
|
||||
|
||||
#if (defined __DragonFly__)
|
||||
/** DragonFly (implies \ref NUT_PLATFORM_UNIX, \ref NUT_PLATFORM_BSD) */
|
||||
#define NUT_PLATFORM_DRAGONFLY
|
||||
#elif (defined __FreeBSD__)
|
||||
/** FreeBSD (implies \ref NUT_PLATFORM_UNIX, \ref NUT_PLATFORM_BSD) */
|
||||
#define NUT_PLATFORM_FREEBSD
|
||||
#elif (defined __OpenBSD__)
|
||||
/** OpenBSD (implies \ref NUT_PLATFORM_UNIX, \ref NUT_PLATFORM_BSD) */
|
||||
#define NUT_PLATFORM_OPENBSD
|
||||
#elif (defined __NetBSD__)
|
||||
/** NetBSD (implies \ref NUT_PLATFORM_UNIX, \ref NUT_PLATFORM_BSD) */
|
||||
#define NUT_PLATFORM_NETBSD
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* end of #ifndef nut_platform_h */
|
||||
|
|
@ -3,6 +3,12 @@
|
|||
|
||||
#include "attribute.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
|
||||
|
||||
/* Define this as a fall through, HAVE_STDARG_H is probably already set */
|
||||
|
@ -79,4 +85,10 @@ int vprintf(const char *, va_list);
|
|||
int putenv(char *);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#endif /* PROTO_H */
|
||||
|
|
|
@ -24,6 +24,12 @@
|
|||
|
||||
#include "extstate.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#define ST_SOCK_BUF_LEN 512
|
||||
|
||||
typedef struct st_tree_s {
|
||||
|
@ -65,4 +71,10 @@ int state_delenum(st_tree_t *root, const char *var, const char *val);
|
|||
int state_delrange(st_tree_t *root, const char *var, const int min, const int max);
|
||||
st_tree_t *state_tree_find(st_tree_t *node, const char *var);
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#endif /* STATE_H_SEEN */
|
||||
|
|
|
@ -1,7 +1,19 @@
|
|||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/* callback function from read_upsconf */
|
||||
void do_upsconf_args(char *upsname, char *var, char *val);
|
||||
|
||||
/* open the ups.conf, parse it, and call back do_upsconf_args() */
|
||||
void read_upsconf(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue