Exemplo n.º 1
0
/*
 *	Fill the week bitmap with allowed times.
 */
static int week_fill(char *bitmap, char const *tm)
{
	char *s;
	char tmp[256];

	strlcpy(tmp, tm, sizeof(tmp));
	for (s = tmp; *s; s++)
		if (isupper(*s)) *s = tolower(*s);

	s = strtok(tmp, ",|");
	while (s) {
		day_fill(bitmap, s);
		s = strtok(NULL, ",|");
	}

	return 0;
}
Exemplo n.º 2
0
/*
 *	Fill the week bitmap with allowed times.
 */
static int week_fill(char *bitmap, char *tm)
{
	char *s;
	char tmp[128];

	strlcpy(tmp, tm, 128);
	tmp[127] = 0;
	for (s = tmp; *s; s++)
		if (isupper(*s)) *s = tolower(*s);

	s = strtok(tmp, ",|");
	while (s) {
		day_fill(bitmap, s);
		s = strtok(NULL, ",|");
	}

	return 0;
}