Fix comment in context.h
[babeltrace.git] / types / array.c
index dbdcb4be8efd2161e8df6bcc42a3db2711db489c..3a92ef769fff5684680b616c0391678226709ecc 100644 (file)
  *
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
  */
 
 #include <babeltrace/compiler.h>
@@ -207,6 +215,17 @@ struct definition *array_index(struct definition_array *array, uint64_t i)
        return g_ptr_array_index(array->elems, i);
 }
 
+int get_array_len(const struct definition *field)
+{
+       struct definition_array *array_definition;
+       struct declaration_array *array_declaration;
+
+       array_definition = container_of(field, struct definition_array, p);
+       array_declaration = array_definition->declaration;
+
+       return array_declaration->len;
+}
+
 GString *get_char_array(const struct definition *field)
 {
        struct definition_array *array_definition;
This page took 0.024513 seconds and 4 git commands to generate.