], [])
AM_CONDITIONAL(BUILD_WITH_DEBUG, test "x$enable_debug" = "xyes")
-AC_OUTPUT(Makefile src/Makefile)
+AC_OUTPUT(Makefile src/Makefile src/routeros_version.h)
AM_CFLAGS = -Wall -Werror
endif
-include_HEADERS = routeros_api.h
+include_HEADERS = routeros_api.h routeros_version.h
lib_LTLIBRARIES = librouteros.la
librouteros_la_LDFLAGS = -version-info @LIBROUTEROS_CURRENT@:@LIBROUTEROS_REVISION@:@LIBROUTEROS_AGE@
if BUILD_WITH_LIBSOCKET
librouteros_la_LIBADD += -lsocket
endif
-librouteros_la_SOURCES = main.c routeros_api.h
+librouteros_la_SOURCES = main.c routeros_api.h routeros_version.h
return (NULL);
} /* }}} char *ros_reply_param_val_by_key */
+int ros_version (void) /* {{{ */
+{
+ return (ROS_VERSION);
+} /* }}} int ros_version */
+
+const char *ros_version_string (void) /* {{{ */
+{
+ return (ROS_VERSION_STRING);
+} /* }}} char *ros_version_string */
+
/* vim: set ts=2 sw=2 noet fdm=marker : */
#ifndef ROUTEROS_API_H
#define ROUTEROS_API_H 1
+#include <routeros_version.h>
+
#define ROUTEROS_API_PORT "8728"
#ifdef __cplusplus
--- /dev/null
+#ifndef ROUTEROS_VERSION_H
+#define ROUTEROS_VERSION_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ROS_VERSION_MAJOR @LIBROUTEROS_MAJOR@
+#define ROS_VERSION_MINOR @LIBROUTEROS_MINOR@
+#define ROS_VERSION_PATCH @LIBROUTEROS_PATCH@
+
+#define ROS_VERSION_STRING "@LIBROUTEROS_MAJOR@.@LIBROUTEROS_MINOR@.@LIBROUTEROS_PATCH@"
+
+#define ROS_VERSION_ENCODE(major, minor, patch) \
+ ((major) * 10000 + (minor) * 100 + (patch))
+
+#define ROS_VERSION \
+ ROS_VERSION_ENCODE(ROS_VERSION_MAJOR, ROS_VERSION_MINOR, ROS_VERSION_PATCH)
+
+int ros_version (void);
+const char *ros_version_string (void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ROUTEROS_VERSION_H */