Re: Message Flags Storage for IMAP

DINH Viet Hoa <[email protected]>
Newsgroups gmane.mail.libetpan.user
Message-ID <etPan.40d01218.8a53250.6110@homer>
Jason Beard wrote :

> We have some custom flags to add to messages i.e. \Archived... does the 
> mailmessage_check() work in the same way with the fl_extension flags?

Yes, but note that the following calls exist to help you to play with
fl_extension :


/*
  mail_flags_add_extension adds the given flag if it does not exists in
  the flags.

  @param flags this is the flag to change

  @param ext_flag this is the name of an extension flag
    the given flag name is duplicated and is no more needed after
    the function call.

  @return MAIL_NO_ERROR is returned on success, MAIL_ERROR_XXX is returned
    on error
*/


int mail_flags_add_extension(struct mail_flags * flags,
                             char * ext_flag);

/*
  mail_flags_remove_extension removes the given flag if it does not exists in
  the flags.

  @param flags this is the flag to change

  @param ext_flag this is the name of an extension flag
    the given flag name is no more needed after the function call.

  @return MAIL_NO_ERROR is returned on success, MAIL_ERROR_XXX is returned
    on error
*/

int mail_flags_remove_extension(struct mail_flags * flags,
                                char * ext_flag);

/*
  mail_flags_has_extension returns 1 if the flags is in the given flags,
    0 is returned otherwise.

  @param flags this is the flag to change

  @param ext_flag this is the name of an extension flag
    the given flag name is no more needed after the function call.

  @return MAIL_NO_ERROR is returned on success, MAIL_ERROR_XXX is returned
    on error
*/


All these functions will copy the string for you, so that you can free 
it after you passed it to one of these functions.

-- 
DINH V. Hoa,

"T'aurais pas une question sur le langage C ?" -- Emmanuel Delahaye
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQBA0BKs7w+pfAWHa3MRAnfLAJ9sKcZ5U2xE3MeogOVG0JD5XIzZUwCePKPO
L4YX1mqm2c2cd/piMU+ADt4=
=EzEI
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.