Expando Node for a Conditional Date. More...
#include "config.h"
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "mutt/lib.h"
#include "node_conddate.h"
#include "helpers.h"
#include "node.h"
#include "parse.h"
#include "render.h"
Go to the source code of this file.
Functions | |
struct NodeCondDatePrivate * | node_conddate_private_new (int count, char period) |
Create new CondDate private data. | |
void | node_conddate_private_free (void **ptr) |
Free CondDate private data - Implements ExpandoNode::ndata_free() | |
time_t | cutoff_number (char period, int count) |
Calculate the cutoff time for n units. | |
time_t | cutoff_this (char period) |
Calculcate the cutoff time of this unit. | |
int | node_conddate_render (const struct ExpandoNode *node, const struct ExpandoRenderData *rdata, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags) |
Render a CondDate Node - Implements ExpandoNode::render() -. | |
struct ExpandoNode * | node_conddate_new (int count, char period, int did, int uid) |
Create a new CondDate ExpandoNode. | |
struct ExpandoNode * | node_conddate_parse (const char *str, int did, int uid, const char **parsed_until, struct ExpandoParseError *err) |
Parse a CondDate format string - Implements ExpandoDefinition::parse() -. | |
Expando Node for a Conditional Date.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file node_conddate.c.
struct NodeCondDatePrivate * node_conddate_private_new | ( | int | count, |
char | period | ||
) |
Create new CondDate private data.
count | Number of 'units' to count |
period | Units, e.g. 'd' Day or 'm' Month |
ptr | New CondDate private data |
Definition at line 49 of file node_conddate.c.
void node_conddate_private_free | ( | void ** | ptr | ) |
Free CondDate private data - Implements ExpandoNode::ndata_free()
ptr | Data to free |
Definition at line 63 of file node_conddate.c.
time_t cutoff_number | ( | char | period, |
int | count | ||
) |
Calculate the cutoff time for n units.
period | Time period, from [ymwdHM] |
count | Number of time periods |
num | Cutoff time |
Calculate the cutoff time for, say, 3 months, or 2 hours.
Definition at line 79 of file node_conddate.c.
time_t cutoff_this | ( | char | period | ) |
Calculcate the cutoff time of this unit.
period | Time period, from [ymwdHM] |
num | Cutoff time |
Calculate the cutoff time of, say, this day (today), this month.
Definition at line 122 of file node_conddate.c.
struct ExpandoNode * node_conddate_new | ( | int | count, |
char | period, | ||
int | did, | ||
int | uid | ||
) |
Create a new CondDate ExpandoNode.
count | Number of 'units' to count |
period | Units, e.g. 'd' Day or 'm' Month |
did | Domain ID |
uid | Unique ID |
ptr | New CondDate ExpandoNode |
Definition at line 191 of file node_conddate.c.