예제 #1
0
struct iso_directory_record* iso9660_get_node(
		iso9660_VOLUME *volume,
		struct iso_directory_record *dirnode,
		const char *path)
{
	struct iso_directory_record* result;
	struct iso_directory_record* current;
	char name[256];
	int i;

	current = idr_new(dirnode);
	while(1)
	{
		/* ignore head '\' */

		while (*path && *path == '\\')
			path++;

		if (*path == 0)
			break;

		/* extract first path component */

		i = 0;
		while (*path && *path != '\\')
			name[i++] = *path++;
		name[i] = 0;

		/* seek first component in current directory */

		result = seek_name(volume, current, name);
		if (result == NULL)
			return NULL;

		free(current);
		current = result;
	}
	return current;
}
예제 #2
0
//查询影片信息 
int seek (movie *head) {

	int choose;
	char choice;

	do {
		printf ("***************************************************************************************\n");
		printf ("********************************************************");
		printf ("\n     **    1.Seek screening time 		**\n");
 		printf ("     **    2.Seek the movie name 		**\n ");
		printf ("    **    3.Seek the director of the movie     **\n");
                printf ("     **    4.Seek the movie time 		**\n");
		printf ("     **    0.exit 				**\n");
		printf ("********************************************************\n");
		printf ("***************************************************************************************\n");
		printf ("Please choose you want to seek:");
		scanf ("%d", &choose);
		printf ("\n");

		switch (choose) {
		
			case 1: seek_screening (head);break;
			case 2: seek_name (head);     break;
			case 3: seek_director (head); break;
			case 4: seek_time (head);     break;
			case 0:                       break;
		
		}

		printf ("\nDo you want to continue?(y/n)\n:");
		getchar();
		scanf ("%c", &choice);

	} while (choice == 'y' || choice == 'Y');

	return 1;

}