Rename variables for consistency or clarity.
/**
* mutt_pattern_group - Match a pattern to a Group
- * @param k Pattern to match
+ * @param pat Pattern to match
* @retval ptr Matching Group
* @retval ptr Newly created Group (if no match)
*/
-struct Group *mutt_pattern_group(const char *k)
+struct Group *mutt_pattern_group(const char *pat)
{
- struct Group *p = NULL;
+ struct Group *g = NULL;
- if (!k)
+ if (!pat)
return 0;
- p = mutt_hash_find(Groups, k);
- if (!p)
+ g = mutt_hash_find(Groups, pat);
+ if (!g)
{
- mutt_debug(LL_DEBUG2, "Creating group %s\n", k);
- p = mutt_mem_calloc(1, sizeof(struct Group));
- p->name = mutt_str_strdup(k);
- STAILQ_INIT(&p->rs);
- mutt_hash_insert(Groups, p->name, p);
+ mutt_debug(LL_DEBUG2, "Creating group %s\n", pat);
+ g = mutt_mem_calloc(1, sizeof(struct Group));
+ g->name = mutt_str_strdup(pat);
+ STAILQ_INIT(&g->rs);
+ mutt_hash_insert(Groups, g->name, g);
}
- return p;
+ return g;
}
/**
int mutt_grouplist_remove_addrlist(struct GroupList *head, struct Address *a);
bool mutt_group_match(struct Group *g, const char *s);
-struct Group *mutt_pattern_group(const char *k);
+struct Group *mutt_pattern_group(const char *pat);
#endif /* MUTT_GROUP_H */
}
else
{
- bool inputReady = false;
+ bool input_ready = false;
for (int i = 0; fds && (i < PollFdsCount); i++)
{
if (PollFds[i].revents)
fds--;
if (PollFds[i].fd == 0)
{
- inputReady = true;
+ input_ready = true;
}
else if (PollFds[i].fd == INotifyFd)
{
}
}
}
- if (!inputReady)
+ if (!input_ready)
rc = MonitorFilesChanged ? -2 : -3;
}
}
/**
* mutt_file_sanitize_filename - Replace unsafe characters in a filename
- * @param fp Filename to make safe
+ * @param path Filename to make safe
* @param slash Replace '/' characters too
*/
-void mutt_file_sanitize_filename(char *fp, bool slash)
+void mutt_file_sanitize_filename(char *path, bool slash)
{
- if (!fp)
+ if (!path)
return;
- for (; *fp; fp++)
+ for (; *path; path++)
{
- if ((slash && (*fp == '/')) || !strchr(safe_chars, *fp))
- *fp = '_';
+ if ((slash && (*path == '/')) || !strchr(safe_chars, *path))
+ *path = '_';
}
}
int mutt_file_rename(const char *oldfile, const char *newfile);
int mutt_file_rmtree(const char *path);
int mutt_file_safe_rename(const char *src, const char *target);
-void mutt_file_sanitize_filename(char *fp, bool slash);
+void mutt_file_sanitize_filename(char *path, bool slash);
int mutt_file_sanitize_regex(struct Buffer *dest, const char *src);
void mutt_file_set_mtime(const char *from, const char *to);
int mutt_file_stat_compare(struct stat *sba, enum MuttStatType sba_type, struct stat *sbb, enum MuttStatType sbb_type);
/**
* mutt_md5_process_bytes - Process a block of data
- * @param buffer Buffer to process
- * @param len Length of buffer
+ * @param buf Buffer to process
+ * @param buflen Length of buffer
* @param md5ctx MD5 context
*
* Starting with the result of former calls of this function (or the
- * initialization function update the context for the next LEN bytes starting
- * at Buffer. It is NOT required that LEN is a multiple of 64.
+ * initialization function update the context for the next BUFLEN bytes starting
+ * at Buffer. It is NOT required that BUFLEN is a multiple of 64.
*/
-void mutt_md5_process_bytes(const void *buffer, size_t len, struct Md5Ctx *md5ctx)
+void mutt_md5_process_bytes(const void *buf, size_t buflen, struct Md5Ctx *md5ctx)
{
/* When we already have some bits in our internal buffer concatenate both
* inputs first. */
if (md5ctx->buflen != 0)
{
size_t left_over = md5ctx->buflen;
- size_t add = ((128 - left_over) > len) ? len : (128 - left_over);
+ size_t add = ((128 - left_over) > buflen) ? buflen : (128 - left_over);
- memcpy(&((char *) md5ctx->buffer)[left_over], buffer, add);
+ memcpy(&((char *) md5ctx->buffer)[left_over], buf, add);
md5ctx->buflen += add;
if (md5ctx->buflen > 64)
md5ctx->buflen);
}
- buffer = (const char *) buffer + add;
- len -= add;
+ buf = (const char *) buf + add;
+ buflen -= add;
}
/* Process available complete blocks. */
- if (len >= 64)
+ if (buflen >= 64)
{
#if !defined(_STRING_ARCH_unaligned)
#define alignof(type) offsetof(struct { char c; type x; }, x)
#define UNALIGNED_P(p) (((size_t) p) % alignof(md5_uint32) != 0)
- if (UNALIGNED_P(buffer))
+ if (UNALIGNED_P(buf))
{
- while (len > 64)
+ while (buflen > 64)
{
- mutt_md5_process_block(memcpy(md5ctx->buffer, buffer, 64), 64, md5ctx);
- buffer = (const char *) buffer + 64;
- len -= 64;
+ mutt_md5_process_block(memcpy(md5ctx->buffer, buf, 64), 64, md5ctx);
+ buf = (const char *) buf + 64;
+ buflen -= 64;
}
}
else
#endif
{
- mutt_md5_process_block(buffer, len & ~63, md5ctx);
- buffer = (const char *) buffer + (len & ~63);
- len &= 63;
+ mutt_md5_process_block(buf, buflen & ~63, md5ctx);
+ buf = (const char *) buf + (buflen & ~63);
+ buflen &= 63;
}
}
/* Move remaining bytes in internal buffer. */
- if (len > 0)
+ if (buflen > 0)
{
size_t left_over = md5ctx->buflen;
- memcpy(&((char *) md5ctx->buffer)[left_over], buffer, len);
- left_over += len;
+ memcpy(&((char *) md5ctx->buffer)[left_over], buf, buflen);
+ left_over += buflen;
if (left_over >= 64)
{
mutt_md5_process_block(md5ctx->buffer, 64, md5ctx);
if (fp_tmp)
{
- char sasha[1024];
+ char line_buf[1024];
int lines = 0;
mutt_write_mime_body(e->content, fp_tmp);
/* count the number of lines */
rewind(fp_tmp);
- while (fgets(sasha, sizeof(sasha), fp_tmp))
+ while (fgets(line_buf, sizeof(line_buf), fp_tmp))
lines++;
fprintf(msg->fp, "Content-Length: " OFF_T_FMT "\n", (LOFF_T) ftello(fp_tmp));
fprintf(msg->fp, "Lines: %d\n\n", lines);