📄 wrjusts.c
字号:
/* CXL - Copyright (c) 1987-1989 by Mike Smedley - All Rights Reserved */
/* WRJUSTS.C - right justifies a string in active window */
#include <string.h>
#include "cxlvid.h"
#include "cxlwin.h"
int wrjusts(int wrow,int wjcol,int attr,char *str)
{
int row,col,jcol;
/* check for active window */
if(!_winfo.total) return(_winfo.errno=W_NOACTIVE);
/* check for valid coordinates */
if(wchkcoord(wrow,wjcol)) return(_winfo.errno=W_INVCOORD);
/* calculate effective coordinates */
row=_winfo.active->srow+wrow+_winfo.active->border;
jcol=_winfo.active->scol + wjcol + _winfo.active->border;
col=jcol - strlen(str) + 1;
/* make sure left side of string fits in window */
if( col < (_winfo.active->scol+_winfo.active->border) )
return(_winfo.errno=W_STRLONG);
/* display the string */
prints(row,col,attr,str);
/* return normally */
return(_winfo.errno=W_NOERROR);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -