Due to an increase in demand for and questions about direct disk access for Micrososft platforms, a

源代码在线查看: lib.c

软件大小: 98 K
上传用户: zcmm_321
关键词: Micrososft for questions platforms
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*
				 * lib,c        misc, stuff (see also win32\wlib.c)
				 *
				 * This file is part of the BETA version of DISKLIB
				 * Copyright (C) 1998, Gregg Jennings
				 *
				 * See README.TXT for information about re-distribution.
				 * See DISKLIB.TXT for information about usage.
				 *
				 */
				
				#include 
				#include 
				
				extern int confirm(void)
				{
				#if LONG_INPUT          /* full word input only */
				char buf[BUFSIZ];
				
				    printf("\nAre you sure? [yes,No] ");
				    fgets(buf,BUFSIZ,stdin);
				    return strcmp(buf,"yes\n") == 0;
				
				#else                   /* a 'y' will do */
				int c;
				
				    printf("\nAre you sure? [y,N] ");
				    c = getchar();
				    if (c != '\n')
				        while (getchar() != '\n')
				            ;
				    return c == 'y';
				#endif
				}
				
				extern int ask(const char *str)
				{
				#if LONG_INPUT          /* full word input only */
				char buf[BUFSIZ];
				
				    if (str)
				        printf("%s",str);
				    printf(" [yes,No] ");
				    fgets(buf,BUFSIZ,stdin);
				    return strcmp(buf,"yes\n") == 0;
				
				#else                   /* a 'y' will do */
				int c;
				
				    if (str)
				        printf("%s",str);
				    printf(" [y,N] ");
				    c = getchar();
				    if (c != '\n')
				        while (getchar() != '\n')
				            ;
				    return c == 'y';
				#endif
				}
				
				
				extern void die(const char *msg, const char *fmt, int arg)
				{
				    printf("\n%s",msg);
				    if (fmt)
				        printf(fmt,arg);
				    printf("\n");
				    exit(1);
				}
							

相关资源