예제 #1
0
/*
 *	Call the fill bitmap function for every day listed.
 */
static int day_fill(char *bitmap, char const *tm)
{
	char const *hr;
	int n;
	int start, end;

	for (hr = tm; *hr; hr++)
		if (isdigit((int) *hr))
			break;
	if (hr == tm)
		tm = "Al";

	timestr_debug("dayfill: hr %s    tm %s\n", hr, tm);

	while ((start = strcode(&tm)) >= 0) {
		/*
		 *	Find start and end weekdays and
		 *	build a valid range 0 - 6.
		 */
		if (*tm == '-') {
			tm++;
			if ((end = strcode(&tm)) < 0)
				break;
		} else
			end = start;
		if (start == 7) {
			start = 1;
			end = 5;
		}
		if (start > 7) {
			start = 0;
			end = 6;
		}
		n = start;
		timestr_debug("day_fill: range from %d to %d\n", start, end);
		while (1) {
			hour_fill(bitmap + 180 * n, hr);
			if (n == end) break;
			n++;
			n %= 7;
		}
	}

	return 1;
}
예제 #2
0
파일: change.c 프로젝트: maccasoft/lora2
void password_change()
{
   char stringa[20], parola[20];

   read_system_file("CHGPWD");

   m_print(bbstxt[B_ONE_CR]);

   for (;;) {
      m_print(bbstxt[B_SELECT_PASSWORD]);
      chars_input(stringa,15,INPUT_PWD|INPUT_FIELD);

      if (!strlen(stringa))
         return;

      strcpy(parola,stringa);

      m_print(bbstxt[B_VERIFY_PASSWORD]);

      m_print(bbstxt[B_PASSWORD]);
      chars_input(stringa,15,INPUT_PWD|INPUT_FIELD);

      if (!strlen(stringa) || !CARRIER)
         return;

      if(strcmp(stringa,parola) == 0)
         break;

      m_print(bbstxt[B_WRONG_PWD1],strupr(parola));
      m_print(bbstxt[B_WRONG_PWD2],strupr(stringa));
   }

   strcpy(usr.pwd,strcode(strupr(stringa),usr.name));
   data (stringa);
   stringa[9] = '\0';
   strcpy (usr.lastpwdchange, stringa);
}