Updated spec for the rsForEachInternal API

Bug: 23535985

Missed the spec for rsForEachInternal in previous CLs.
The right prototype is
rsForEachInternal(int, rs_script_call*, int, int, ...)
or mangled as
_Z17rsForEachInternaliP14rs_script_calliiz

The bcc whitelist was correctly updated in previous CLs.

This is an internal API, therefore header files are not affected.

Updated the api generator to handle the new case of ellipsis being used
in a C++/overloadable, name-mangled function.

Change-Id: Ib6e1341b02eccc64574ebca04c54a7673cb9726e
diff --git a/api/GenerateHeaderFiles.cpp b/api/GenerateHeaderFiles.cpp
index 9d5b49a..ce778b3 100644
--- a/api/GenerateHeaderFiles.cpp
+++ b/api/GenerateHeaderFiles.cpp
@@ -239,7 +239,7 @@
         if (p->isOutParameter) {
             ps << "*";
         }
-        if (!p->specName.empty()) {
+        if (!p->specName.empty() && p->rsType != "...") {
             ps << " " << p->specName;
         }
         const string s = ps.str();
diff --git a/api/GenerateStubsWhiteList.cpp b/api/GenerateStubsWhiteList.cpp
index 69afdbf..dcdbbeb 100644
--- a/api/GenerateStubsWhiteList.cpp
+++ b/api/GenerateStubsWhiteList.cpp
@@ -199,6 +199,9 @@
         delta = mangleLongName(tokens->front());
         isTerminal = true;
         tokens->pop_front();
+    } else if (eatFront(tokens, "...")) {
+        delta = "z";
+        isTerminal = true;
     } else {
         const char* c = findManglingOfBuiltInType(tokens);
         if (c) {
diff --git a/api/Scanner.cpp b/api/Scanner.cpp
index 1bd4973..aa382f3 100644
--- a/api/Scanner.cpp
+++ b/api/Scanner.cpp
@@ -177,7 +177,7 @@
         if (nameStart == string::npos) {
             if (s == "...") {
                 p->name = s;
-                p->type = "";
+                p->type = s;
                 p->lineNumber = mLineNumber;
                 return p;
             } else {
diff --git a/api/rs_for_each.spec b/api/rs_for_each.spec
index c9bb2e6..bfe8e7e 100644
--- a/api/rs_for_each.spec
+++ b/api/rs_for_each.spec
@@ -119,15 +119,15 @@
  The kernel must be defined in the current script. In addition, more than one
  inputs can be used.
 
-E.g.<code><br/>
+ E.g.<code><br/>
  float __attribute__((kernel)) square(float a) {<br/>
  &nbsp;&nbsp;return a * a;<br/>
  }<br/>
-<br/>
+ <br/>
  void compute(rs_allocation ain, rs_allocation aout) {<br/>
  &nbsp;&nbsp;rsForEach(square, ain, aout);<br/>
  }<br/>
-<br/></code>
+ <br/></code>
 test: none
 end:
 
@@ -176,7 +176,8 @@
 function: rsForEach
 version: UNRELEASED
 intrinsic: true
-attrib: =  # Not overloadable
+# Not overloadable
+attrib: =
 ret: void
 arg: rs_kernel kernel, "Function designator to a function that is defined with the kernel attribute."
 arg: ..., "Input and output allocations"
@@ -186,7 +187,8 @@
 function: rsForEachWithOptions
 version: UNRELEASED
 intrinsic: true
-attrib: =  # Not overloadable
+# Not overloadable
+attrib: =
 ret: void
 arg: rs_kernel kernel, "Function designator to a function that is defined with the kernel attribute."
 arg: rs_script_call_t* options, "Launch options"
@@ -201,15 +203,14 @@
  and return value expected by the kernel function. The output allocation is
  present if and only if the kernel has a non-void return value.
 
- E.g., <code><br/>
+ E.g.,<code><br/>
     rs_script_call_t opts = {0};<br/>
     opts.xStart = 0;<br/>
     opts.xEnd = dimX;<br/>
     opts.yStart = 0;<br/>
     opts.yEnd = dimY / 2;<br/>
     rsForEachWithOptions(foo, &opts, out, out);<br/>
-</code>
-
+ </code>
 test: none
 end:
 
@@ -219,10 +220,12 @@
 ret: void
 arg: int slot
 arg: rs_script_call_t* options
-arg: rs_allocation input
-arg: rs_allocation output
+arg: int hasOutput, "Indicates whether the kernel generates output"
+arg: int numInputs, "Number of input allocations"
+arg: ..., "Input and output allocations"
 summary: (Internal API) Launch a kernel in the current Script (with the slot number)
 description:
+ Internal API to launch a kernel.
 test: none
 end: