+static void op_add_transaction(const char *filename, struct op op[],
+ unsigned int op_num, char *words[])
+{
+ if (words[2])
+ fail(filename, op_num+1, "Expect no arguments");
+
+ op[op_num].key = tdb_null;
+ op[op_num].transaction_end = 0;
+}
+
+static void op_analyze_transaction(const char *filename,
+ struct op op[], unsigned int op_num,
+ char *words[])
+{
+ int i, start;
+
+ op[op_num].key = tdb_null;
+
+ if (words[2])
+ fail(filename, op_num+1, "Expect no arguments");
+
+ for (i = op_num-1; i >= 0; i--) {
+ if (op[i].op == OP_TDB_TRANSACTION_START &&
+ !op[i].transaction_end)
+ break;
+ }
+
+ if (i < 0)
+ fail(filename, op_num+1, "no transaction start found");
+
+ start = i;
+ op[start].transaction_end = op_num;
+
+ /* This rolls in nested transactions. I think that's right. */
+ for (i++; i <= op_num; i++)
+ op[i].group_start = start;
+}
+