1 /** 2 * @file 3 * Subject Regex handling 4 * 5 * @authors 6 * Copyright (C) 2021 Richard Russon <rich@flatcap.org> 7 * 8 * @copyright 9 * This program is free software: you can redistribute it and/or modify it under 10 * the terms of the GNU General Public License as published by the Free Software 11 * Foundation, either version 2 of the License, or (at your option) any later 12 * version. 13 * 14 * This program is distributed in the hope that it will be useful, but WITHOUT 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 * details. 18 * 19 * You should have received a copy of the GNU General Public License along with 20 * this program. If not, see <http://www.gnu.org/licenses/>. 21 */ 22 23 #ifndef MUTT_SUBJECTRX_H 24 #define MUTT_SUBJECTRX_H 25 26 #include <stdbool.h> 27 #include <stdint.h> 28 #include "core/lib.h" 29 30 struct Buffer; 31 struct Envelope; 32 33 /** 34 * enum NotifySubjRx - Subject Regex notification types 35 * 36 * @note Notifications are sent **after** the event. 37 */ 38 enum NotifySubjRx 39 { 40 NT_SUBJRX_ADD = 1, ///< Subject Regex has been added 41 NT_SUBJRX_DELETE, ///< Subject Regex has been deleted 42 NT_SUBJRX_DELETE_ALL, ///< All Subject Regexes have been deleted 43 }; 44 45 void subjrx_init(void); 46 void subjrx_free(void); 47 48 enum CommandResult parse_subjectrx_list (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err); 49 enum CommandResult parse_unsubjectrx_list(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err); 50 51 bool subjrx_apply_mods(struct Envelope *env); 52 void subjrx_clear_mods(struct Mailbox *m); 53 54 #endif /* MUTT_SUBJECTRX_H */ 55