lib: add precondition checks that count of discarded events/packets is greater than 0
[babeltrace.git] / include / babeltrace2 / graph / message.h
index 34b98bc0717c909890459455d0cef7d786dd23f4..27730f69549dfc9aafe9ddee603049bffae46c98 100644 (file)
@@ -1,28 +1,12 @@
-#ifndef BABELTRACE2_GRAPH_MESSAGE_H
-#define BABELTRACE2_GRAPH_MESSAGE_H
-
 /*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ * SPDX-License-Identifier: MIT
  *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * 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.
+ * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
  */
 
+#ifndef BABELTRACE2_GRAPH_MESSAGE_H
+#define BABELTRACE2_GRAPH_MESSAGE_H
+
 #ifndef __BT_IN_BABELTRACE_H
 # error "Please include <babeltrace2/babeltrace.h> instead."
 #endif
@@ -2436,6 +2420,7 @@ property values:
 @pre
     <code>bt_stream_class_discarded_events_have_default_clock_snapshots(bt_stream_borrow_class_const(stream))</code>
     returns #BT_TRUE.
+    \bt_p{beginning_clock_snapshot_value} ⩽ \bt_p{end_clock_snapshot_value}
 
 @bt_post_success_frozen{stream}
 */
@@ -2583,6 +2568,8 @@ property.
 @bt_pre_not_null{message}
 @bt_pre_hot{message}
 @bt_pre_is_disc_ev_msg{message}
+@pre
+    \bt_p{count} > 0
 
 @sa bt_message_discarded_events_get_count() &mdash;
     Returns the number of discarded events of a discarded events
@@ -2754,6 +2741,7 @@ property values:
 @pre
     <code>bt_stream_class_discarded_packets_have_default_clock_snapshots(bt_stream_borrow_class_const(stream))</code>
     returns #BT_TRUE.
+    \bt_p{beginning_clock_snapshot_value} ⩽ \bt_p{end_clock_snapshot_value}
 
 @bt_post_success_frozen{stream}
 */
@@ -2900,6 +2888,8 @@ property.
 @bt_pre_not_null{message}
 @bt_pre_hot{message}
 @bt_pre_is_disc_pkt_msg{message}
+@pre
+    \bt_p{count} > 0
 
 @sa bt_message_discarded_packets_get_count() &mdash;
     Returns the number of discarded packets of a discarded packets
@@ -3106,7 +3096,6 @@ This macro effectively moves a message reference from the expression
 
 /*! @} */
 
-
 /*!
 @name Message Interchange Protocol version
 @{
This page took 0.025131 seconds and 4 git commands to generate.