Ejemplo n.º 1
0
int
main(
	int argc,
	char *argv[])
{
	FILE *input = stdin;
	FILE *output = stdout;
	FILE *output2 = open_it("options_menu.h", "w");
	MYDATA *m, *n;

	if (argc > 1)
		input = open_it(argv[1], "r");
	if (argc > 2)
		output = open_it(argv[2], "w");
	makecfg(input, output, output2);

	m = all_data;
	while (m) {
		n = m->link;
		FreeIfNeeded(m->name);
		FreeIfNeeded(m->type);
		free(m);
		m = n;
	}

	return (0);
}
Ejemplo n.º 2
0
void	scan_export(t_alias **alias)
{
  int		no;
  BOOL		c;
  char		*s;
  FD		file;

  c = TRUE;
  no = 0;
  if ((file = open_it()) == -1)
    return ;
  while ((s = get_next_line(file)) != NULL && c)
    {
      if (NMATCH("export", s))
	c = export_env(s + my_strlen("export")
		       + hempty(s + my_strlen("export")), no);
      else if (NMATCH("alias", s))
	c = export_alias(s + my_strlen("export")
			 + hempty(s + my_strlen("export")),
			 alias, no);
      else if (!nempty(s, my_strilen(s, '#')))
	return ;
      no++;
    }
}
Ejemplo n.º 3
0
Archivo: pwd.c Proyecto: klange/toaruos
struct passwd * getpwent(void) {
	if (!pwdb) {
		open_it();
	}

	if (!pwdb) {
		return NULL;
	}

	return fgetpwent(pwdb);
}
Ejemplo n.º 4
0
Archivo: init.c Proyecto: gedare/rtems
rtems_task Init(
  rtems_task_argument argument
)
{
  TEST_BEGIN();

  pppasyncattach();
  open_it();
  set_wakeups();
  set_discipline();
  write_it();
  ioctl_it();
  read_it();
  close_it();

  TEST_END();

  rtems_test_exit(0);
}
Ejemplo n.º 5
0
rtems_task Init(
  rtems_task_argument ignored
)
{
  bool more_data;

  printf( "\n\n*** %s TEST ***\n", Mouse_Type_Long );

  open_it();
  register_it(); 
  do {
    more_data = enqueue_next_action(
      Mouse_Actions,
      Mouse_Actions_Size, 
      Mouse_Actions_Per_Iteration
    );
    receive_uid_message();
  } while (more_data);
  close_it(); 
  printf( "*** END OF %s TEST ***\n", Mouse_Type_Long );
  rtems_test_exit( 0 );
}
Ejemplo n.º 6
0
Archivo: alarm.c Proyecto: juddy/edcde
extern void
reminder_driver(XtPointer client_data, XtIntervalId *interval_id) {
	Calendar		*c = (Calendar *)client_data;
	Tick			run_tick;
	int			i;

	if (c->view->next_alarm_id != *interval_id || !c->view->next_alarm) {
		c->view->next_alarm_id = 0;
		reset_timer(c);
		return;
	}


	/*
	 * do not handle the reminder if the time it's to happen
	 * is earlier than the current time
	 */
	_csa_iso8601_to_tick(c->view->next_alarm[0].run_time, &run_tick);
	if (now() >= run_tick) {

		for (i = 0; i < c->view->next_alarm_count; i++) {
			if (strcmp(c->view->next_alarm[i].attribute_name, CSA_ENTRY_ATTR_AUDIO_REMINDER)==0) 
				ring_it(client_data, interval_id);
			else if (strcmp(c->view->next_alarm[i].attribute_name, CSA_ENTRY_ATTR_FLASHING_REMINDER)==0) 
				flash_it(client_data, interval_id);
			else if (strcmp(c->view->next_alarm[i].attribute_name, CSA_ENTRY_ATTR_POPUP_REMINDER)==0) 
				open_it(client_data, interval_id, &c->view->next_alarm[i]);
			else if (strcmp(c->view->next_alarm[i].attribute_name, CSA_ENTRY_ATTR_MAIL_REMINDER)==0) 
				mail_it(client_data, interval_id, &c->view->next_alarm[i]);

		}
	}

	c->view->next_alarm_id = 0;

	reset_timer(c);
}