grim/gplate

Properly generate the documentation (at least: 100% symbol coverage).

I hate to flatten history like this, as this represented by 37 commits
in my local repository. However, I could _not_ get the result to
merge for some reason that I didn't have the time to figure out, so I
flattened it down to a single patch against upstream, and fixed the
resulting diff, and this is that commit.

In a nutshell, this commit:

- gets rid of the SGML template files, as the content that they had
was moved to source code files so that the documentation is closer
to the code, and also because the SGML templates were blocking some
already existing doc-comments in the source code.

- Gets rid of the gplate-sections.txt file, as gtk-doc builds it for
us.

- Gets rid of the gplate.types file. It is generated from scanning
the source code, and adjusted by sed to eliminate things that
gtk-doc won't be able to runtime introspect since they're not
currently "there".

- Hooks the doc/gplates directory into the build system (just
barely). The real work is not even done by CMake, as I couldn't
figure out how to get it to do what I wanted, which leads to...

- The documentation is _actually_ built by doc/gplate/build-docs.sh,
which contains hardcoded values that I could not figure out how to
get CMake to expose certain things. This means that the build
system doesn't actually know jack about the documentation (and this
also means that the documentation won't be installed as part of the
"make install" target, either). (BUT, the documentation is
available and BUILDS!)

While this commit makes things better than they were before the
commit, I would not call this commit overly polished. I fully expect
the shell script to be replaced by something done in/with/via CMake
directly, I just don't know how to do it that way.
/*
* GPlate - GObject based templating library
* Copyright (C) 2007-2012 Gary Kramlich <grim@reaperworld.com>
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This library 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <gplate/gplate.h>
static void
gplate_util_test_quoted_string_helper(const gchar *string,
const gchar *contents, gboolean value)
{
gboolean r = FALSE;
gchar *c = NULL;
r = gplate_util_is_quoted_string(string, &c);
g_assert_cmpint(r, ==, value);
if(contents)
g_assert_cmpstr(c, ==, contents);
g_free(c);
}
static void
gplate_util_test_quoted_string(void) {
gplate_util_test_quoted_string_helper("\"abc\"", "abc", TRUE);
gplate_util_test_quoted_string_helper("\"abc def\"", "abc def", TRUE);
gplate_util_test_quoted_string_helper("\"abc\tdef\bghi\"", "abc\tdef\bghi", TRUE);
gplate_util_test_quoted_string_helper("abc \"def\"", NULL, FALSE);
gplate_util_test_quoted_string_helper("\"abc\" def", NULL, FALSE);
gplate_util_test_quoted_string_helper("'abc'", "abc", TRUE);
gplate_util_test_quoted_string_helper("'abc def'", "abc def", TRUE);
gplate_util_test_quoted_string_helper("'abc\tdef\bghi'", "abc\tdef\bghi", TRUE);
gplate_util_test_quoted_string_helper("abc 'def'", NULL, FALSE);
gplate_util_test_quoted_string_helper("'abc' def", NULL, FALSE);
gplate_util_test_quoted_string_helper("'abc\"", NULL, FALSE);
gplate_util_test_quoted_string_helper("\"abc'", NULL, FALSE);
}
gint
main(gint argc, gchar **argv) {
g_test_init(&argc, &argv, NULL);
g_test_add_func("/util/quoted_string", gplate_util_test_quoted_string);
return g_test_run();
}