コード例 #1
0
int main ()
{
	People_t people[MAX_SIZE];
	Appointment_t appointment[MAX_SIZE];
	char fpeople[]="people.txt";
	char fpeoplereqs[]="peoplereqs.txt";
	char foutput[]="output.txt";
	int size;
	int app_size;
	int i;
	size = get_people(fpeople,people,MAX_SIZE);
	app_size = get_appointments(fpeoplereqs,appointment,MAX_SIZE);

	if(app_size == size)
	{	
		write_names(appointment,app_size,people,size);
		size = check_appointments(appointment,size);
		sort_appointments(appointment,size);
		write_appointments(foutput,appointment,size);
			
	}
	else printf("appointments size and people size are not the same please check it \n");
	
	return 0;
}
コード例 #2
0
int main(int argc , char *argv[])
{
	int size;
	Appointment_t *appo;
	Working_hours_t hours;
	Files_t files;

	#ifdef DEBUG
	printf("STARTED argc = %d %s \n",argc,argv[1]);
	#endif
	get_main_arguments(argc,argv,&hours,&files);
	
	appo = getRequests(&files,&size);
	#ifdef DEBUG
	printf("allocated array's siz is %d \n",size);
	#endif
	
    write_appointments(appo,size,&files);

    print_parameters(&files,&hours);

    #ifdef DEBUG
    printf("%s %s %s %s %s %s",files.records_file_n
                           ,files.patients_file_n
                           ,files.accepted_appo_file_n
                           ,files.delete_file_n
                           ,files.parameters_file_n
                           ,files.readable_records_file_n);
    #endif

	return 0;
}
コード例 #3
0
int main(void)
{
	char file1[STRING_SIZE]="People.txt";
	char file2[STRING_SIZE]="AppointmentReqs.txt";
	char file3[STRING_SIZE]="Appointments.txt";
	int size_appoint,
		size_peop,
		new_size;
	People_t people[SIZE_OF_ARRAY];
	Appointment_t appointments[SIZE_OF_ARRAY];
	
	size_peop=get_people(file1,people,MAX_SIZE);
	
	size_appoint=get_appointments(file2,appointments,MAX_SIZE);
	
	write_names(appointments,size_appoint,people,size_peop);
	
	new_size=check_appointments(appointments,size_appoint);
	
	sort_appointments(appointments,new_size);
	
	write_appointments(file3,appointments,new_size);
	
	return 0;
}
コード例 #4
0
int main(int argc, char *argv[])
{
	Files_t files;
	Working_hours_t hours;
	Appointment_t *arr;
	node_t* node,*temp;
	int size,num,i;
	get_main_arguments(argc,argv,&hours,&files);
	arr=getRequests(&files,&size);
	
	print_parameters(&files,&hours);
	write_appointments(arr,size,&files);
	
	node=build_ll(arr,size,&hours);
	temp=node;	
	#ifndef DEBUG_MODE
	while(node!=NULL){
		printf("hour=%d\n",node->hour);
		node=node->next;
	}
	#endif
	
	node=temp;
	add_personal_data(node,&files);	
	node=temp;
	
	delete_appointments(&node,&files);
			
	write_accepted_app(node,&files);
	free_list(node);
	return 0;
}
int	main(int argc, char* argv[])
{
	Appointment_t* appointments; /*Array of records*/
	int size; /*Number of records*/
	
	/*Takes main arguments and change hours and file names*/
	get_main_arguments(argc, argv, &hours, &files);
	
	/*Reads records and writes into the array them*/
	/*Size is a records number*/
	appointments=getRequests(&files, &size);
	
	/*Takes array of records and writes records into the file as xml file*/
	write_appointments(appointments, size, &files);
	
	/*Writes file names and hours into the file*/
	print_parameters(&files, &hours);

	return 0;
}
int
main(void)
{
	People_t people[5];
	Appointment_t appointments[5];
	int size_people,size_app,new_size_app;

	size_people=get_people("People.txt",people,5);
	size_app=get_appointments("AppointmentReqs.txt",appointments,5);

	write_names(appointments,size_app,people,size_people);

	new_size_app=check_appointments(appointments,size_app);

	sort_appointments(appointments,new_size_app);

	write_appointments("Appointments.txt",appointments,new_size_app);

	return 0;
}