memcache.h
changeset 48 1c67f512779b
parent 46 8a832c0e01ee
child 49 10c7dce1a043
--- a/memcache.h	Thu Aug 28 03:14:07 2008 +0300
+++ b/memcache.h	Fri Aug 29 23:31:17 2008 +0300
@@ -43,7 +43,7 @@
     /*
      * The length of the key buffer in bytes. This does not include a NUL byte.
      *
-     * If this is given as zero, then the length will be calculsted from buf using strlen(). Empty keys are not
+     * If this is given as zero, then the length will be calculated from buf using strlen(). Empty keys are not
      * allowed, so this will result in an error if buf is an empty string.
      */
     size_t len;
@@ -54,7 +54,7 @@
  */
 struct memcache_obj {
     /*
-     * An arbitrary 16-bit (32-bit for >1.2.1) that the server stores transparently.
+     * An arbitrary 16-bit (32-bit for >1.2.1) integer that the server stores transparently.
      */
     unsigned int flags;
 
@@ -230,7 +230,7 @@
 /*
  * Request states
  */
-enum memcache_req_state {
+enum memcache_state {
     MEMCACHE_STATE_INVALID,
     
     /*
@@ -269,7 +269,7 @@
      *
      * req_reply, req_obj and req_buf will all return non-NULL values, and buf.offset will be equal to buf.len.
      */
-    MEMCACHE_STATE_DATA_DONE,
+    MEMCACHE_STATE_DONE_DATA,
     
     /*
      * An error has occurred.
@@ -312,10 +312,12 @@
  *  ---------------------------------------------
  *  STATE_QUEUE                 ?
  *  STATE_SEND
- *  STATE_REPLY                         RPL_VALUE
+ *      STATE_REPLY                     RPL_VALUE
  *      STATE_REPLY_DATA        *       RPL_VALUE
- *      STATE_DATA_DONE                 RPL_END
+ *      STATE_REPLY_DATA                RPL_END
+ *      STATE_DONE_DATA                 RPL_END
  *
+ *      STATE_REPLY                     RPL_END
  *      STATE_DONE                      RPL_END
  *
  *  STATE_ERROR                         RPL_{ERROR,CLIENT_ERROR,SERVER_ERROR}
@@ -353,7 +355,7 @@
  *
  * Should always return a valid value.
  */ 
-enum memcache_req_state memcache_req_state (struct memcache_req *req);
+enum memcache_state memcache_req_state (struct memcache_req *req);
 
 /*
  * Request command.
@@ -365,7 +367,7 @@
 /*
  * Request reply.
  *
- * Will return a valid value in the STATE_REPLY, STATE_REPLY_DATA, STATE_DONE and STATE_DATA_DONE states.
+ * Will return a valid value in the STATE_REPLY, STATE_REPLY_DATA, STATE_DONE and STATE_DONE_DATA states.
  */
 enum memcache_reply memcache_req_reply (struct memcache_req *req);
 
@@ -374,19 +376,19 @@
  *
  * Will return a valid valuein all states
  */
-const struct memcache_key *keymemcache_req_key (struct memcache_req *req);
+const struct memcache_key *memcache_req_key (struct memcache_req *req);
 
 /*
  * Request data.
  *
- * Will return a valid value in the STATE_REPLY, STATE_REPLY_DATA, STATE_DONE and STATE_DATA_DONE states.
+ * Will return a valid value in the STATE_REPLY, STATE_REPLY_DATA, STATE_DONE and STATE_DONE_DATA states.
  */
 const struct memcache_obj *memcache_req_obj (struct memcache_req *req);
 
 /*
  * Request buf.
  *
- * Will return a valid value in the STATE_REPLY_DATA and STATE_DATA_DONE states.
+ * Will return a valid value in the STATE_REPLY_DATA and STATE_DONE_DATA states.
  *
  * Note that buf.offset may be less than buf.len in the STATE_REPLY_DATA state.
  */
@@ -402,7 +404,7 @@
 void memcache_req_abort (struct memcache_req *req);
 
 /*
- * Free a req that is in the STATE_DONE, STATE_DATA_DONE or STATE_ERROR state.
+ * Free a req that is in the STATE_DONE, STATE_DONE_DATA or STATE_ERROR state.
  */
 void memcache_req_free (struct memcache_req *req);
 
@@ -411,6 +413,6 @@
  */
 const char *memcache_command_str (enum memcache_command cmd);
 const char *memcache_reply_str (enum memcache_reply reply);
-const char *memcache_state_str (enum memcache_req_state state);
+const char *memcache_state_str (enum memcache_state state);
 
 #endif /* MEMCACHE_H */