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

📄 newback.c

📁 seismic software,very useful
💻 C
字号:
/* Copyright (c) Colorado School of Mines, 1990./* All rights reserved.                       *//* Toggle backspace between delete and backspace * * Credit: Kochan & Wood, Topics in C Programming, Page 264 * CWP: Jack * * Caveat: compilers that are neither BSD nor Sys V might need a flag like -DBSD *         In any case, this is a convenience code, not something crucial. */#include "cwp.h"#include <sys/param.h>#define BS	'\010'#define DEL	'\177'#ifdef BSD#include <sgtty.h>#define GET	TIOCGETP#define SET	TIOCSETP#define ERASE	term.sg_erase#define IFILE	sgttyb#else#include "termio.h"#define GET	TCGETA#define SET	TCSETA#define ERASE	term.c_cc[VERASE]#define IFILE	termio#endifmain(){	struct IFILE term;	/* Put current state in term */	if (-1 == ioctl(STDIN, GET, &term))		perror("stdin is not a tty");	/* Toggle backspace */	ERASE = (ERASE == BS ? DEL : BS);	/* Change terminal state */	if (-1 == ioctl(STDIN, SET, &term))		perror("couldn't reset backspace");	return EXIT_SUCCESS;}

⌨️ 快捷键说明

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