view src/imap/commands-util.h @ 1041:47ecd950a702 HEAD

some header file cleanups
author Timo Sirainen <tss@iki.fi>
date Mon, 27 Jan 2003 06:23:45 +0200
parents 81cbc1467097
children 03f1455664d7
line wrap: on
line source

#ifndef __COMMANDS_UTIL_H
#define __COMMANDS_UTIL_H

struct mail_full_flags;

/* If should_exist is TRUE, this function returns TRUE if the mailbox
   exists. If it doesn't exist but would be a valid mailbox name, the
   error message is prefixed with [TRYCREATE].

   If should_exist is FALSE, the should_not_exist specifies if we should
   return TRUE or FALSE if mailbox doesn't exist. */
int client_verify_mailbox_name(struct client *client, const char *mailbox,
			       int should_exist, int should_not_exist);

/* Returns TRUE if mailbox is selected. If not, sends "No mailbox selected"
   error message to client. */
int client_verify_open_mailbox(struct client *client);

/* Synchronize selected mailbox with client by sending EXPUNGE,
   FETCH FLAGS, EXISTS and RECENT responses. */
void client_sync_full(struct client *client);

/* Synchronize all but expunges with client. */
void client_sync_without_expunges(struct client *client);

/* Send last mail storage error message to client. */
void client_send_storage_error(struct client *client);

/* Send untagged error message to client. Doesn't check for inconsistency,
   so should be called only by CLOSE, SELECT and UNSELECT. */
void client_send_closing_mailbox_error(struct client *client);

/* Parse flags. Returns TRUE if successful, if not sends an error message to
   client. */
int client_parse_mail_flags(struct client *client, struct imap_arg *args,
			    struct mail_full_flags *flags);

/* Send FLAGS + PERMANENTFLAGS to client. */
void client_send_mailbox_flags(struct client *client, struct mailbox *box,
			       const char *custom_flags[],
			       unsigned int custom_flags_count);

#endif