|
| iMatix home page | << | < | > | >> |
SFLVersion 2.11 |
#include "sflslot.h" int day_slot_clear (byte *range, int min_from, int min_to)
Clears the slots for the specified minute range. If min_to is zero, it is ignored; only the slot for min_from is cleared. Returns 0 if okay, -1 if the specified range is invalid.
{
if (min_to == 0)
min_to = min_from; /* Range is just one minute */
if (min_from > min_to)
return (-1); /* Bad range */
while (min_from <= min_to) /* Find and clear each bit */
{
ASSERT (min_from >= 0 && min_from < MAX_MIN);
range [BYTE (min_from)] &= 255 - BIT (min_from);
min_from++;
}
return (0); /* No errors */
}
| | << | < | > | >> |
|