<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -28,38 +28,19 @@ static ID cDeletedId;
 static ID cIncValueId;
 static ID cOkId;
 
+static VALUE rb_memcache_protocol_reset(VALUE self) {
+  protocol_t *protocol;
+  Data_Get_Struct(self, protocol_t, protocol);
+  
+  memcache_protocol_reset(protocol);
+  return Qnil;
+}
+
 static void rb_memcache_protocol_free(void *ptr) {
   //will need to recursively free all of the bullshit associated with this
   dprintf(&quot;entering free\n&quot;);
   protocol_t *protocol = (protocol_t *)ptr;
-  int i, n;
-  value_t *value;
-  stat_t *stat;
-  
-  for(i=0; i&lt;protocol-&gt;values.len; i++) {
-    value = &amp;protocol-&gt;values.array[i];
-    dprintf(&quot;freeing key for %d\n&quot;, i);
-    if (value-&gt;key) {free(value-&gt;key);}
-    dprintf(&quot;freeing data for %d\n&quot;, i);
-    if (value-&gt;data) {free(value-&gt;data);}
-  }
-  if (protocol-&gt;values.array) {
-    dprintf(&quot;freeing values array %p\n&quot;, protocol-&gt;values.array);
-    free(protocol-&gt;values.array);
-  }
-  if (protocol-&gt;error) {
-    free(protocol-&gt;error);
-  }
-  if (protocol-&gt;version) {
-    free(protocol-&gt;version);
-  }
-  for(i=0; i&lt;protocol-&gt;stats.len; i++) {
-    stat = &amp;protocol-&gt;stats.array[i];
-    if (stat-&gt;key) { free(stat-&gt;key); }
-    if (stat-&gt;string_val) { free(stat-&gt;string_val); }
-  } 
-  dprintf(&quot;freeing protocol\n&quot;);
-  free(protocol);
+  memcache_protocol_free(protocol);
 }
 
 static void rb_null_free(void *ptr) {
@@ -81,6 +62,13 @@ static VALUE rb_memcache_protocol_is_finished(VALUE self) {
   return memcache_protocol_is_finished(protocol) ? Qtrue : Qfalse;
 }
 
+static VALUE rb_memcache_protocol_is_start_state(VALUE self) {
+  protocol_t *protocol = NULL;
+  Data_Get_Struct(self, protocol_t, protocol);
+  
+  return memcache_protocol_is_start_state(protocol) ? Qtrue : Qfalse;
+}
+
 static VALUE rb_memcache_protocol_execute(VALUE self, VALUE data) {
   protocol_t *protocol = NULL;
   int cs;
@@ -284,6 +272,8 @@ void Init_memcache_protocol() {
   rb_define_method(cMemcacheProtocol, &quot;error?&quot;, rb_memcache_protocol_has_error,0);
   rb_define_method(cMemcacheProtocol, &quot;type&quot;, rb_memcache_protocol_type,0);
   rb_define_method(cMemcacheProtocol, &quot;finished?&quot;, rb_memcache_protocol_is_finished,0);
+  rb_define_method(cMemcacheProtocol, &quot;start_state?&quot;, rb_memcache_protocol_is_start_state,0);
+  rb_define_method(cMemcacheProtocol, &quot;reset!&quot;, rb_memcache_protocol_reset,0);
   rb_define_method(cMemcacheProtocol, &quot;values&quot;, rb_memcache_protocol_values,0);
   rb_define_method(cMemcacheProtocol, &quot;stats&quot;, rb_memcache_protocol_stats,0);
   rb_define_method(cMemcacheProtocol, &quot;version&quot;, rb_memcache_protocol_version,0);</diff>
      <filename>ext/memcache.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3b5054ce42fdbce7bf31eb43aeb1cd81dd4fc6e4</id>
    </parent>
  </parents>
  <author>
    <name>Cliff Moon</name>
    <email>cliff@moonpolysoft.com</email>
  </author>
  <url>http://github.com/tmm1/eventedcache/commit/6c0a19700e82202d5290aac2c21091ff412145b9</url>
  <id>6c0a19700e82202d5290aac2c21091ff412145b9</id>
  <committed-date>2009-01-12T23:21:46-08:00</committed-date>
  <authored-date>2009-01-12T23:21:46-08:00</authored-date>
  <message>refactor free location.  added wrappers for is start state and reset functions</message>
  <tree>c9233d67b4dd5db13d55aa56ee06c8d6aa58eae2</tree>
  <committer>
    <name>Cliff Moon</name>
    <email>cliff@moonpolysoft.com</email>
  </committer>
</commit>
