[darwinbuild-changes] [23] trunk/darwinxref

source_changes at macosforge.org source_changes at macosforge.org
Wed Oct 4 01:37:57 PDT 2006


Revision: 23
          http://trac.macosforge.org/projects/darwinbuild/changeset/23
Author:   kevin
Date:     2006-10-04 01:37:57 -0700 (Wed, 04 Oct 2006)

Log Message:
-----------
- expose transactions in the plugin API

Modified Paths:
--------------
    trunk/darwinxref/DBPlugin.h
    trunk/darwinxref/DBTclPlugin.c

Modified: trunk/darwinxref/DBPlugin.h
===================================================================
--- trunk/darwinxref/DBPlugin.h	2005-06-20 23:23:06 UTC (rev 22)
+++ trunk/darwinxref/DBPlugin.h	2006-10-04 08:37:57 UTC (rev 23)
@@ -146,6 +146,10 @@
 
 int DBSetPlist(CFStringRef build, CFPropertyListRef plist);
 
+int DBBeginTransaction();
+int DBCommitTransaction();
+int DBRollbackTransaction();
+
 #include "cfutils.h"
 
 #endif

Modified: trunk/darwinxref/DBTclPlugin.c
===================================================================
--- trunk/darwinxref/DBTclPlugin.c	2005-06-20 23:23:06 UTC (rev 22)
+++ trunk/darwinxref/DBTclPlugin.c	2006-10-04 08:37:57 UTC (rev 23)
@@ -216,7 +216,34 @@
 	return TCL_OK;
 }
 
+int DBBeginTransactionCmd(ClientData data, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]) {
+	if (objc != 1) {
+		Tcl_WrongNumArgs(interp, 1, objv, "");
+		return TCL_ERROR;
+	}
+	DBBeginTransaction();
+	return TCL_OK;
+}
 
+int DBCommitTransactionCmd(ClientData data, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]) {
+	if (objc != 1) {
+		Tcl_WrongNumArgs(interp, 1, objv, "");
+		return TCL_ERROR;
+	}
+	DBCommitTransaction();
+	return TCL_OK;
+}
+
+int DBRollbackTransactionCmd(ClientData data, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]) {
+	if (objc != 1) {
+		Tcl_WrongNumArgs(interp, 1, objv, "");
+		return TCL_ERROR;
+	}
+	DBRollbackTransaction();
+	return TCL_OK;
+}
+
+
 int load_tcl_plugin(DBPlugin* plugin, const char* filename) {
 	Tcl_Interp* interp = Tcl_CreateInterp();
 
@@ -232,6 +259,10 @@
 	Tcl_CreateObjCommand(interp, "DBSetPropArray", DBSetPropArrayCmd, (ClientData)plugin, (Tcl_CmdDeleteProc *)NULL);
 	Tcl_CreateObjCommand(interp, "DBCopyPropArray", DBCopyPropArrayCmd, (ClientData)plugin, (Tcl_CmdDeleteProc *)NULL);
 
+	Tcl_CreateObjCommand(interp, "DBBeginTransaction", DBBeginTransactionCmd, (ClientData)plugin, (Tcl_CmdDeleteProc *)NULL);
+	Tcl_CreateObjCommand(interp, "DBCommitTransaction", DBCommitTransactionCmd, (ClientData)plugin, (Tcl_CmdDeleteProc *)NULL);
+	Tcl_CreateObjCommand(interp, "DBRollbackTransaction", DBRollbackTransactionCmd, (ClientData)plugin, (Tcl_CmdDeleteProc *)NULL);
+
 	// Source the plugin file
 	Tcl_EvalFile(interp, filename);
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20061004/fd6d6d76/attachment.html


More information about the darwinbuild-changes mailing list