summaryrefslogtreecommitdiffstats
path: root/examples/restypedef.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/restypedef.cpp')
-rw-r--r--examples/restypedef.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/examples/restypedef.cpp b/examples/restypedef.cpp
new file mode 100644
index 0000000..2cd3f8f
--- /dev/null
+++ b/examples/restypedef.cpp
@@ -0,0 +1,25 @@
+/*! \file restypedef.cpp
+ * An example of resolving typedefs.
+ */
+
+/*! \struct CoordStruct
+ * A coordinate pair.
+ */
+struct CoordStruct
+{
+ /*! The x coordinate */
+ float x;
+ /*! The y coordinate */
+ float y;
+};
+
+/*! Creates a type name for CoordStruct */
+typedef struct CoordStruct Coord;
+
+/*!
+ * This function returns the addition of \a c1 and \a c2, i.e:
+ * (c1.x+c2.x,c1.y+c2.y)
+ */
+Coord add(Coord c1,Coord c2)
+{
+}