Splint fiddles.
authorjbj <devnull@localhost>
Tue, 1 Apr 2003 22:27:39 +0000 (22:27 +0000)
committerjbj <devnull@localhost>
Tue, 1 Apr 2003 22:27:39 +0000 (22:27 +0000)
Create struct rpmop_s from OPSTAT_t.

CVS patchset: 6726
CVS date: 2003/04/01 22:27:39

rpmio/rpmsw.h

index ced72a5..91f9d9c 100644 (file)
@@ -15,6 +15,10 @@ typedef struct rpmsw_s * rpmsw;
 
 /** \ingroup rpmio
  */
+typedef struct rpmop_s * rpmop;
+
+/** \ingroup rpmio
+ */
 struct rpmsw_s {
     union {
        struct timeval tv;
@@ -23,7 +27,15 @@ struct rpmsw_s {
     } u;
 };
 
-#define        RPMSW_SCALE     (1000 * 1000)
+/** \ingroup rpmio
+ * Cumulative statistics for an operation.
+ */
+struct rpmop_s {
+    struct rpmsw_s     begin;  /*!< Starting time stamp. */
+    int                        count;  /*!< Number of operations. */
+    size_t             bytes;  /*!< Number of bytes transferred. */
+    rpmtime_t          usecs;  /*!< Number of ticks. */
+};
 
 #ifdef __cplusplus
 extern "C" {
@@ -35,7 +47,8 @@ extern "C" {
  */
 /*@null@*/
 rpmsw rpmswNow(/*@returned@*/ rpmsw sw)
-       /*@modifies sw @*/;
+       /*@globals internalState @*/
+       /*@modifies sw, internalState @*/;
 
 /** Return benchmark time stamp difference.
  * @param *end         end time stamp
@@ -49,7 +62,27 @@ rpmtime_t rpmswDiff(/*@null@*/ rpmsw end, /*@null@*/ rpmsw begin)
  * @return             overhead in micro-seconds
  */
 rpmtime_t rpmswInit(void)
-       /*@*/;
+       /*@globals internalState @*/
+       /*@modifes internalState @*/;
+
+/** \ingroup rpmio
+ * Enter timed operation.
+ * @param op                   operation statistics
+ * @return                     0 always
+ */
+int rpmswEnter(rpmop op)
+       /*@globals internalState @*/
+       /*@modifes op->count, op->begin, internalState @*/;
+
+/** \ingroup rpmio
+ * Exit timed operation.
+ * @param op                   operation statistics
+ * @param rc                   per-operation data (e.g. bytes transferred)
+ * @return                     0 always
+ */
+int rpmswExit(rpmop op, ssize_t rc)
+       /*@globals internalState @*/
+       /*@modifes op-bytes, op->usecs, internalState @*/;
 
 #ifdef __cplusplus
 }