[AdgPoint] Removed from ADG
[adg.git] / adg / adg-util.c
blobaaf435afff37c66cee22439709a356a59daec001
1 /* ADG - Automatic Drawing Generation
2 * Copyright (C) 2007,2008,2009 Nicola Fontana <ntd at entidi.it>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 /**
22 * SECTION:adg-util
23 * @title: Utilities
24 * @short_description: Assorted macros and utilities
26 * A collection of macros and functions that do not fit inside any other topic.
27 **/
29 /**
30 * ADG_FORWARD_DECL:
31 * @id: The name of a struct
33 * Forward declaration of struct @id. For example,
34 * <code>ADG_FORWARD_DECL(test)</code> will expand to:
36 * <informalexample><programlisting>
37 * typedef struct _test test
38 * </programlisting></informalexample>
40 * This macro is useful to trick <command>gtk-doc</command>, as up
41 * to now (v.1.12) it generates two conflicting links when using
42 * forward declarations: the first in the source with the declaration
43 * and the second where the type is defined. Using ADG_FORWARD_DECL()
44 * instead of the usual typedef avoids the parsing of the declaration
45 * in the first file (<command>gtk-doc</command> is not able to do C
46 * preprocessing).
48 * The same principle can be applied in the definition file. Following
49 * the previous example, you can use something like this where struct
50 * _type is defined:
52 * <informalexample><programlisting>
53 * #if 0
54 * // This is declared in another file
55 * typedef struct _type type;
56 * #endif
57 * struct _type {
58 * ...
59 * };
60 * </programlisting></informalexample>
61 **/