+/**
+ * Function called to convert input argument into SQL parameters.
+ *
+ * @param cls closure
+ * @param data pointer to input argument
+ * @param data_len number of bytes in @a data (if applicable)
+ * @param stmt sqlite statement to bind parameters for
+ * @param off offset of the argument to bind in @a stmt, numbered from 1,
+ * so immediately suitable for passing to `sqlite3_bind`-functions.
+ * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
+ */
+static int
+bind_abstime (void *cls,
+ const void *data,
+ size_t data_len,
+ sqlite3_stmt *stmt,
+ unsigned int off)
+{
+ const struct GNUNET_TIME_Absolute *u = data;
+ struct GNUNET_TIME_Absolute abs;
+
+ abs = *u;
+ if (abs.abs_value_us > INT64_MAX)
+ abs.abs_value_us = INT64_MAX;
+ GNUNET_assert (sizeof (uint64_t) == data_len);
+ if (SQLITE_OK !=
+ sqlite3_bind_int64 (stmt,
+ (int) off,
+ (sqlite3_int64) abs.abs_value_us))
+ return GNUNET_SYSERR;
+ return GNUNET_OK;
+}
+
+