From 5eff53a4ac5d9d9563d5e6fdc073914d6ea88b49 Mon Sep 17 00:00:00 2001 From: Kirill Simonov Date: Mon, 3 Jul 2006 13:49:14 +0000 Subject: [PATCH] Move yaml/yaml.h to yaml.h and merge version.c to api.c. --- include/Makefile.am | 2 +- include/{yaml => }/yaml.h | 0 include/yaml/yaml_error.h | 25 ------------------------- include/yaml/yaml_version.h | 33 --------------------------------- src/Makefile.am | 2 +- src/api.c | 16 +++++++++++++++- src/reader.c | 2 +- src/scanner.c | 2 +- src/version.c | 21 --------------------- tests/test-reader.c | 2 +- tests/test-version.c | 2 +- 11 files changed, 21 insertions(+), 86 deletions(-) rename include/{yaml => }/yaml.h (100%) delete mode 100644 include/yaml/yaml_error.h delete mode 100644 include/yaml/yaml_version.h delete mode 100644 src/version.c diff --git a/include/Makefile.am b/include/Makefile.am index 5c5f7dd..3c7323c 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,4 +1,4 @@ -INCLUDES = yaml/yaml.h #yaml/yaml_version.h yaml/yaml_error.h +INCLUDES = yaml.h DOXYGEN_CFG = $(top_srcdir)/doc/doxygen.cfg nobase_include_HEADERS = $(INCLUDES) diff --git a/include/yaml/yaml.h b/include/yaml.h similarity index 100% rename from include/yaml/yaml.h rename to include/yaml.h diff --git a/include/yaml/yaml_error.h b/include/yaml/yaml_error.h deleted file mode 100644 index df0ca7d..0000000 --- a/include/yaml/yaml_error.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef YAML_ERROR_H -#define YAML_ERROR_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - YAML_NO_ERROR, - - YAML_MEMORY_ERROR, - - YAML_READER_ERROR, - YAML_SCANNER_ERROR, - YAML_PARSER_ERROR, - - YAML_WRITER_ERROR, - YAML_EMITTER_ERROR -} yaml_error_type_t; - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef YAML_ERROR_H */ diff --git a/include/yaml/yaml_version.h b/include/yaml/yaml_version.h deleted file mode 100644 index 9718db2..0000000 --- a/include/yaml/yaml_version.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * @file yaml_version.h - * @brief Version information. - * - * Do not include yaml_version.h directly. - */ - -#ifndef YAML_VERSION_H -#define YAML_VERSION_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * @brief Get the library version. - */ - -const char * -yaml_get_version_string(void); - -/* - * @brief Get the library version numbers. - */ - -void -yaml_get_version(int *major, int *minor, int *patch); - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef YAML_VERSION_H */ diff --git a/src/Makefile.am b/src/Makefile.am index d30f3dd..c8797dc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ AM_CPPFLAGS = -I$(top_srcdir)/include lib_LTLIBRARIES = libyaml.la -libyaml_la_SOURCES = version.c api.c reader.c scanner.c +libyaml_la_SOURCES = api.c reader.c scanner.c libyaml_la_LDFLAGS = -release $(YAML_LT_RELEASE) -version-info $(YAML_LT_CURRENT):$(YAML_LT_REVISION):$(YAML_LT_AGE) diff --git a/src/api.c b/src/api.c index 88e03e7..3047753 100644 --- a/src/api.c +++ b/src/api.c @@ -3,10 +3,24 @@ #include #endif -#include +#include #include +YAML_DECLARE(const char *) +yaml_get_version_string(void) +{ + return YAML_VERSION_STRING; +} + +YAML_DECLARE(void) +yaml_get_version(int *major, int *minor, int *patch) +{ + *major = YAML_VERSION_MAJOR; + *minor = YAML_VERSION_MINOR; + *patch = YAML_VERSION_PATCH; +} + /* * Allocate a dynamic memory block. */ diff --git a/src/reader.c b/src/reader.c index 946d298..9cc8e7b 100644 --- a/src/reader.c +++ b/src/reader.c @@ -3,7 +3,7 @@ #include #endif -#include +#include #include diff --git a/src/scanner.c b/src/scanner.c index 8313acd..45af0c1 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -479,7 +479,7 @@ #include #endif -#include +#include #include diff --git a/src/version.c b/src/version.c deleted file mode 100644 index b7f5904..0000000 --- a/src/version.c +++ /dev/null @@ -1,21 +0,0 @@ - -#if HAVE_CONFIG_H -#include -#endif - -#include - -const char * -yaml_get_version_string(void) -{ - return YAML_VERSION_STRING; -} - -void -yaml_get_version(int *major, int *minor, int *patch) -{ - *major = YAML_VERSION_MAJOR; - *minor = YAML_VERSION_MINOR; - *patch = YAML_VERSION_PATCH; -} - diff --git a/tests/test-reader.c b/tests/test-reader.c index 53e4e7a..c5ce279 100644 --- a/tests/test-reader.c +++ b/tests/test-reader.c @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tests/test-version.c b/tests/test-version.c index 578d678..ab4f93c 100644 --- a/tests/test-version.c +++ b/tests/test-version.c @@ -1,4 +1,4 @@ -#include +#include #include #include -- 2.45.2