* this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * @page parameter Store attributes associated with a MIME part
+ *
+ * Store attributes associated with a MIME part
+ *
+ * | Function | Description
+ * | :--------------------------- | :---------------------------------------------------------
+ * | mutt_delete_parameter() | Delete a matching Parameter
+ * | mutt_free_parameter() | Free a Parameter
+ * | mutt_get_parameter() | Find a matching Parameter
+ * | mutt_set_parameter() | Set a Parameter
+ */
+
#include "config.h"
#include "parameter.h"
+/**
+ * mutt_free_parameter - Free a Parameter
+ * @param p Parameter to free
+ */
void mutt_free_parameter(struct Parameter **p)
{
struct Parameter *t = *p;
*p = 0;
}
+/**
+ * mutt_get_parameter - Find a matching Parameter
+ * @param s String to match
+ * @param p Parameter list
+ * @retval ptr Matching Parameter
+ * @reval NULL No match
+ */
char *mutt_get_parameter(const char *s, struct Parameter *p)
{
for (; p; p = p->next)
return NULL;
}
+/**
+ * mutt_set_parameter - Set a Parameter
+ * @param[in] attribute Attribute to match
+ * @param[in] value Value to set
+ * @param[out] p Parameter that was set
+ *
+ * @note If value is NULL, the Parameter will be deleted
+ *
+ * @note If a matching Parameter isn't found a new one will be allocated.
+ * The new Parameter will be inserted at the front of the list.
+ */
void mutt_set_parameter(const char *attribute, const char *value, struct Parameter **p)
{
struct Parameter *q = NULL;
*p = q;
}
+/**
+ * mutt_delete_parameter - Delete a matching Parameter
+ * @param[in] attribute Attribute to match
+ * @param[out] p Parameter after the deleted Parameter
+ */
void mutt_delete_parameter(const char *attribute, struct Parameter **p)
{
for (struct Parameter *q = *p; q; p = &q->next, q = q->next)