📄 screen.h
字号:
#include <ctype.h>#include <sys/types.h>#include <fcntl.h>#include <math.h>#include <setjmp.h>#include <signal.h>#include <stdio.h>#include <stdlib.h>#include <errno.h>#include <string.h>#include <sys/ipc.h>#include <sys/msg.h>#include <sys/timeb.h>#include <termio.h>#include <time.h>#include <sys/timeb.h>#include <pthread.h>#include <arpa/inet.h>#include <netinet/in.h>#include <sys/types.h>#include <sys/socket.h>#include <sys/wait.h>#include <sys/ipc.h>#include <sys/sem.h>#include <unistd.h>/* 格式控制 (FE) 类字符 */#define BS '\010' /* 退格 */#define TAB '\011'#define LF '\012' /* 换行 */#define VT '\013' /* 纵向 (垂直) 制表 */#define FF '\014' /* 换页 */#define CR '\015' /* 回车 *//* 其它控制类字符 */#define NUL '\0' /* 空字符 */#define BELL '\007'#define ESC '\033' /* 转义 */#define SP '\040' /* 间隔 (空格) */#define BLANK '\040'#define DEL '\177' /* 抹掉 *//* * 有关标志宏定义 */#define TRUE 1#define FALSE 0#ifndef ERR#define ERR (-1)#endif#define OK 0 /* 屏蔽中断退出信号 */#define DISSIG signal(SIGINT,SIG_IGN); \ signal(SIGQUIT,SIG_IGN); \ signal(SIGHUP,SIG_IGN); \ signal(SIGALRM,SIG_IGN); \ signal(SIGTERM,SIG_IGN);/* * 数据类型和全程变量说明 *//* 金额格式化结构 */struct dfrec{ double in; /* 金额, 如 152365788.23 */ char out[20];/* 格式化了的, 如 " 152,365,788.23" */};struct sfrec{ long in; char out[15];};/* 日期结构 */struct date{ int day; /* 日数 */ int month; /* 月份 */ int year; /* 年份 */ unsigned int ymd; /* 年月日 */};#define UPPER (-28)#define DOWN (-29) #define LEFT (-30) #define RIGHT (-31) #define HOME (-32) #define AC_UPPER 128 #define AC_DOWN 129 #define AC_LEFT 130 #define AC_RIGHT 131 #define AC_HOME 132 int daynum(), daynumx();int dayno(), daynox();int rddouble(), rdsint0(), rdsintx0(), rdsinty0();int rdsint1(), rdsintx1(), rdsinty1(), rdsint2(), rdsintx2(), rdsinty2();int rdsint3(), rdsintx3(), rdsinty3(), rdsint(), rdstr(),rdstr0();int testdate(), testldate(), testsdate(), wsfmt(), wdfmt();int clipped(),wlen(),strgrep(),rdymd();unsigned char wcrypt(), wgetch();long rdlint0(), rdlintx0(), rdlinty0();long rdlint1(), rdlintx1(), rdlinty1(), rdlint2(), rdlintx2();long rdlinty2(), rdlint3(), rdlintx3(), rdlinty3(), rdlint();long ymdh(),ymdd(),ymdt(),dtol(),addchk();unsigned long gtime();double adddamt(),subdamt(),adddamtx(),subdamtx();char *wtoday(), *covmoney(), wgetchar();void settty(),wstrcpy(),attri(),xdate(),ydate();void gcp(),scp(),plot(),market(),clscr(),clear(), beep(),scrmode(),line() ;void wstrcpyx(), window(), rubber(), m_blank(), w_pchar(), w_plot();void wprt(),wplotchar(),splot(),lplot(),wplot(),wblank();void fpt_str();#define BGN_TMDY {fprintf(fp,"\033[5i");fflush(fp);} /* 开始透明打印 */#define END_TMDY {fprintf(fp,"\033[4i");fflush(fp);} /* 结束透明打印 */#define DISP_CURSOR printf("\033[?25h"); FFSTD /* 显示光标 */#define HIDE_CURSOR printf("\033[?25l"); FFSTD /* 隐藏光标 */#define FFSTD fflush(stdout); /* 清除输出缓冲器. *//* 会计核算系统菜单结构及涵数说明 */#define PRO_PATH "/usr/cbas/bin/" /* 可执行程序路径 */#define MENU_MESS 24 /* 二级菜单题示信息行 */#define RETURN_VAL -2#define UP_KEY -128#define DOWN_KEY -127#define LEFT_KEY -126#define RIGHT_KEY -125#define ENTER_KEY 10#define SPACE_KEY 32#define CTRL_X 24#define CTRL_Y 25struct Exe_Name{ /* A: 二级菜单项所对应程序体 */ char *Pro; /* 为外部可执行程序 */ void (*Fun)(); /* 为内部涵数 */ struct Sub_Menu *Sub ; /* 为下一级菜单 */};struct Sub_Item{ /* B: 二级菜单项说明 */ char *Name; /* 名称 */ char Mark; /* 程序体标志 '2' 为下一级菜单, '1' 为外部程序, '0' 为涵数 */ struct Exe_Name Run_Name; /* 见 A: */ char *Message; /* 二级菜单项提示信息 */};struct Sub_Menu{ /* C: 二级菜单说明 */ int Ptr; /* 菜单指针 */ int Num; /* 包含项数 */ int Len; /* 二级菜单项长度 */ char *Head; /* 标题 即一级菜单项 */ struct Sub_Item *Item; /* 见 B: */ char *Hot_Key; /* 二级菜单热键串 */ char *Message ; /* 一级菜单提示信息 */}; struct Main_Menu{ /* D: 一级菜单说明 */ char *Head; /* 菜单标题 */ int Num; /* 一级菜单包含项数 */ int Len; /* 长度 */ int Row; /* 所在行 */ struct Sub_Menu *Sub; /* 见 C: */ char *Hot_Key ; /* 一级菜单热键串 */ void (*Fun)(); /* 空闲函数 */};int Main_Menu_Select();int Sub_Menu_Select();int Simple_Menu_Select();int Simple_Menu_SelectA();void Write_Sub_Menu();void write_message();int findch();void marketm();void plotm();/*返回值定义*/#define OFLOW (-1) #define QUIT (-2)#define EXIT (-3)#define ABORT (-4)#define TLONG (-5)#define CHKERR (-6)#define NEGSIGN (-7)#define BKABORT (-8)/*宏定义*/#define CLS_INPUT_AREA {Clear(3, MENU_MESS-1);\ prompt ("") ;}#define CENT_WINDOW(TITLE) window_title ( 1 , 79 , 3 , 23 , TITLE )#define CLS_SUB_AREA {Clear(5, MENU_MESS-1);\ prompt ("") ;}#define RUBBER_SUB_AREA { rubber ( 3 , 78 , 4 , 22 ) ; }#define CENT_WINDOW_PL(TITLE) window_title ( 1 , 79 , 5 , 23 , TITLE )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -