| iMatix home page | << | < | > | >> |
SFL Version 2.11 |
#include "sflslot.h" int year_slot_set (byte *range, int day_from, int day_to)
Sets the slots for the specified day range. If day_to is zero, it is ignored; only the slot for day_from is set. Returns 0 if okay, -1 if the specified range is invalid.
{ if (day_to == 0) day_to = day_from; /* Range is just one day */ if (day_from > day_to) return (-1); /* Bad range */ while (day_from <= day_to) /* Find and set each bit */ { ASSERT (day_from >= 0 && day_from < MAX_DAY); range [BYTE (day_from)] |= BIT (day_from); day_from++; } return (0); /* No errors */ }
| << | < | > | >> | Copyright © 1996-2000 iMatix Corporation |