Generate all APIs.

This CL expands the generator to create all the .rsh files, not just
the core_math one.  To do so, processing of types (simple, struct, enums)
and constants was added.  .spec files corresponding to each .rsh file was
created.  Documentation was added.

This CL also generates HTML documentation files.  This generation will soon
be upgraded.

To make the code easier to expand, I've done fairly extensive refactoring.

In a subsequent CL, the APIs will be regrouped in different header files to
simplify learning the APIs.  In an other, the documentation generation will
be futher improved and incorporated in the actual online help.

Also removes rs_path & related functions.

Change-Id: I2c88554c9c6a8625233772b89e055fc6c4ad5da5
diff --git a/scriptc/rs_quaternion.rsh b/scriptc/rs_quaternion.rsh
index d2ec24c..c6ece96 100644
--- a/scriptc/rs_quaternion.rsh
+++ b/scriptc/rs_quaternion.rsh
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 The Android Open Source Project
+ * Copyright (C) 2015 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,81 +14,101 @@
  * limitations under the License.
  */
 
-/** @file rs_quaternion.rsh
- *  \brief Quaternion routines
- *
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/gen_runtime.
+
+/*
+ * rs_quaternion.rsh: Quaternion routines
  *
  */
+#ifndef RENDERSCRIPT_RS_QUATERNION_RSH
+#define RENDERSCRIPT_RS_QUATERNION_RSH
 
-#ifndef __RS_QUATERNION_RSH__
-#define __RS_QUATERNION_RSH__
-
-
-/**
- * Set the quaternion components
- * @param q destination quaternion
- * @param w component
- * @param x component
- * @param y component
- * @param z component
- */
-static void __attribute__((overloadable))
-rsQuaternionSet(rs_quaternion *q, float w, float x, float y, float z) {
-    q->w = w;
-    q->x = x;
-    q->y = y;
-    q->z = z;
-}
-
-/**
- * Set the quaternion from another quaternion
- * @param q destination quaternion
- * @param rhs source quaternion
- */
-static void __attribute__((overloadable))
-rsQuaternionSet(rs_quaternion *q, const rs_quaternion *rhs) {
-    q->w = rhs->w;
-    q->x = rhs->x;
-    q->y = rhs->y;
-    q->z = rhs->z;
-}
-
-/**
- * Multiply quaternion by a scalar
- * @param q quaternion to multiply
- * @param s scalar
- */
-static void __attribute__((overloadable))
-rsQuaternionMultiply(rs_quaternion *q, float s) {
-    q->w *= s;
-    q->x *= s;
-    q->y *= s;
-    q->z *= s;
-}
-
-/**
+/*
  * Add two quaternions
- * @param q destination quaternion to add to
- * @param rhs right hand side quaternion to add
+ *
+ * Parameters:
+ *   q destination quaternion to add to
+ *   rhs right hand side quaternion to add
  */
-static void
-rsQuaternionAdd(rs_quaternion *q, const rs_quaternion *rhs) {
+static inline void __attribute__((overloadable))
+    rsQuaternionAdd(rs_quaternion* q, const rs_quaternion* rhs) {
     q->w *= rhs->w;
     q->x *= rhs->x;
     q->y *= rhs->y;
     q->z *= rhs->z;
 }
 
-/**
- * Loads a quaternion that represents a rotation about an arbitrary unit vector
- * @param q quaternion to set
- * @param rot angle to rotate by
- * @param x component of a vector
- * @param y component of a vector
- * @param z component of a vector
+/*
+ * Conjugates the quaternion
+ *
+ * Parameters:
+ *   q quaternion to conjugate
  */
-static void
-rsQuaternionLoadRotateUnit(rs_quaternion *q, float rot, float x, float y, float z) {
+static inline void __attribute__((overloadable))
+    rsQuaternionConjugate(rs_quaternion* q) {
+    q->x = -q->x;
+    q->y = -q->y;
+    q->z = -q->z;
+}
+
+/*
+ * Dot product of two quaternions
+ *
+ * Parameters:
+ *   q0 first quaternion
+ *   q1 second quaternion
+ *
+ * Returns: dot product between q0 and q1
+ */
+static inline float __attribute__((overloadable))
+    rsQuaternionDot(const rs_quaternion* q0, const rs_quaternion* q1) {
+    return q0->w*q1->w + q0->x*q1->x + q0->y*q1->y + q0->z*q1->z;
+}
+
+/*
+ * Computes rotation matrix from the normalized quaternion
+ *
+ * Parameters:
+ *   m resulting matrix
+ *   q normalized quaternion
+ */
+static inline void __attribute__((overloadable))
+    rsQuaternionGetMatrixUnit(rs_matrix4x4* m, const rs_quaternion* q) {
+    float xx = q->x * q->x;
+    float xy = q->x * q->y;
+    float xz = q->x * q->z;
+    float xw = q->x * q->w;
+    float yy = q->y * q->y;
+    float yz = q->y * q->z;
+    float yw = q->y * q->w;
+    float zz = q->z * q->z;
+    float zw = q->z * q->w;
+
+    m->m[0]  = 1.0f - 2.0f * ( yy + zz );
+    m->m[4]  =        2.0f * ( xy - zw );
+    m->m[8]  =        2.0f * ( xz + yw );
+    m->m[1]  =        2.0f * ( xy + zw );
+    m->m[5]  = 1.0f - 2.0f * ( xx + zz );
+    m->m[9]  =        2.0f * ( yz - xw );
+    m->m[2]  =        2.0f * ( xz - yw );
+    m->m[6]  =        2.0f * ( yz + xw );
+    m->m[10] = 1.0f - 2.0f * ( xx + yy );
+    m->m[3]  = m->m[7] = m->m[11] = m->m[12] = m->m[13] = m->m[14] = 0.0f;
+    m->m[15] = 1.0f;
+}
+
+/*
+ * Loads a quaternion that represents a rotation about an arbitrary unit vector
+ *
+ * Parameters:
+ *   q quaternion to set
+ *   rot rot angle to rotate by
+ *   x component of a vector
+ *   y component of a vector
+ *   z component of a vector
+ */
+static inline void __attribute__((overloadable))
+    rsQuaternionLoadRotateUnit(rs_quaternion* q, float rot, float x, float y, float z) {
     rot *= (float)(M_PI / 180.0f) * 0.5f;
     float c = cos(rot);
     float s = sin(rot);
@@ -99,17 +119,46 @@
     q->z = z * s;
 }
 
-/**
+/*
+ * Set the quaternion from components or from another quaternion.
+ *
+ * Parameters:
+ *   q destination quaternion
+ *   w component
+ *   x component
+ *   y component
+ *   z component
+ *   rhs source quaternion
+ */
+static inline void __attribute__((overloadable))
+    rsQuaternionSet(rs_quaternion* q, float w, float x, float y, float z) {
+    q->w = w;
+    q->x = x;
+    q->y = y;
+    q->z = z;
+}
+
+static inline void __attribute__((overloadable))
+    rsQuaternionSet(rs_quaternion* q, const rs_quaternion* rhs) {
+    q->w = rhs->w;
+    q->x = rhs->x;
+    q->y = rhs->y;
+    q->z = rhs->z;
+}
+
+/*
  * Loads a quaternion that represents a rotation about an arbitrary vector
  * (doesn't have to be unit)
- * @param q quaternion to set
- * @param rot angle to rotate by
- * @param x component of a vector
- * @param y component of a vector
- * @param z component of a vector
+ *
+ * Parameters:
+ *   q quaternion to set
+ *   rot angle to rotate by
+ *   x component of a vector
+ *   y component of a vector
+ *   z component of a vector
  */
-static void
-rsQuaternionLoadRotate(rs_quaternion *q, float rot, float x, float y, float z) {
+static inline void __attribute__((overloadable))
+    rsQuaternionLoadRotate(rs_quaternion* q, float rot, float x, float y, float z) {
     const float len = x*x + y*y + z*z;
     if (len != 1) {
         const float recipLen = 1.f / sqrt(len);
@@ -120,48 +169,42 @@
     rsQuaternionLoadRotateUnit(q, rot, x, y, z);
 }
 
-/**
- * Conjugates the quaternion
- * @param q quaternion to conjugate
- */
-static void
-rsQuaternionConjugate(rs_quaternion *q) {
-    q->x = -q->x;
-    q->y = -q->y;
-    q->z = -q->z;
-}
-
-/**
- * Dot product of two quaternions
- * @param q0 first quaternion
- * @param q1 second quaternion
- * @return dot product between q0 and q1
- */
-static float
-rsQuaternionDot(const rs_quaternion *q0, const rs_quaternion *q1) {
-    return q0->w*q1->w + q0->x*q1->x + q0->y*q1->y + q0->z*q1->z;
-}
-
-/**
+/*
  * Normalizes the quaternion
- * @param q quaternion to normalize
+ *
+ * Parameters:
+ *   q quaternion to normalize
  */
-static void
-rsQuaternionNormalize(rs_quaternion *q) {
+static inline void __attribute__((overloadable))
+    rsQuaternionNormalize(rs_quaternion* q) {
     const float len = rsQuaternionDot(q, q);
     if (len != 1) {
         const float recipLen = 1.f / sqrt(len);
-        rsQuaternionMultiply(q, recipLen);
+        q->w *= recipLen;
+        q->x *= recipLen;
+        q->y *= recipLen;
+        q->z *= recipLen;
     }
 }
 
-/**
- * Multiply quaternion by another quaternion
- * @param q destination quaternion
- * @param rhs right hand side quaternion to multiply by
+/*
+ * Multiply quaternion by a scalar or another quaternion
+ *
+ * Parameters:
+ *   q destination quaternion
+ *   s scalar
+ *   rhs right hand side quaternion to multiply by
  */
-static void __attribute__((overloadable))
-rsQuaternionMultiply(rs_quaternion *q, const rs_quaternion *rhs) {
+static inline void __attribute__((overloadable))
+    rsQuaternionMultiply(rs_quaternion* q, float s) {
+    q->w *= s;
+    q->x *= s;
+    q->y *= s;
+    q->z *= s;
+}
+
+static inline void __attribute__((overloadable))
+    rsQuaternionMultiply(rs_quaternion* q, const rs_quaternion* rhs) {
     rs_quaternion qtmp;
     rsQuaternionSet(&qtmp, q);
 
@@ -172,15 +215,17 @@
     rsQuaternionNormalize(q);
 }
 
-/**
+/*
  * Performs spherical linear interpolation between two quaternions
- * @param q result quaternion from interpolation
- * @param q0 first param
- * @param q1 second param
- * @param t how much to interpolate by
+ *
+ * Parameters:
+ *   q result quaternion from interpolation
+ *   q0 first param
+ *   q1 second param
+ *   t how much to interpolate by
  */
-static void
-rsQuaternionSlerp(rs_quaternion *q, const rs_quaternion *q0, const rs_quaternion *q1, float t) {
+static inline void __attribute__((overloadable))
+    rsQuaternionSlerp(rs_quaternion* q, const rs_quaternion* q0, const rs_quaternion* q1, float t) {
     if (t <= 0.0f) {
         rsQuaternionSet(q, q0);
         return;
@@ -221,33 +266,4 @@
                         tempq0.y*scale + tempq1.y*invScale, tempq0.z*scale + tempq1.z*invScale);
 }
 
-/**
- * Computes rotation matrix from the normalized quaternion
- * @param m resulting matrix
- * @param q normalized quaternion
- */
-static void rsQuaternionGetMatrixUnit(rs_matrix4x4 *m, const rs_quaternion *q) {
-    float xx = q->x * q->x;
-    float xy = q->x * q->y;
-    float xz = q->x * q->z;
-    float xw = q->x * q->w;
-    float yy = q->y * q->y;
-    float yz = q->y * q->z;
-    float yw = q->y * q->w;
-    float zz = q->z * q->z;
-    float zw = q->z * q->w;
-
-    m->m[0]  = 1.0f - 2.0f * ( yy + zz );
-    m->m[4]  =        2.0f * ( xy - zw );
-    m->m[8]  =        2.0f * ( xz + yw );
-    m->m[1]  =        2.0f * ( xy + zw );
-    m->m[5]  = 1.0f - 2.0f * ( xx + zz );
-    m->m[9]  =        2.0f * ( yz - xw );
-    m->m[2]  =        2.0f * ( xz - yw );
-    m->m[6]  =        2.0f * ( yz + xw );
-    m->m[10] = 1.0f - 2.0f * ( xx + yy );
-    m->m[3]  = m->m[7] = m->m[11] = m->m[12] = m->m[13] = m->m[14] = 0.0f;
-    m->m[15] = 1.0f;
-}
-
-#endif
+#endif // RENDERSCRIPT_RS_QUATERNION_RSH