⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rdsint.c

📁 unix环境下c语言屏幕编程开发
💻 C
字号:
#include "../inc/screen.h"/* *	    在x列y行处读一正整数 */rdsint0(x,y,start,length)int 	x,y,start,length;{	return(rdsint(x,y,(int *)0,start,length,0));}rdsintx0(x,y,length)int 	x,y,length;{	return(rdsint(x,y,(int *)0,length,length,0));}rdsinty0(x,y,length)int 	x,y,length;{	return(rdsint(x,y,(int *)0,1,length,0));}rdsint1(x,y,start,length)int 	x,y,start,length;{	return(rdsint(x,y,(int *)0,start,length,1));}rdsintx1(x,y,length)int 	x,y,length;{	return(rdsint(x,y,(int *)0,length,length,1));}rdsinty1(x,y,length)int 	x,y,length;{	return(rdsint(x,y,(int *)0,1,length,1));}rdsint2(x,y,start,length)int 	x,y,start,length;{	return(rdsint(x,y,(int *)0,start,length,2));}rdsintx2(x,y,length)int 	x,y,length;{	return(rdsint(x,y,(int *)0,length,length,2));}rdsinty2(x,y,length)int 	x,y,length;{	return(rdsint(x,y,(int *)0,1,length,2));}rdsint3(x,y,start,length)int 	x,y,start,length;{	return(rdsint(x,y,(int *)0,start,length,3));}rdsintx3(x,y,length)int 	x,y,length;{	return(rdsint(x,y,(int *)0,length,length,3));}rdsinty3(x,y,length)int 	x,y,length;{	return(rdsint(x,y,(int *)0,1,length,3));}rdsint(x,y,value,start,length,flag)int 	x,y,*value,start,length,flag;{	int 	i,number;	char	ch,s[6];	if(x < 0 || x > 81-length || y < 0 || y>24 || length < 1 || length > 5)		return(ERR);	if(start < 1 || start > length || flag < 0 || flag > 3)		return(ERR);s_loop:	i = 0;	do{		scp(x + i,y);		ch = wgetchar();				switch(ch)		{			case 'q': case 'Q': case '+': 			case 'e': case 'E': case ',': 				if( i == 0 )					return(EXIT);				else					beep(1);				break;			case TAB:				return(ABORT);			case ESC:				return(BKABORT);			case CR: case LF:				if(i == 0)				{					if(flag == 1 || flag == 3)						return(QUIT);					else						beep(1);				}				break;			case BLANK: case '.': case 'h': case 'H':			case BS:				if(i > 0)					i--;				scp(x + i,y);				putchar(SP);				break;			case '0':				if(i == 0 && (flag == 0 || flag == 1))				{					beep(1);					break;				}			case '1': case '2': case '3': case '4': case '5':			case '6': case '7': case '8': case '9':				if(i < length)				{					s[i] = ch;					i++;					putchar(ch);					break;				}			default:				beep(1);		}	}while(i < start || i >= start && ch != CR && ch != LF);	s[i] = NUL;	if(i <= 4 || strncmp("32767",s,5) >= 0)		sscanf(s,"%d",&number);	else	{		beep(1);		wblank(x,y,length);		goto s_loop;	}	if(value != (int *)0)		*value = number;	return(number);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -