+#if ENABLE_FEATURE_CROND_SPECIAL_TIMES
+ if (tokens[0][0] == '@') {
+ /*
+ * "@daily /a/script/to/run PARAM1 PARAM2..."
+ */
+ typedef struct SpecialEntry {
+ const char *name;
+ const char tokens[8];
+ } SpecialEntry;
+ static const SpecialEntry SpecAry[] = {
+ /* hour day month weekday */
+ { "yearly", "0\0" "1\0" "1\0" "*" },
+ { "annually", "0\0" "1\0" "1\0" "*" },
+ { "monthly", "0\0" "1\0" "*\0" "*" },
+ { "weekly", "0\0" "*\0" "*\0" "0" },
+ { "daily", "0\0" "*\0" "*\0" "*" },
+ { "midnight", "0\0" "*\0" "*\0" "*" },
+ { "hourly", "*\0" "*\0" "*\0" "*" },
+ { "reboot", "" },
+ };
+ const SpecialEntry *e = SpecAry;
+
+ if (n < 2)
+ continue;
+ for (;;) {
+ if (strcmp(e->name, tokens[0] + 1) == 0) {
+ /*
+ * tokens[1] is only the first word of command,
+ * can'r use it.
+ * find the entire command in unmodified string:
+ */
+ tokens[5] = skip_whitespace(
+ skip_non_whitespace(
+ skip_whitespace(parser->data)));
+ if (e->tokens[0]) {
+ char *et = (char*)e->tokens;
+ /* minute is "0" for all specials */
+ tokens[0] = (char*)"0";
+ tokens[1] = et;
+ tokens[2] = et + 2;
+ tokens[3] = et + 4;
+ tokens[4] = et + 6;
+ }
+ goto got_it;
+ }
+ if (!e->tokens[0])
+ break;
+ e++;
+ }
+ continue; /* bad line (unrecognized '@foo') */
+ }
+#endif