Author: adrian.chadd
Date: Mon Apr 27 00:35:13 2009
New Revision: 13991

Modified:
    branches/LUSCA_HEAD/libsqstore/store_log.c
    branches/LUSCA_HEAD/libsqstore/store_log.h

Log:
Implement a simple "old" to "new" structure upgrade function.



Modified: branches/LUSCA_HEAD/libsqstore/store_log.c
==============================================================================
--- branches/LUSCA_HEAD/libsqstore/store_log.c  (original)
+++ branches/LUSCA_HEAD/libsqstore/store_log.c  Mon Apr 27 00:35:13 2009
@@ -2,6 +2,7 @@
  #include <stdlib.h>
  #include <unistd.h>
  #include <sys/types.h>
+#include <string.h>

  #include "../include/config.h"
  #include "../include/squid_md5.h"
@@ -19,3 +20,20 @@
      "SWAP_LOG_VERSION",
      "SWAP_LOG_MAX"
  };
+
+int
+storeSwapLogUpgradeEntry(storeSwapLogData *dst, storeSwapLogDataOld *src)
+{
+    dst->op = src->op;
+    dst->swap_filen = src->swap_filen;
+    dst->timestamp = src->timestamp;
+    dst->lastref = src->lastref;
+    dst->expires = src->expires;
+    dst->lastmod = src->lastmod;
+    dst->swap_file_sz = src->swap_file_sz;                     /* This is the 
entry whose  
size has changed */
+    dst->refcount = src->refcount;
+    dst->flags = src->flags;
+    memcpy(dst->key, src->key, SQUID_MD5_DIGEST_LENGTH);
+
+    return 1;
+}

Modified: branches/LUSCA_HEAD/libsqstore/store_log.h
==============================================================================
--- branches/LUSCA_HEAD/libsqstore/store_log.h  (original)
+++ branches/LUSCA_HEAD/libsqstore/store_log.h  Mon Apr 27 00:35:13 2009
@@ -52,4 +52,6 @@

  extern const char * swap_log_op_str[];

+extern int storeSwapLogUpgradeEntry(storeSwapLogData *dst,  
storeSwapLogDataOld *src);
+
  #endif

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to