Fix comment in context.h
[babeltrace.git] / types / array.c
index 87b2083bcfdf4120ff41976ae6aa4689f887ac51..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>
 #include <babeltrace/format.h>
+#include <babeltrace/types.h>
 #include <inttypes.h>
 
 static
@@ -206,7 +215,18 @@ struct definition *array_index(struct definition_array *array, uint64_t i)
        return g_ptr_array_index(array->elems, i);
 }
 
-GString *get_char_array(struct definition *field)
+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;
        struct declaration_array *array_declaration;
This page took 0.024215 seconds and 4 git commands to generate.