| | 89 | } |
| | 90 | |
| | 91 | HEADER* imap_hcache_get (IMAP_DATA* idata, unsigned int uid) |
| | 92 | { |
| | 93 | char key[16]; |
| | 94 | unsigned int* uv; |
| | 95 | HEADER* h = NULL; |
| | 96 | |
| | 97 | sprintf(key, "/%u", uid); |
| | 98 | uv = (unsigned int*)mutt_hcache_fetch (idata->hcache, key, |
| | 99 | imap_hcache_keylen); |
| | 100 | if (uv) |
| | 101 | { |
| | 102 | if (*uv == idata->uid_validity) |
| | 103 | h = mutt_hcache_restore ((unsigned char*)uv, NULL); |
| | 104 | FREE (&uv); |
| | 105 | } |
| | 106 | |
| | 107 | return h; |
| | 108 | } |
| | 109 | |
| | 110 | int imap_hcache_put (IMAP_DATA* idata, HEADER* h) |
| | 111 | { |
| | 112 | char key[16]; |
| | 113 | |
| | 114 | sprintf(key, "/%u", HEADER_DATA (h)->uid); |
| | 115 | return mutt_hcache_store (idata->hcache, key, h, idata->uid_validity, |
| | 116 | imap_hcache_keylen); |