| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

day_slot_set

#include "sflslot.h"
int
day_slot_set (byte *range, int min_from, int min_to)

Synopsis

Sets the slots for the specified minute range. If min_to is zero, it is ignored; only the slot for min_from is set. Returns 0 if okay, -1 if the specified range is invalid.

Source Code - (sflslot.c)

{
    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 set each bit            */
      {
        ASSERT (min_from >= 0 && min_from < MAX_MIN);
        range [BYTE (min_from)] |= BIT (min_from);
        min_from++;
      }
    return (0);                         /*  No errors                        */
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation