Index: uuid.install
===================================================================
RCS file: /cvs/drupal/contributions/modules/uuid/uuid.install,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 uuid.install
--- uuid.install	19 May 2009 21:55:41 -0000	1.1.2.2
+++ uuid.install	27 Aug 2009 08:45:33 -0000
@@ -20,6 +20,8 @@
     'uuid_node' => uuid_table_schema('node', 'nid'),
     'uuid_users' => uuid_table_schema('users', 'uid'),
     'uuid_node_revisions' => uuid_table_schema('node_revisions', 'vid'),
+    'uuid_vocabulary' => uuid_table_schema('vocabulary', 'vid'),
+    'uuid_term_data' => uuid_table_schema('term_data', 'tid'),
   );
 }
 
Index: uuid.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/uuid/uuid.module,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 uuid.module
--- uuid.module	11 Jun 2009 18:07:13 -0000	1.1.2.4
+++ uuid.module	27 Aug 2009 08:43:22 -0000
@@ -163,6 +163,36 @@
 }
 
 /**
+ * Implementation of hook_taxonomy().
+ */
+function uuid_taxonomy($op, $type, $array = NULL) {
+  $types = array(
+    'term' => array(
+      'table' => 'uuid_term_data',
+      'colname' => 'tid',
+    ),
+    'vocabulary' => array(
+      'table' => 'uuid_vocabulary',
+      'colname' => 'vid',
+    ),
+  );
+  
+  if (array_key_exists($type, $types) && in_array($array['vid'], variable_get('uuid_automatic_for_taxonomy', array()))) {
+    switch ($op) {
+      case 'insert':
+        $uuid = (isset($array['uuid']) && uuid_is_valid($array['uuid'])) ? $array['uuid'] : uuid_uuid();
+        db_query("INSERT INTO {%s} (%s, uuid) VALUES (%d, '%s')",
+          $types[$type]['table'], $types[$type]['colname'], $array[$types[$type]['colname']], $uuid);
+        break;
+      case 'delete':
+        db_query('DELETE FROM {%s} WHERE %s = %d',
+          $types[$type]['table'], $types[$type]['colname'], $array[$types[$type]['colname']]);
+        break;
+    }
+  }
+}
+
+/**
  * Determines if a UUID is valid.
  */
 function uuid_is_valid($uuid) {

