#include "mailbox.h"
#include "mutt_curses.h"
#include "mx.h"
+#include "compress.h"
/* Notes:
* Any references to compressed files also apply to encrypted files.
}
-struct mx_ops mx_comp_ops;
-
/**
* open_mailbox - Open a compressed mailbox
* @ctx: Mailbox to open
/**
- * comp_can_append - Can we append to this path?
+ * mutt_comp_can_append - Can we append to this path?
* @path: pathname of file to be tested
*
* To append to a file we can either use an 'append-hook' or a combination of
* 0: No, appending isn't possible
*/
int
-comp_can_append (CONTEXT *ctx)
+mutt_comp_can_append (CONTEXT *ctx)
{
if (!ctx)
return 0;
}
/**
- * comp_can_read - Can we read from this file?
+ * mutt_comp_can_read - Can we read from this file?
* @path: Pathname of file to be tested
*
* Search for an 'open-hook' with a regex that matches the path.
* 0: No, we cannot read the file
*/
int
-comp_can_read (const char *path)
+mutt_comp_can_read (const char *path)
{
if (!path)
return 0;
}
/**
- * comp_sync - Save changes to the compressed mailbox file
+ * mutt_comp_sync - Save changes to the compressed mailbox file
* @ctx: Mailbox to sync
*
- * Changes in Mutt only affect the tmp file. Calling comp_sync() will commit
- * them to the compressed file.
+ * Changes in Mutt only affect the tmp file. Calling mutt_comp_sync()
+ * will commit them to the compressed file.
*
* Returns:
* 0: Success
* -1: Failure
*/
int
-comp_sync (CONTEXT *ctx)
+mutt_comp_sync (CONTEXT *ctx)
{
if (!ctx)
return -1;
}
/**
- * comp_valid_command - Is this command string allowed?
+ * mutt_comp_valid_command - Is this command string allowed?
* @cmd: Command string
*
* A valid command string must have both "%f" (from file) and "%t" (to file).
* 0: "%f" and/or "%t" is missing
*/
int
-comp_valid_command (const char *cmd)
+mutt_comp_valid_command (const char *cmd)
{
if (!cmd)
return 0;
#ifndef _COMPRESS_H_
#define _COMPRESS_H_
-int comp_can_append (CONTEXT *ctx);
-int comp_can_read (const char *path);
-int comp_sync (CONTEXT *ctx);
-int comp_valid_command (const char *cmd);
+int mutt_comp_can_append (CONTEXT *ctx);
+int mutt_comp_can_read (const char *path);
+int mutt_comp_sync (CONTEXT *ctx);
+int mutt_comp_valid_command (const char *cmd);
extern struct mx_ops mx_comp_ops;
}
#ifdef USE_COMPRESSED
else if (data & (MUTT_APPENDHOOK | MUTT_OPENHOOK | MUTT_CLOSEHOOK)) {
- if (comp_valid_command (command.data) == 0) {
+ if (mutt_comp_valid_command (command.data) == 0) {
strfcpy (err->data, _("badly formatted command string"), err->dsize);
return -1;
}
#ifdef USE_COMPRESSED
/* If there are no other matches, see if there are any
* compress hooks that match */
- if ((magic == 0) && comp_can_read (path))
+ if ((magic == 0) && mutt_comp_can_read (path))
return MUTT_COMPRESSED;
#endif
return (magic);
}
#ifdef USE_COMPRESSED
- if (comp_can_append (ctx))
+ if (mutt_comp_can_append (ctx))
ctx->mx_ops = &mx_comp_ops;
else
#endif
#ifdef USE_COMPRESSED
/* If everything went well, the mbox handler saved the changes to our
- * temporary file. Next, comp_sync() will compress the temporary file. */
+ * temporary file. Next, mutt_comp_sync() will compress the temporary file. */
if ((rc == 0) && ctx->compress_info)
- return comp_sync (ctx);
+ return mutt_comp_sync (ctx);
#endif
return rc;