<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,11 @@
 2009-04-06  Mikio Hirabayashi  &lt;mikio@users.sourceforge.net&gt;
 
+	* scrext.c (serv_mapreduce): the parameter for the target keys became an option.
+
+	- Release: 1.1.22
+
+2009-04-06  Mikio Hirabayashi  &lt;mikio@users.sourceforge.net&gt;
+
 	* scrext.c (serv_mapreduce): the parameter for the session ID was abolished.
 
 	- Release: 1.1.21</diff>
      <filename>ChangeLog</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for tokyotyrant 1.1.21.
+# Generated by GNU Autoconf 2.61 for tokyotyrant 1.1.22.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -572,8 +572,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='tokyotyrant'
 PACKAGE_TARNAME='tokyotyrant'
-PACKAGE_VERSION='1.1.21'
-PACKAGE_STRING='tokyotyrant 1.1.21'
+PACKAGE_VERSION='1.1.22'
+PACKAGE_STRING='tokyotyrant 1.1.22'
 PACKAGE_BUGREPORT=''
 
 # Factoring default headers for most tests.
@@ -1194,7 +1194,7 @@ if test &quot;$ac_init_help&quot; = &quot;long&quot;; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat &lt;&lt;_ACEOF
-\`configure' configures tokyotyrant 1.1.21 to adapt to many kinds of systems.
+\`configure' configures tokyotyrant 1.1.22 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1255,7 +1255,7 @@ fi
 
 if test -n &quot;$ac_init_help&quot;; then
   case $ac_init_help in
-     short | recursive ) echo &quot;Configuration of tokyotyrant 1.1.21:&quot;;;
+     short | recursive ) echo &quot;Configuration of tokyotyrant 1.1.22:&quot;;;
    esac
   cat &lt;&lt;\_ACEOF
 
@@ -1350,7 +1350,7 @@ fi
 test -n &quot;$ac_init_help&quot; &amp;&amp; exit $ac_status
 if $ac_init_version; then
   cat &lt;&lt;\_ACEOF
-tokyotyrant configure 1.1.21
+tokyotyrant configure 1.1.22
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1364,7 +1364,7 @@ cat &gt;config.log &lt;&lt;_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by tokyotyrant $as_me 1.1.21, which was
+It was created by tokyotyrant $as_me 1.1.22, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -5929,7 +5929,7 @@ exec 6&gt;&amp;1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log=&quot;
-This file was extended by tokyotyrant $as_me 1.1.21, which was
+This file was extended by tokyotyrant $as_me 1.1.22, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -5972,7 +5972,7 @@ Report bugs to &lt;bug-autoconf@gnu.org&gt;.&quot;
 _ACEOF
 cat &gt;&gt;$CONFIG_STATUS &lt;&lt;_ACEOF
 ac_cs_version=&quot;\\
-tokyotyrant config.status 1.1.21
+tokyotyrant config.status 1.1.22
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\&quot;`echo &quot;$ac_configure_args&quot; | sed 's/^ //; s/[\\&quot;&quot;\`\$]/\\\\&amp;/g'`\\&quot;
 </diff>
      <filename>configure</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@
 #================================================================
 
 # Package name
-AC_INIT(tokyotyrant, 1.1.21)
+AC_INIT(tokyotyrant, 1.1.22)
 
 # Package information
 MYLIBVER=3</diff>
      <filename>configure.in</filename>
    </modified>
    <modified>
      <diff>@@ -1321,11 +1321,11 @@ int main(int argc, char **argv){
 &lt;dd&gt;Process each record atomically.&lt;/dd&gt;
 &lt;dd&gt;`&lt;var&gt;func&lt;/var&gt;' the iterator function called for each record.  It receives two parameters of the key and the value, and returns true to continue iteration or false to stop iteration.&lt;/dd&gt;
 &lt;dd&gt;If successful, the return value is true, else, it is false.&lt;/dd&gt;
-&lt;dt&gt;&lt;code&gt;_mapreduce(&lt;var&gt;keys&lt;/var&gt;, &lt;var&gt;mapper&lt;/var&gt;, &lt;var&gt;reducer&lt;/var&gt;)&lt;/code&gt;&lt;/dt&gt;
+&lt;dt&gt;&lt;code&gt;_mapreduce(&lt;var&gt;mapper&lt;/var&gt;, &lt;var&gt;reducer&lt;/var&gt;, &lt;var&gt;keys&lt;/var&gt;)&lt;/code&gt;&lt;/dt&gt;
 &lt;dd&gt;Perform operations based on MapReduce.&lt;/dd&gt;
-&lt;dd&gt;`&lt;var&gt;keys&lt;/var&gt;' specifies the keys of target records.  If it is not defined, every record in the database is processed.&lt;/dd&gt;
 &lt;dd&gt;`&lt;var&gt;mapper&lt;/var&gt;' specifies the mapper function.  It is called for each target record and receives the key, the value, and the function to emit the mapped records.  The emitter function receives a key and a value.  The mapper function should return true normally or false on failure.&lt;/dd&gt;
 &lt;dd&gt;`&lt;var&gt;reducer&lt;/var&gt;' specifies the reducer function.  It is called for each record generated by sorting emitted records by keys, and receives the key and an array of values.  The reducer function should return true normally or false on failure.&lt;/dd&gt;
+&lt;dd&gt;`&lt;var&gt;keys&lt;/var&gt;' specifies the keys of target records.  If it is not defined, every record in the database is processed.&lt;/dd&gt;
 &lt;dd&gt;If successful, the return value is true, else, it is false.&lt;/dd&gt;
 &lt;dt&gt;&lt;code&gt;_stashput(&lt;var&gt;key&lt;/var&gt;, &lt;var&gt;value&lt;/var&gt;)&lt;/code&gt;&lt;/dt&gt;
 &lt;dd&gt;Store a record into the stash.&lt;/dd&gt;</diff>
      <filename>doc/index.html</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,7 @@ function wordcount(texpr)
       res = res .. key .. &quot;\t&quot; .. #values .. &quot;\n&quot;
       return true
    end
-   if not _mapreduce(targets, mapper, reducer) then
+   if not _mapreduce(mapper, reducer, targets) then
       res = nil
    end
    return res</diff>
      <filename>ext/mapreduce.lua</filename>
    </modified>
    <modified>
      <diff>@@ -888,47 +888,49 @@ static int serv_foreach(lua_State *lua){
 /* for _mapreduce function */
 static int serv_mapreduce(lua_State *lua){
   int argc = lua_gettop(lua);
-  if(argc &lt; 3){
+  if(argc &lt; 2){
     lua_pushstring(lua, &quot;_mapreduce: invalid arguments&quot;);
     lua_error(lua);
   }
-  if(!lua_isfunction(lua, 2) || !lua_isfunction(lua, 3)){
+  if(!lua_isfunction(lua, 1) || !lua_isfunction(lua, 2)){
     lua_pushstring(lua, &quot;_mapreduce: invalid arguments&quot;);
     lua_error(lua);
   }
-  lua_getglobal(lua, SERVVAR);
-  SERV *serv = lua_touserdata(lua, -1);
+  lua_pushvalue(lua, 1);
+  lua_setglobal(lua, MRMAPVAR);
+  lua_pushvalue(lua, 2);
+  lua_setglobal(lua, MRREDVAR);
   TCLIST *keys = NULL;
-  const char *kbuf;
-  size_t ksiz;
-  int len;
-  switch(lua_type(lua, 1)){
-  case LUA_TNUMBER:
-  case LUA_TSTRING:
-    keys = tclistnew2(1);
-    kbuf = lua_tolstring(lua, 1, &amp;ksiz);
-    tclistpush(keys, kbuf, ksiz);
-    break;
-  case LUA_TTABLE:
-    len = lua_objlen(lua, 1);
-    keys = tclistnew2(len);
-    for(int i = 1; i &lt;= len; i++){
-      lua_rawgeti(lua, 1, i);
-      switch(lua_type(lua, -1)){
-      case LUA_TNUMBER:
-      case LUA_TSTRING:
-        kbuf = lua_tolstring(lua, -1, &amp;ksiz);
-        tclistpush(keys, kbuf, ksiz);
-        break;
+  if(argc &gt; 2){
+    const char *kbuf;
+    size_t ksiz;
+    int len;
+    switch(lua_type(lua, 3)){
+    case LUA_TNUMBER:
+    case LUA_TSTRING:
+      keys = tclistnew2(1);
+      kbuf = lua_tolstring(lua, 3, &amp;ksiz);
+      tclistpush(keys, kbuf, ksiz);
+      break;
+    case LUA_TTABLE:
+      len = lua_objlen(lua, 3);
+      keys = tclistnew2(len);
+      for(int i = 1; i &lt;= len; i++){
+        lua_rawgeti(lua, 3, i);
+        switch(lua_type(lua, -1)){
+        case LUA_TNUMBER:
+        case LUA_TSTRING:
+          kbuf = lua_tolstring(lua, -1, &amp;ksiz);
+          tclistpush(keys, kbuf, ksiz);
+          break;
+        }
+        lua_pop(lua, 1);
       }
-      lua_pop(lua, 1);
+      break;
     }
-    break;
   }
-  lua_pushvalue(lua, 2);
-  lua_setglobal(lua, MRMAPVAR);
-  lua_pushvalue(lua, 3);
-  lua_setglobal(lua, MRREDVAR);
+  lua_getglobal(lua, SERVVAR);
+  SERV *serv = lua_touserdata(lua, -1);
   bool err = false;
   TCBDB *bdb = tcbdbnew();
   lua_getglobal(lua, &quot;_tmpdir_&quot;);</diff>
      <filename>scrext.c</filename>
    </modified>
    <modified>
      <diff>@@ -419,7 +419,7 @@ bool ttserviskilled(TTSERV *serv);
  *************************************************************************************************/
 
 
-#define _TT_VERSION    &quot;1.1.21&quot;
+#define _TT_VERSION    &quot;1.1.22&quot;
 #define _TT_LIBVER     305
 #define _TT_PROTVER    &quot;0.9&quot;
 </diff>
      <filename>ttutil.h</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2ff3a29aa43df67321b786b4cc49831771b10dff</id>
    </parent>
  </parents>
  <author>
    <name>Bob Ippolito</name>
    <email>bob@redivi.com</email>
  </author>
  <url>http://github.com/etrepum/tokyo-tyrant/commit/75820448a76f99054905a0f16aea64216c586c4b</url>
  <id>75820448a76f99054905a0f16aea64216c586c4b</id>
  <committed-date>2009-04-10T17:35:02-07:00</committed-date>
  <authored-date>2009-04-10T17:35:02-07:00</authored-date>
  <message>sync with toktyotyrant-1.1.22.tar.gz</message>
  <tree>6990ff38b4dbc12ca673cdcd441f9197437277c8</tree>
  <committer>
    <name>Bob Ippolito</name>
    <email>bob@redivi.com</email>
  </committer>
</commit>
